[
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to Plexus Interop\nThanks for your interest in the project! Here is some basic information about how to contribute.\n \n# Contributor License Agreement (CLA)\nA CLA is a document that specifies how a project is allowed to use your\ncontribution; they are commonly used in many open source projects.\n\nAll contributions to [Fintech Open Source Foundation](https://www.finos.org/) projects must be made under a [Contributor License Agreement](https://finosfoundation.atlassian.net/wiki/spaces/FINOS/pages/75530375/Legal+Requirements) that must also be met.\n\n_NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool. Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA. \n\nPull requests (PRs) submitted to the project cannot be accepted until you have a CLA in place with the Foundation.\n\n*Need an ICLA? Unsure if you are covered under an existing CCLA? Email [help@finos.org](mailto:help@finos.org)*\n \n# Contributing Issues\n\n## Prerequisites\n\n* [ ] Have you [searched for duplicates](https://github.com/finos-plexus/plexus-interop/issues?utf8=%E2%9C%93&q=)?  A simple search for exception error messages or a summary of the unexpected behaviour should suffice.\n* [ ] Are you running the latest version?\n* [ ] Are you sure this is a bug or missing capability?\n \n## Raising an Issue\n* Please raise issues to the project mailing list <plx@finos.org> ([Web Archive](https://groups.google.com/a/finos.org/forum/#!forum/plx)). Some people from project teams currently can't access build-in github issue tracker from corporate network.\n* Please also tag the new issue with either \"Bug\" or \"Enhancement\".\n \n# Contributing Pull Requests (Code & Docs)\nTo make review of PRs easier, please:\n \n * For major enhancements before working on any PR, please review the proposal with the project group via mailing list <plx@finos.org> to align it with roadmap.\n * Please make sure your PRs will merge cleanly - PRs that don't are unlikely to be accepted.\n * For code contributions, follow the general structure of the existing code.\n * For documentation contributions, follow the general structure, language, and tone of the existing docs.\n * Keep PRs small and cohesive - if you have multiple contributions, please submit them as independent PRs.\n * Minimize non-functional changes (e.g. whitespace).\n * Ensure all new files include a header comment block containing the [Apache License v2.0 and your copyright information](http://www.apache.org/licenses/LICENSE-2.0#apply).\n * If necessary (e.g. due to 3rd party dependency licensing requirements), update the NOTICE file with any required attribution or other notices\n * If your contribution includes source code for any Category B-licensed dependencies, please get a pre-approval from project leads via mailing list and then add an appropriate notice to this CONTRIBUTING file\n \n## Commit and PR Messages\n\n* **Reference issues, wiki pages, and pull requests liberally!**\n* Use the present tense (\"Add feature\" not \"Added feature\")\n* Use the imperative mood (\"Move button left...\" not \"Moves button left...\")\n* Limit the first line to 72 characters or less"
  },
  {
    "path": ".gitignore",
    "content": "### Gradle ###\nbuild\nnode_modules\n.gradle/\n\n### Maven ###\ntarget/\n!.mvn/wrapper/maven-wrapper.jar\n.idea\n*.iml\n**/src-gen/\n**/emf-gen\n**/xtend-gen\n**/xtext-gen\nlogs\n\n### Eclipse ###\n.classpath\n.project\n.settings/\n.metadata/\nbin/\n\n### JS ###\n.nyc_output\nnpm-debug.log\nlerna-debug.log\nnpm-debug.log.*\nyarn-error.log\ncoverage\n**/dist\n**/target/\n\n### VS Code ###\n**/*/symbols.json\n**/.vscode/settings.json\n\n### Asciidoc ###\n\n**/.asciidoctor/*\n\n### NPM ###\n\n**/*/.npmrc\n\n\n### IntelliJ\n*.iml\n*.ipr\n*.iws\n.idea/\nout/\n.DS_Store\n\n### Local configuration file (sdk path, etc)\nlocal.properties"
  },
  {
    "path": ".whitesource",
    "content": "{\n  \"scanSettings\": {\n    \"configMode\": \"AUTO\"\n  },\n  \"checkRunSettings\": {\n    \"vulnerableCheckRunConclusionLevel\": \"failure\"\n  },\n  \"issueSettings\": {\n    \"minSeverityLevel\": \"LOW\"\n  }\n}"
  },
  {
    "path": "FILE_HEADER",
    "content": "Copyright 2017-2021 Plexus Interop Deutsche Bank AG\nSPDX-License-Identifier: Apache-2.0\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "NOTICE",
    "content": "Copyright 2017-2019 Plexus Interop Deutsche Bank AG\nSPDX-License-Identifier: Apache-2.0\n\nThis product includes software developed at the Fintech Open Source Foundation (https://www.finos.org).\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n========================================================================\n========================================================================\nPlexus Interop DevTools information\n========================================================================\n========================================================================\n\nPlexus Interop DevTools is a part of a project which designed for\ndevelopers to simplify their experience with Plexus Interop \nframework. \n\nFollowing licenses are used as dependencies which incorporated \ninto the DevTools (\"dsl\" and \"samples\") and are not components of\nthe production software.\n\n========================================================================\nCommon Development and Distribution License 1.0\n========================================================================\n\nThe following components are provided under the Common Development and Distribution License 1.0. See project link for details.\n\n     (CDDL 1.0) (GPL2 w/ CPE) javax.annotation API (javax.annotation.*)\n     (CDDL 1.0) (GPL2 w/ CPE) javax.servlet-api API (javax.servlet.*)\n     \n========================================================================\nEclipse Public License 1.0\n========================================================================\n\nThe following components are provided under the Eclipse Public License 1.0. See project link for details.\n\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.xbase-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.util-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.xbase.ide-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.lsp4j-0.2.1) - https://github.com/eclipse/lsp4j\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.common.types-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.xbase.lib-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtend.lib-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtend.lib.macro-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.lsp4j.jsonrpc-0.2.1) - https://github.com/eclipse/lsp4j\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.ide-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.web.servlet-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.xbase.web-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.lsp4j.generator-0.2.1) - https://github.com/eclipse/lsp4j\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.ecore-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Xtext (org.eclipse.xtext.web-2.12.0) - https://www.eclipse.org/Xtext/\n    (Eclipse Public License 1.0) Junit (junit.junit:4.12) - http://junit.org/junit4\n    (Eclipse Public License 1.0) EMF (org.eclipse.emf.ecore.xcore.lib-1.1.100) - https://github.com/eclipse/emf\n    (Eclipse Public License 1.0) EMF (org.eclipse.emf.ecore.xmi-2.12.0) - https://github.com/eclipse/emf\n    (Eclipse Public License 1.0) EMF (org.eclipse.emf.ecore-2.12.0) - https://github.com/eclipse/emf\n    (Eclipse Public License 1.0) EMF (org.eclipse.emf.common-2.12.0) - https://github.com/eclipse/emf\n    (Eclipse Public License 1.0) emfjson (emfjson-jackson-0.14.0) - https://github.com/emfjson/emfjson-jackson\n    (Eclipse Public License 1.0) Equinox (org.eclipse.equinox.common-3.8.0) - http://www.eclipse.org/equinox/\n    (Eclipse Public License 1.0) Eclipse OSGI (org.eclipse.osgi-3.11.2) - http://www.eclipse.org/equinox/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-xml-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-annotations-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-util-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-server-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-webapp-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-security-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-plus-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-jndi-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-http-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-servlet-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n    (Eclipse Public License 1.0) Eclipse Jetty (jetty-io-9.3.8.v20160314) - https://www.eclipse.org/jetty/\n\n========================================================================\nProtocol Buffers\n========================================================================\n\nProtocol Buffers framework is used in accordance to following license:\n\n     Protocol Buffers - Google's data interchange format\n     Copyright 2008 Google Inc.  All rights reserved.\n     https://developers.google.com/protocol-buffers/\n\n     Redistribution and use in source and binary forms, with or without\n     modification, are permitted provided that the following conditions are\n     met:\n\n         * Redistributions of source code must retain the above copyright\n     notice, this list of conditions and the following disclaimer.\n         * Redistributions in binary form must reproduce the above\n     copyright notice, this list of conditions and the following disclaimer\n     in the documentation and/or other materials provided with the\n     distribution.\n         * Neither the name of Google Inc. nor the names of its\n     contributors may be used to endorse or promote products derived from\n     this software without specific prior written permission.\n\n     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n     \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "README.md",
    "content": "[![FINOS - Archived](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-archived.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/archived)\n\n_This project is archived, which means that it's in read-only state; you can download and use this code, but please be aware that it may be buggy and may also contain security vulnerabilities. If you're interested in restoring development activities on this project, please email help@finos.org_\n\n# Plexus Interop \n\n## Overview\n\nThe **Plexus Interop** project aims to define an open standard for desktop application interoperability and provides\nreference implementation of this standard. It formalizes connections between applications within a single user session\non client desktop through a central broker.\n\nThe main goal is to enable development of extensible workflows connecting independent apps developed by different\norganizations in different technologies (.NET, Web, Java, Python, etc.) by passing relevant context  (structured\ndata objects) between those apps.\n\nAlthough the industry is moving towards containerized desktop applications, Plexus Interop recognizes that much\nof the application landscape is not yet tied to containers and is architecturally agnostic of container implementation.\nSeparating interoperability from the container provides notable advantages: different containers can be leveraged in\nthe same workflow, and launched applications residing outside of containers can participate in interop activities.\n\nTechnically speaking, Plexus Interop is a metadata-centric language-agnostic desktop app-to-app interoperability\nframework with an extensible model for launching new instances of desktop applications on demand. Its extensibility\nis based on open standards which are essential parts of the project.  The architecture is based around central broker\nproviding hub-and-spoke connectivity between apps and brokering strongly-typed RPC-style calls between them. The broker\nhas a connection to an Application Lifecycle Manager (or Launcher) which is capable of creating new instances of apps\nbased on the their runtime-metadata (e.g. container type, launch command, command line parameters) defined in a registry.\n\n![Key components and high level architecture](./docs/src/main/asciidoc/images/architecture.png \"Key components and high level architecture\")\n\n## Raising an Issue\n* Please raise issues to the project mailing list <plx@finos.org> ([Web Archive](https://groups.google.com/a/finos.org/forum/#!forum/plx)). Some people from project teams currently can't access build-in github issue tracker from corporate network.\n* Please also tag the new issue with either \"Bug\" or \"Enhancement\".\n \n## Repository Overview\n\nPlexus Interop repository consist of the following main sections:\n* *desktop* - Interop Broker, .NET Interop Client and sample apps implemented in C# using [.NET Core 2.0](https://www.microsoft.com/net/download/core).\n* *web* - Web Interop Client and sample apps implemented in [TypeScript](https://www.typescriptlang.org/).\n* *dsl* - [Protobuf](https://developers.google.com/protocol-buffers/) and Plexus Interop grammar parsers, validators and code-generators implemented using [Xtext framework](https://eclipse.org/Xtext/).\n* *docs* - documentation implemented in [AsciiDoc](http://asciidoc.org/) format using [Asciidoctor](http://asciidoctor.org/) processor.\n* *protocol* - definitions of Plexus Interop protocol messages in [Protobuf](https://developers.google.com/protocol-buffers/) format.\n* *samples* - sample interop metadata. \n\nBuild and samples are currently tested on Windows environments; building and running on Linux/OSX environments is still experimental (see below).\n\n## Build/Install\n\n### General\n\nMake sure that Java SDK is installed and [JAVA_HOME variable is set](https://www.mkyong.com/java/how-to-set-java_home-on-windows-10/).\n\nAll Plexus Interop components can be built using [Gradle](https://gradle.org/) tool using the following single command:\n\n`./gradlew build --console plain`\n\nBuild produces artifacts into folder \"bin\"; the first run can take 10 minutes or more, depending on your Internet connection speed.\n\n### Build in restricted environment\n\nBuild configuration should work fine on standard setup, with access to Internet. However it is quite often to have Dev setup behind corporate proxy. To run build successfully you'll need to adjust few configuration items shown below:\n\n#### Gradle Proxy Settings\n\nTo adjust Gradle Proxy settings please update following lines in ```%USERPROFILE%\\.gradle\\gradle.properties```, using your Corporate Proxy's host and port instead of example values:  \n\n```\nsystemProp.proxySet=\"true\"\nsystemProp.http.proxyHost=proxy.host.acme.com\nsystemProp.http.proxyPort=8080\nsystemProp.https.proxyHost=proxy.host.acme.com\nsystemProp.https.proxyPort=8080\nsystemProp.http.nonProxyHosts=*.acme.com|localhost\n```\n\n#### Environment variables\n\nPlease adjust following Environment variables:\n\n Name | Value/Example | Description \n --- | --- | ---\n `HTTP_PROXY` | `http://userproxy.acme.com:8080` | Your corporate proxy host:port. \n `HTTPS_PROXY` | `http://userproxy.acme.com:8080` | Your corporate proxy host:port. \n`NO_PROXY` | `127.0.0.1,localhost,.acme.com` | List of Intranet hosts to exclude from accessing through proxy.\n`ELECTRON_MIRROR` | `https://github.com/electron/electron/releases/` | Host to download Electron binaries from, if different from default Github releases site.\n`SASS_BINARY_SITE` | `https://github.com/sass/node-sass/releases/` | Host to download Saas binaries from, if different from default Github releases site.\n\nThere are also few recommended/optional variables to improve your build/development experience:\n\nName | Value/Example | Description\n--- | --- | ---\n`PLEXUS_BUILD_SKIP_DOTNET_TESTS` | `true` | Disable integration tests for .Net components to decrease build time.\n`PLEXUS_BUILD_SKIP_WEB_TESTS` | `true` | Disable integration tests for Javascript components to decrease build time.\n`GRADLE_USER_HOME` | `C:\\Home\\Gradle` | Gradle stores cached packages in `%USERPROFILE%\\.gradle` by default, often pointing to Roaming Profile. So it worth to use some local folder instead. Please also copy existing Gradle settings to new folder.\n`NUGET_PACKAGES` | `C:\\Home\\NuGetGlobalPackages` | Nuget stores cached binaries in `%USERPROFILE%\\.nuget` by default, often pointing to Roaming Profile. So it worth to use some local folder instead.\n`NPM_REGISTRY_INSTALL` | `https://npm.registry.acme.com` | Can be used to replace default `https://registry.npmjs.org` with another registry/mirror to download NPM dependencies from. \n\n### Using OSX\n\nIf running on OSX, please update `desktop/src/Plexus.Interop.sln` file and remove any code block that starts with `ProjectSection(ProjectDependencies)` and ends with `EndSection`; if you have already executed the `gradlew` build once, you must cleanup your local checkout using `git clean -d -f -X` (add `-n` for a dry run).\n\n## Running Samples\n\nAfter successful build samples binaries will be located in `bin` directory.\n\nRun .Net to Web interop example on Windows:\n\n- Go to `bin/win-x86/samples/greeting` (or `bin/osx-x64/samples/greeting` for OSX/Linux)\n- Launch Broker – `LaunchBroker.cmd` (or `LaunchBroker.sh` for OSX/Linux)\n- Launch (from a different terminal) Greeting Client – LaunchGreetingClient.cmd\n    - Choose “Discovery” option (5) and “Greeting from Electron Web app” from discovery response\n\n    ![Sample-1](./docs/src/main/asciidoc/images/sample-1.png \"Sample-1\")\n    - Enter name, e.g. “John” and hit enter – Web Greeting Server app will be launched by Broker, print Greeting Request:\n\n    ![Sample-2](./docs/src/main/asciidoc/images/sample-2.png \"Sample-2\")\n    - And send response back to .Net Greeting Client\n\n    ![Sample-3](./docs/src/main/asciidoc/images/sample-3.png \"Sample-3\")\n\n    - Then choose Discovery (5) and “Greeting from .Net app” from discovery response\n    - Enter another name, e.g. “Mike” and hit enter - .Net Greeting Server app will be launched and print greeting request:\n\n    ![Sample-4](./docs/src/main/asciidoc/images/sample-4.png \"Sample-4\")\n\n\n## Documentation\n\nTo check out docs, visit [https://plexus.finos.org](https://plexus.finos.org).\n\nDocumentation project is located in folder 'docs'. We build documentation using [AsciiDoc](http://asciidoc.org/).\n\nTo render diagrams during the build you need to have [graphviz](http://www.graphviz.org) installed on the machine.\n\nInvoke the following command to run the documentation build:\n\n`gradlew -p docs --console plain`\n\nAfter successful build documentation is available via:\n\n`bin/docs/html5/index.html`\n\n## Contributing\n\n1. Fork it (<https://github.com/finos/plexus-interop/fork>)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Read our [contribution guidelines](.github/CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)\n4. Commit your changes (`git commit -am 'Add some fooBar'`)\n5. Push to the branch (`git push origin feature/fooBar`)\n6. Create a new Pull Request\n\n_NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool. Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.\n\n*Need an ICLA? Unsure if you are covered under an existing CCLA? Email [help@finos.org](mailto:help@finos.org)*\n\n## Troubleshooting\n\nProblem: Gradle fails to download dependencies, how to setup proxy configuration?\n\nSolution: Pass proxy settings into Gradle via command-line parameters - e.g. `gradlew.bat -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8888 -Dhttps.proxyHost=myproxy.com -D https.proxyPort=4444 ...`\n\n## Updating public documentation\n\nAs described above, public documentation is served using [GitHub Pages](https://help.github.com/articles/what-is-github-pages) and stored in `gh-pages` branch. So to update it, you simply need to push updated documentation to this branch. `gh-pages` branch structure is different from `master`, so manual update requires few steps:\n\n* Clone (if haven't cloned it yet) repository to `plexus-interop` folder\n* Clone another copy of repository to separate `plexus-interop-docs` folder, checkout `gh-pages` branch there\n* Create branch for documentation update, e.g. `git checkout -b feature/gh-pages-update`\n* Return back to folder with main line branch, build documentation `gradlew build -p docs --console plain`\n* Copy documentation sources - `plexus-interop/docs` to `plexus-interop-docs/docs`\n* Copy generated documentation - `plexus-interop/bin/html5` to `plexus-interop-docs` (project root)\n* Go to `plexus-interop-docs`, push the changes and raise PR against `gh-pages` branch\n\n## License\nThe code in this repository is distributed under the Apache License, Version 2.0.\n\nCopyright 2017-2019 Plexus Interop Deutsche Bank AG\n"
  },
  {
    "path": "add-file-headers.bat",
    "content": "call gradlew.bat license --console plain --no-daemon\n"
  },
  {
    "path": "build.bat",
    "content": "call gradlew.bat build --console plain --no-daemon"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    repositories {        \n        mavenCentral()\n    }\n}\n\nallprojects {\n    repositories {        \n        mavenCentral()\n    }\n}\n\nsubprojects {\n    repositories {        \n        mavenCentral()\n    }\n}"
  },
  {
    "path": "desktop/.gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore\n\n# User-specific files\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n\n# Proto generated files\n*.proto.cs\n\n# Visual Studio 2015 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUNIT\n*.VisualState.xml\nTestResult.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\npackages/\n\n*_i.c\n*_p.c\n*_i.h\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# JustCode is a .NET coding add-in\n.JustCode\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# TODO: Comment the next line if you want to checkin your web deploy settings\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# The packages folder can be ignored because of Package Restore\n**/packages/*\n**/nuget-packages/*\n**/.nuget-restored-packages/*\n# except build/, which is used as an MSBuild target.\n!**/packages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/packages/repositories.config\n# NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\n*.mdf\n*.ldf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules/\n\n# Typescript v1 declaration files\ntypings/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# JetBrains Rider\n.idea/\n*.sln.iml\n\n# CodeRush\n.cr/\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools/**\n# !tools/packages.config\n\n# BenchmarkDotNet\nBenchmarkDotNet.Artifacts/\n\n\n\n\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# CMake\ncmake-build-debug/\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Cursive Clojure plugin\n.idea/replstate.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties"
  },
  {
    "path": "desktop/.nuget-local-packages/README.txt",
    "content": "This folder is added to nuget.config as additional nuget feed.\nPut packages here if you want to test them without publishing to remote nuget."
  },
  {
    "path": "desktop/NuGet.Config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <packageRestore>\n    <!-- Allow NuGet to download missing packages -->\n    <add key=\"enabled\" value=\"True\" />\n    <!-- Automatically check for missing packages during build in Visual Studio -->\n    <add key=\"automatic\" value=\"True\" />\n  </packageRestore>\n  <packageSources>\n    <add key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" />\n    <add key=\"plexus-interop-local\" value=\".nuget-local-packages\" />\n  </packageSources>\n  <activePackageSource>\n    <add key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" />\n    <add key=\"plexus-interop-local\" value=\".nuget-local-packages\" />\n  </activePackageSource>\n</configuration>"
  },
  {
    "path": "desktop/README.txt",
    "content": "Prerequisites for development:\n- Windows 7+\n- Visual Studio 2017 15.7+ with enabled \".NET Core development\" feature OR Visual Studio Code 1.15+ with C# plugin 1.8+.\n- .NET Core SDK - any version in [2.1.300..2.1.399] for Windows x64 https://www.microsoft.com/net/download/core#/sdk\n- .NET Framework 4.6+ https://www.microsoft.com/net/download/framework\n- .NET Framework 4.5 Targeting Pack https://www.microsoft.com/net/targeting\n- .NET Framework 4.6 Targeting Pack https://www.microsoft.com/net/targeting\n\nRun \"build.cmd\" to build\nRun \"tests.cmd\" to run tests"
  },
  {
    "path": "desktop/build.cmd",
    "content": "REM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nif not defined PLEXUS_BUILD_DOTNET_PARAMS (\n  set PLEXUS_BUILD_DOTNET_PARAMS=/p:CORE_ONLY=true\n)\nCD %~dp0\ndotnet.cmd build -c release src\\Plexus.Interop.sln %PLEXUS_BUILD_DOTNET_PARAMS% && dotnet.cmd pack -c release -o ..\\bin\\nuget src\\Plexus.Interop.sln %PLEXUS_BUILD_DOTNET_PARAMS%"
  },
  {
    "path": "desktop/build.gradle",
    "content": "import org.apache.tools.ant.taskdefs.condition.Os\n\nplugins {\n    id \"com.github.hierynomus.license\" version\"0.14.0\"\n    id \"de.undercouch.download\" version \"3.2.0\"\n}\n\nrepositories {\n    mavenCentral()\n}\n\ndef dotnetSdkVersion = \"5.0\"\ndef buildCache = System.getenv(\"PLEXUS_BUILD_CACHE_DIR\") ?: new File(\"${rootDir}/build\").absolutePath\ndef coreOnly = System.env['PLEXUS_BUILD_CORE_ONLY'] == 'true'\ndef net4Only = System.env['PLEXUS_BUILD_NET4_ONLY'] == 'true'\ndef nugetPublish = System.env['PLEXUS_BUILD_NUGET_PUBLISH'] == 'true'\ndef testsEnabled = Os.isFamily(Os.FAMILY_WINDOWS) && System.env['BuildRunner'] != \"MyGet\" && System.env['PLEXUS_BUILD_SKIP_DOTNET_TESTS'] != 'true'\ndef nugetVersion = System.getenv(\"PLEXUS_BUILD_NUGET_VERSION\") ?: System.getenv(\"APPVEYOR_REPO_TAG_NAME\")\ndef dotnetParams = nugetVersion == null ? \" \" : \"/p:Version=$nugetVersion\"\n\nif (net4Only) {\n    dotnetParams += \" /p:NET4_ONLY=true\"\n} else if (coreOnly) {\n    dotnetParams += \" /p:CORE_ONLY=true\"\n}\n\nlicense {\n    header file(\"${rootDir}/FILE_HEADER\")\n    mapping {\n        cs='JAVADOC_STYLE'\n        proto='DOUBLESLASH_STYLE'\n        interop='DOUBLESLASH_STYLE'\n    }\n    strictCheck true\n}\n\ntask licenseFormatCS(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {\n    source = fileTree(dir: 'src').exclude(\"**/bin/*\").exclude(\"**/obj/*\")\n            .exclude(\"**/google/protobuf/*.proto\")\n            .include(\"**/*.cs\").include(\"**/*.proto\").include(\"**/*.interop\")\n}\n\ntasks[\"license\"].dependsOn licenseFormatCS\nlicenseFormat.dependsOn licenseFormatCS\n\ntask prepareDotnet {\n    doLast {\n\n        println \"Only netcore: $coreOnly\"\n        println \"Only net4: $net4Only\"\n        println \"Tests enabled: $testsEnabled\"\n\n        def dotnetVersion = new ByteArrayOutputStream()\n        exec {\n            ignoreExitValue true\n            commandLine 'cmd', '/c', \"$projectDir/dotnet.cmd\", \"--version\"\n            standardOutput = dotnetVersion;\n        }\n        dotnetVersion = \"$dotnetVersion\".trim()\n\n        if (dotnetVersion.startsWith(dotnetSdkVersion)) {\n            println \"Dotnet SDK $dotnetSdkVersion is already installed, skipping downloading\"\n        } else {\n            println \"Dotnet SDK $dotnetSdkVersion is not installed on the current machine. 'dotnet --version' command output: '$dotnetVersion'. Downloading Dotnet SDK $dotnetSdkVersion to $buildCache.\"\n\n            download {\n                onlyIfNewer true\n                src 'https://download.visualstudio.microsoft.com/download/pr/57776397-c87d-4eb8-9080-d58d180ccbe6/920afd9e178bdcd10fcfe696c1fdb88c/dotnet-sdk-5.0.408-win-x64.zip'\n                dest \"$buildCache/win/sdk/dotnet.zip\"\n            }\n\n            copy {\n                from zipTree(\"$buildCache/win/sdk/dotnet.zip\")\n                into \"$buildCache/win/sdk/dotnet\"\n            }\n\n            tasks.withType(Exec) {\n                environment \"PATH\", \"$buildCache/win/sdk/dotnet/\"\n                environment \"PLEXUS_BUILD_DOTNET_DIR\", \"$buildCache/win/sdk/dotnet/\"\n\t        }\n        }\n    }\n}\n\ntask compile(type:Exec) {\n    dependsOn 'license' \n    dependsOn prepareDotnet\n    \n    workingDir projectDir\n    environment \"PLEXUS_BUILD_DOTNET_PARAMS\", dotnetParams\n    commandLine \"$projectDir/build.cmd\"\n}\n\nif (testsEnabled) {\n    task test(dependsOn: compile, type:Exec) {\n        dependsOn prepareDotnet\n        workingDir projectDir\n    \tignoreExitValue false\n        environment \"PLEXUS_BUILD_DOTNET_PARAMS\", dotnetParams\n        commandLine \"$projectDir/tests.cmd\"\n    }\n} else {\n    task test(dependsOn: compile) {\n        doLast {\n            println \"Skipping tests because current platform is not Windows or running in MyGet\"\n        }\n    }\n}\n\nif (nugetVersion != null && nugetPublish) {\n    task push(dependsOn: test, type:Exec) {\n        dependsOn prepareDotnet\n        workingDir projectDir\n        commandLine \"$projectDir/push.cmd\"\n    }    \n} else {\n   task push(dependsOn: test) {\n        doLast {\n            println \"Skipping push because nuget version is not specified, or publish disabled\"\n        }\n    }\n}\n\ntask clean {\n    delete fileTree(dir: 'src').include(\"**/bin/*\").include(\"**/obj/*\")\n}\n\ntask build (dependsOn: [compile, test, push]) {}"
  },
  {
    "path": "desktop/coverage-broker.cmd",
    "content": "REM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nCD %~dp0\nif defined APPVEYOR (\n\tSET LOGGER=Appveyor\n) else (\n\tSET LOGGER=xunit\n)\n\nif not defined NUGET_PACKAGES (\n\tSET NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\n\nif not exist ..\\bin\\test-reports mkdir ..\\bin\\test-reports\n\nCALL dotnet restore src\\Plexus.Interop.sln && dotnet build src\\Plexus.Interop.sln -c debug /p:DebugType=Full && SET PLEXUS_TIMEOUT_MULTIPLIER=10 ^\n  && %NUGET_PACKAGES%\\OpenCover\\4.7.922\\tools\\OpenCover.Console.exe -oldStyle -returntargetcode -register:user -output:..\\bin\\test-reports\\dotnet-coverage.xml ^\n  -filter:\"+[Plexus.*]* -[*.Tests]* -[*.IntegrationTests]* -[*.Testing]* -[Plexus.Interop.Samples.*]* -[Plexus.*]*.Generated.* -[Plexus.Interop.Client*]* -[*.Client]*\" -excludebyfile:*.proto.cs;*.g.cs -skipautoprops ^\n  -targetdir:src -target:dotnet.exe -searchdirs:..\\bin\\win-x86\\broker -targetargs:\"test Plexus.Interop.Tests.sln /p:DebugType=Full --test-adapter-path:. --logger:%LOGGER% --verbosity quiet\" ^\n  && %NUGET_PACKAGES%\\ReportGenerator\\4.0.14\\tools\\net47\\ReportGenerator.exe -reports:..\\bin\\test-reports\\dotnet-coverage.xml -targetdir:..\\bin\\test-reports\\dotnet-coverage -sourcedirs:src reporttypes:Html"
  },
  {
    "path": "desktop/coverage-client.cmd",
    "content": "REM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nCD %~dp0\nif defined APPVEYOR (\n\tSET LOGGER=Appveyor\n) else (\n\tSET LOGGER=xunit\n)\n\nif not defined NUGET_PACKAGES (\n\tSET NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\n\nif not exist ..\\bin\\test-reports mkdir ..\\bin\\test-reports\n\nCALL dotnet restore src\\Plexus.Interop.sln && dotnet build src\\Plexus.Interop.sln -c debug /p:DebugType=Full && SET PLEXUS_TIMEOUT_MULTIPLIER=10 ^\n  && %NUGET_PACKAGES%\\OpenCover\\4.7.922\\tools\\OpenCover.Console.exe -oldStyle -returntargetcode -register:user -output:..\\bin\\test-reports\\dotnet-coverage.xml ^\n  -filter:\"+[Plexus.*]* -[*.Tests]* -[*.IntegrationTests]* -[*.Testing]* -[Plexus.Interop.Samples.*]* -[Plexus.*]*.Generated.* -[Plexus.Interop.Broker*]* -[Plexus.Interop.Apps.Manager*]* -[Plexus.Interop.Metamodel*]* -[*.Server]*\" -excludebyfile:*.proto.cs;*.g.cs -skipautoprops ^\n  -targetdir:src -target:dotnet.exe -searchdirs:..\\bin\\win-x86\\broker -targetargs:\"test Plexus.Interop.Tests.sln /p:DebugType=Full --test-adapter-path:. --logger:%LOGGER% --verbosity quiet\" ^\n  && %NUGET_PACKAGES%\\ReportGenerator\\4.0.14\\tools\\net47\\ReportGenerator.exe -reports:..\\bin\\test-reports\\dotnet-coverage.xml -targetdir:..\\bin\\test-reports\\dotnet-coverage -sourcedirs:src reporttypes:Html"
  },
  {
    "path": "desktop/coverage.cmd",
    "content": "REM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nCD %~dp0\nif defined APPVEYOR (\n\tSET LOGGER=Appveyor\n) else (\n\tSET LOGGER=xunit\n)\n\nif not defined NUGET_PACKAGES (\n\tSET NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\n\nif not exist ..\\bin\\test-reports mkdir ..\\bin\\test-reports\n\nCALL dotnet restore src\\Plexus.Interop.sln && dotnet build src\\Plexus.Interop.sln -c debug /p:DebugType=Full && SET PLEXUS_TIMEOUT_MULTIPLIER=10 ^\n  && %NUGET_PACKAGES%\\OpenCover\\4.7.922\\tools\\OpenCover.Console.exe -oldStyle -returntargetcode -register:user -output:..\\bin\\test-reports\\dotnet-coverage.xml ^\n  -filter:\"+[Plexus.*]* -[*.Tests]* -[*.IntegrationTests]* -[*.Testing]* -[Plexus.Interop.Samples.*]* -[Plexus.*]*.Generated.*\" -excludebyfile:*.proto.cs;*.g.cs -skipautoprops ^\n  -targetdir:src -target:dotnet.exe -searchdirs:..\\bin\\win-x86\\broker -targetargs:\"test Plexus.Interop.Tests.sln /p:DebugType=Full --test-adapter-path:. --logger:%LOGGER% --verbosity quiet\" ^\n  && %NUGET_PACKAGES%\\ReportGenerator\\4.0.14\\tools\\net47\\ReportGenerator.exe -reports:..\\bin\\test-reports\\dotnet-coverage.xml -targetdir:..\\bin\\test-reports\\dotnet-coverage -sourcedirs:src reporttypes:Html"
  },
  {
    "path": "desktop/dotnet.cmd",
    "content": "@ECHO OFF\n\"%PLEXUS_BUILD_DOTNET_DIR%dotnet.exe\" %*"
  },
  {
    "path": "desktop/global.json",
    "content": "{\n  \"projects\": [\n    \"src\"\n  ],\n  \"sdk\": {\n    \"version\": \"5.0.100\",\n    \"allowPrerelease\": false,\n    \"rollForward\": \"minor\"\n  }\n}"
  },
  {
    "path": "desktop/push.cmd",
    "content": "@ECHO OFF\nREM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nCD %~dp0\nif not defined PLEXUS_BUILD_NUGET_PUSH_TIMEOUT (\n\tSET PLEXUS_BUILD_NUGET_PUSH_TIMEOUT=3600\n)\ndotnet nuget push ..\\bin\\nuget\\*.nupkg -s %PLEXUS_BUILD_NUGET_SOURCE% -k %PLEXUS_BUILD_NUGET_API_KEY% -t %PLEXUS_BUILD_NUGET_PUSH_TIMEOUT% -n true"
  },
  {
    "path": "desktop/src/Common.csproj",
    "content": "<Project>\n  <PropertyGroup>\n    <LangVersion>latest</LangVersion>\n    <Version>0.1.0</Version>\n    <Authors>Plexus Interop Deutsche Bank AG</Authors>\n    <Company>Deutsche Bank AG</Company>\n    <Product>Plexus Interop</Product>\n    <Copyright>Copyright © Plexus Interop Deutsche Bank AG 2017-2018</Copyright>\n    <PackageLicenseUrl>https://github.com/finos-plexus/plexus-interop/blob/master/LICENSE</PackageLicenseUrl>\n    <PackageProjectUrl>http://plexus.finos.org</PackageProjectUrl>\n    <RepositoryUrl>https://github.com/finos-plexus/plexus-interop</RepositoryUrl>\n    <PackageTags>plexus interop finos</PackageTags>\n    <Description>Plexus Interop is metadata-centric language-agnostic desktop app-to-app interoperability framework with extensible model for launching new instances of desktop Apps on demand.</Description>\n    <TieredCompilation>true</TieredCompilation>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Channels/ChannelExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Channels\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public static class ChannelExtensions\n    {\n        private static readonly Task CompletedTask;\n\n        static ChannelExtensions()\n        {\n            var tcs = new TaskCompletionSource<Nothing>();\n            tcs.SetResult(Nothing.Instance);\n            CompletedTask = tcs.Task;\n        }\n\n        public static async Task CompleteAsync<T>(this ITerminatableWritableChannel<T> channel)\n        {\n            channel.TryComplete();\n            await channel.Completion.ConfigureAwait(false);\n        }\n\n        public static async Task TerminateAsync<T>(this ITerminatableWritableChannel<T> channel, Exception error = null)\n        {\n            channel.TryTerminate(error);\n            await channel.Completion.ConfigureAwait(false);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task WriteAsync<T>(this IWritableChannel<T> channel, T item, CancellationToken cancellationToken = default)\n        {\n            var result = await channel.TryWriteAsync(item, cancellationToken).ConfigureAwait(false);\n            if (!result)\n            {\n                throw new OperationCanceledException();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task WriteOrDisposeAsync<T>(this IWritableChannel<T> channel, T item, CancellationToken cancellationToken = default)\n            where T : IDisposable\n        {\n            try\n            {\n                await channel.WriteAsync(item, cancellationToken).ConfigureAwait(false);\n            }\n            catch\n            {\n                item.Dispose();\n                throw;\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task<bool> TryWriteAsync<T>(this IWritableChannel<T> channel, T item, CancellationToken cancellationToken = default)\n        {\n            do\n            {\n                if (channel.TryWrite(item))\n                {\n                    return true;\n                }\n            } while (await channel.WaitWriteAvailableAsync(cancellationToken).ConfigureAwait(false));\n            return false;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async ValueTask<T> ReadAsync<T>(this IReadableChannel<T> channel, CancellationToken cancellationToken = default)\n        {\n            var result = await channel.TryReadAsync(cancellationToken).ConfigureAwait(false);\n            if (!result.HasValue)\n            {\n                throw new OperationCanceledException();\n            }\n            return result.Value;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async ValueTask<Maybe<T>> TryReadAsync<T>(this IReadableChannel<T> channel, CancellationToken cancellationToken = default)\n        {\n            do\n            {\n                if (channel.TryRead(out var item))\n                {\n                    return item;\n                }\n            } while (await channel.WaitReadAvailableAsync(cancellationToken).ConfigureAwait(false));\n            return Maybe<T>.Nothing;\n        }\n        \n        public static void Terminate<T>(\n            this ITerminatableWritableChannel<T> channel,\n            Exception error = null)\n        {\n            if (!channel.TryTerminate(error))\n            {\n                throw new OperationCanceledException();\n            }\n        }\n\n        public static void Complete<T>(this ITerminatableWritableChannel<T> channel)\n        {\n            if (!channel.TryComplete())\n            {\n                throw new OperationCanceledException();\n            }\n        }\n\n        public static bool IsCompleted<T>(this IReadableChannel<T> channel)\n        {\n            return channel.Completion.IsCompleted;\n        }\n\n        public static bool IsCompleted<T>(this ITerminatableWritableChannel<T> channel)\n        {\n            return channel.Completion.IsCompleted;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task DisposeRemainingItemsAsync<T>(\n            this IReadableChannel<T> channel) where T : IDisposable\n        {\n            return channel.ConsumeAsync(x => x.Dispose());\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void DisposeBufferedItems<T>(\n            this IReadableChannel<T> channel) where T : IDisposable\n        {\n            channel.ConsumeBufferedItems(x => x.Dispose());\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void ConsumeBufferedItems<T>(\n            this IReadableChannel<T> channel, Action<T> handle)\n        {\n            while (channel.TryRead(out var item))\n            {\n                handle(item);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ConsumeAsync<T>(\n            this IReadableChannel<T> channel,\n            Action<T> handle,\n            CancellationToken cancellationToken = default,\n            Func<Task> onCompletedAsync = null,\n            Func<Exception, Task> onTerminatedAsync = null)\n        {\n            return channel.ConsumeAsync(\n                x =>\n                {\n                    handle(x);\n                    return CompletedTask;\n                },\n                cancellationToken,\n                onCompletedAsync,\n                onTerminatedAsync);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task ConsumeAsync<T>(\n            this IReadableChannel<T> channel,            \n            Func<T, Task> handleAsync,\n            CancellationToken cancellationToken = default,\n            Func<Task> onCompletedAsync = null,\n            Func<Exception, Task> onTerminatedAsync = null)\n        {            \n            try\n            {\n                do\n                {\n                    while (channel.TryRead(out var item))\n                    {\n                        await handleAsync(item).ConfigureAwait(false);\n                    }\n                } while (await channel.WaitReadAvailableAsync(cancellationToken).ConfigureAwait(false));\n\n                if (onCompletedAsync != null)\n                {\n                    await onCompletedAsync().ConfigureAwait(false);\n                }\n            }\n            catch (Exception ex)\n            {\n                if (onTerminatedAsync != null)\n                {\n                    await onTerminatedAsync(ex).ConfigureAwait(false);\n                }\n                else\n                {\n                    throw;\n                }\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async ValueTask<T> FirstAsync<T>(\n            this IReadableChannel<T> channel,\n            Func<T, bool> predicate,\n            CancellationToken cancellationToken = default)\n        {\n            while (!cancellationToken.IsCancellationRequested)\n            {\n                var item = await channel.TryReadAsync(cancellationToken);\n                cancellationToken.ThrowIfCancellationRequested();\n                if (item.HasValue && predicate(item.Value))\n                {\n                    return item.Value;\n                }\n            }\n\n            throw new Exception(\"There is no first element in sequence\");\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async ValueTask<T> FirstAsync<T>(\n            this IReadableChannel<T> channel,\n            CancellationToken cancellationToken = default)\n        {\n            while (!cancellationToken.IsCancellationRequested)\n            {\n                var item = await channel.TryReadAsync(cancellationToken);\n                cancellationToken.ThrowIfCancellationRequested();\n                if (item.HasValue)\n                {\n                    return item.Value;\n                }\n            }\n\n            throw new Exception(\"There is no first element in sequence\");\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Channels/Plexus.Channels.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Buffers\" Version=\"4.5.0\" />\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/AppConnectionDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    public sealed class AppConnectionDescriptor\n    {\n        public UniqueId ConnectionId { get; }\n\n        public string ApplicationId { get; }\n\n        public UniqueId ApplicationInstanceId { get; }\n\n        public TransportType TransportType { get; }\n\n        public AppConnectionDescriptor(\n            UniqueId connectionId,\n            string applicationId,\n            UniqueId applicationInstanceId,\n            TransportType transportType)\n        {\n            ConnectionId = connectionId;\n            ApplicationId = applicationId;\n            ApplicationInstanceId = applicationInstanceId;\n            TransportType = transportType;\n        }\n\n        public override bool Equals(object obj)\n            => obj is AppConnectionDescriptor other\n            && ConnectionId == other.ConnectionId\n            && ApplicationId == other.ApplicationId\n            && ApplicationInstanceId == other.ApplicationInstanceId\n            && TransportType == other.TransportType;\n\n        public override int GetHashCode()\n            => ConnectionId.GetHashCode()\n            ^ ApplicationId.GetHashCode()\n            ^ ApplicationInstanceId.GetHashCode()\n            ^ TransportType.GetHashCode();\n\n        public override string ToString()\n            => $\"{ApplicationId}, \" +\n               $\"{nameof(ConnectionId)}: {ConnectionId}, \" +\n               $\"{nameof(ApplicationInstanceId)}: {ApplicationInstanceId}, \" +\n               $\"{nameof(TransportType)}: {TransportType}\";\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/BrokerFeatures.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n\n    [Flags]\n    public enum BrokerFeatures : long\n    {\n        None = 0,\n        CheckAppInstanceId = 1,\n        UseWSS = 2,\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Channels/ChannelWriteTimeoutException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Channels\n{\n    using System;\n\n    public sealed class ChannelWriteTimeoutException : Exception\n    {\n        public ChannelWriteTimeoutException(TimeSpan timeout) : base(\n            $\"Timeout {timeout.TotalSeconds}sec on writing to channel\")\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Channels/IChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Channels\n{\n    public interface IChannel<T>\n    {\n        ITerminatableWritableChannel<T> Out { get; }\n\n        IReadableChannel<T> In { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Channels/IReadableChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Channels\n{    \n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public interface IReadableChannel<T>\n    {\n        Task Completion { get; }\n\n        bool TryRead(out T item);\n\n        Task<bool> WaitReadAvailableAsync(CancellationToken cancellationToken = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Channels/ITerminatableWritableChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Channels\n{\n    using System;\n\n    public interface ITerminatableWritableChannel<in T> : IWritableChannel<T>\n    {\n        bool TryComplete();\n\n        bool TryTerminate(Exception error = null);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Channels/IWritableChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Channels\n{\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public interface IWritableChannel<in T>\n    {\n        Task Completion { get; }\n\n        bool TryWrite(T item);\n\n        Task<bool> WaitWriteAvailableAsync(CancellationToken cancellationToken = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/EnvironmentHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n\n    public static class EnvironmentHelper\n    {\n        public const string BrokerWorkingDirVarName = \"PLEXUS_BROKER_WORKING_DIR\";\n        public const string AppInstanceIdVarName = \"PLEXUS_APP_INSTANCE_ID\";\n        public const string ParentProcessIdVarName = \"PLEXUS_PARENT_PROCESS_ID\";\n        public const string PlexusTimeoutMultiplier = \"PLEXUS_TIMEOUT_MULTIPLIER\";\n        public const string PlexusBrokerWebSocketAddress = \"PLEXUS_BROKER_WEBSOCKET_ADDRESS\";\n        public const string PlexusBrokerWebSocketSecureAddress = \"PLEXUS_BROKER_WEBSOCKETSECURE_ADDRESS\";\n        public const string PlexusBrokerPipeAddress = \"PLEXUS_BROKER_PIPE_ADDRESS\";\n        public const string BrokerFeatures = \"PLEXUS_BROKER_FEATURES\";\n        public const string LauncherId = \"PLEXUS_TRUSTED_LAUNCHER_ID\";\n        public const string CertificatePath = \"PLEXUS_CERTIFICATE_PATH\";\n        public const string CertificatePassword = \"PLEXUS_CERTIFICATE_PASSWORD\";\n        public const string CertificateKeyStorageFlags = \"PLEXUS_CERTIFICATE_KEY_STORAGE_FLAGS\";\n        public const string SslProtocols = \"PLEXUS_SSL_PROTOCOLS\";\n\n        public static string GetBrokerWorkingDir()\n        {\n            return Environment.GetEnvironmentVariable(BrokerWorkingDirVarName);\n        }\n\n        public static string GetBrokerWorkingDirOrThrow()\n        {\n            return GetBrokerWorkingDir() ?? throw new InvalidOperationException(\n                       $\"Expected environment variable {BrokerWorkingDirVarName} not set\");\n        }\n\n        public static string GetAppInstanceId()\n        {\n            return Environment.GetEnvironmentVariable(AppInstanceIdVarName);\n        }\n\n        public static string GetParentProcessId()\n        {\n            return Environment.GetEnvironmentVariable(ParentProcessIdVarName);\n        }\n\n        public static double GetPlexusTimeoutMultiplier()\n        {\n            return double.TryParse(Environment.GetEnvironmentVariable(PlexusTimeoutMultiplier), out var multiplier)\n                ? multiplier\n                : 1;\n        }\n\n        public static string GetWebSocketAddress()\n        {\n            return Environment.GetEnvironmentVariable(PlexusBrokerWebSocketAddress);\n        }\n\n        public static string GetWebSocketSecureAddress()\n        {\n            return Environment.GetEnvironmentVariable(PlexusBrokerWebSocketSecureAddress);\n        }\n\n        public static string GetPipeAddress()\n        {\n            return Environment.GetEnvironmentVariable(PlexusBrokerPipeAddress);\n        }\n\n        public static BrokerFeatures GetBrokerFeatures()\n        {\n            var rawValue = Environment.GetEnvironmentVariable(BrokerFeatures);\n            if (string.IsNullOrEmpty(rawValue))\n                return Plexus.BrokerFeatures.None;\n\n            return (BrokerFeatures)Enum.Parse(typeof(BrokerFeatures), rawValue);\n        }\n\n        public static UniqueId? GetLauncherAppInstanceId()\n        {\n            var rawValue = Environment.GetEnvironmentVariable(LauncherId);\n            if (string.IsNullOrEmpty(rawValue))\n                return null;\n\n            return UniqueId.FromString(rawValue);\n        }\n\n        public static string GetCertificatePath()\n        {\n            return Environment.GetEnvironmentVariable(CertificatePath);\n        }\n\n        public static string GetCertificatePassword()\n        {\n            return Environment.GetEnvironmentVariable(CertificatePassword);\n        }\n\n        public static X509KeyStorageFlags GetCertificateKeyStorageFlags()\n        {\n            var rawValue = Environment.GetEnvironmentVariable(CertificateKeyStorageFlags);\n            if (string.IsNullOrEmpty(rawValue))\n                return X509KeyStorageFlags.DefaultKeySet;\n\n            return (X509KeyStorageFlags)Enum.Parse(typeof(X509KeyStorageFlags), rawValue);\n        }\n\n        public static SslProtocols GetSslProtocols()\n        {\n            var rawValue = Environment.GetEnvironmentVariable(SslProtocols);\n            if (string.IsNullOrEmpty(rawValue))\n                return System.Security.Authentication.SslProtocols.None;\n\n            return (SslProtocols)Enum.Parse(typeof(SslProtocols), rawValue);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Maybe.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Collections.Generic;\n\nnamespace Plexus\n{\n    public struct Maybe<T> : IEquatable<Maybe<T>>\n    {\n        public static readonly Maybe<T> Nothing = new Maybe<T>();\n\n        private readonly T _value;\n\n        public Maybe(T value)\n        {\n            HasValue = true;\n            _value = value;\n        }\n\n        public bool HasValue { get; }\n\n        public T Value\n        {\n            get\n            {\n                if (!HasValue)\n                {\n                    throw new InvalidOperationException(\"Value not set\");\n                }\n                return _value;\n            }\n        }\n\n        public static implicit operator Maybe<T>(T value)\n        {\n            return new Maybe<T>(value);\n        }\n\n        public static implicit operator Maybe<T>(Nothing value)\n        {\n            return Nothing;\n        }\n\n        public T GetValueOrDefault()\n        {\n            return HasValue ? Value : default;\n        }\n\n        public T GetValueOrDefault(T defaultValue)\n        {\n            return HasValue ? Value : defaultValue;\n        }\n\n        public T GetValueOrThrowException<TException>(TException exception) where TException : Exception\n        {\n            if (!HasValue)\n            {\n                throw exception;\n            }\n            return Value;\n        }\n\n        public T GetValueOrThrowException<TException>() where TException : Exception, new()\n        {\n            if (!HasValue)\n            {\n                throw new TException();\n            }\n            return Value;\n        }\n\n        public override string ToString()\n        {\n            return HasValue ? Value?.ToString() : Plexus.Nothing.Instance.ToString();\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is Maybe<T> maybe && Equals(maybe);\n        }\n\n        public bool Equals(Maybe<T> other)\n        {\n            return EqualityComparer<T>.Default.Equals(_value, other._value) &&\n                   HasValue == other.HasValue;\n        }\n        \n        public static bool operator ==(Maybe<T> left, Maybe<T> right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(Maybe<T> left, Maybe<T> right)\n        {\n            return !left.Equals(right);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 1814622215;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<T>.Default.GetHashCode(_value);\n            hashCode = hashCode * -1521134295 + HasValue.GetHashCode();\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Nothing.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    public struct Nothing\n    {\n        public static readonly Nothing Instance = new Nothing();\n\n        public override bool Equals(object obj)\n        {\n            return obj is Nothing;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public override string ToString()\n        {\n            return \"<Nothing>\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Plexus.Common.Contracts.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n    <PackageReference Include=\"System.ValueTuple\" Version=\"4.5.0\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Pools/IPooledBuffer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Pools\n{\n    public interface IPooledBuffer : IPooledObject\n    {\n        byte[] Array { get; }\n\n        int Offset { get; }\n\n        int Count { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/Pools/IPooledObject.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Pools\n{\n    using System;\n\n    public interface IPooledObject : IDisposable\n    {\n        void Retain();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/TransportType.cs",
    "content": "﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    public enum TransportType\n    {\n        Pipe,\n        Ws,\n        Wss\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Common.Contracts/UniqueId.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    using System;\n    using System.Linq;\n    using System.Runtime.CompilerServices;\n    using System.Runtime.InteropServices;\n\n    // This class keeps UUID bytes in little-endian order\n    [StructLayout(LayoutKind.Sequential)]\n    public struct UniqueId : IEquatable<UniqueId>\n    {\n        public static readonly UniqueId Empty = new UniqueId(0, 0);\n\n        private readonly string _string;\n\n        private UniqueId(ulong hi, ulong lo)\n        {\n            Hi = hi;\n            Lo = lo;\n            var hiPart = BitConverter.GetBytes(hi);\n            var loPart = BitConverter.GetBytes(lo);\n            if (BitConverter.IsLittleEndian)\n            {\n                Reverse(hiPart, 0, 8);\n                Reverse(loPart, 0, 8);\n            }\n            var bytes = hiPart.Concat(loPart).ToArray();\n            _string = BitConverter.ToString(bytes).Replace(\"-\", \"\");\n        }\n        \n        public ulong Hi { get; }\n\n        public ulong Lo { get; }\n\n        public string String => _string ?? Empty.String;\n\n        public static UniqueId Generate()\n        {\n            var guid = Guid.NewGuid();\n            var bytes = guid.ToByteArray();\n            if (BitConverter.IsLittleEndian)\n            {\n                Convert(bytes);\n            }\n            Reverse(bytes, 0, 16);\n            var hi = GetLong(bytes, 0);\n            var lo = GetLong(bytes, 8);            \n            return new UniqueId(hi, lo);\n        }\n\n        public static UniqueId FromString(string value)\n        {\n            var bytes = HexStringToByteArray(value);\n            return new UniqueId(GetLong(bytes, 0), GetLong(bytes, 8));\n        }\n\n        public static UniqueId FromHiLo(ulong hi, ulong lo)\n        {\n            return new UniqueId(hi, lo);\n        }\n\n        public override string ToString()\n        {\n            return String;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void Reverse(byte[] bytes, int from, int to)\n        {\n            for (var i = from; i < (to - from) / 2; i++)\n            {\n                var t = bytes[i];                \n                bytes[i] = bytes[to - i - 1];\n                bytes[to - i - 1] = t;\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void Convert(byte[] guidBytes)\n        {\n            // reverse first 4 bytes\n            var t = guidBytes[0];\n            guidBytes[0] = guidBytes[3];\n            guidBytes[3] = t;\n            guidBytes[3] = t;\n            t = guidBytes[1];\n            guidBytes[1] = guidBytes[2];\n            guidBytes[2] = t;\n\n            // reverse next 2 bytes\n            t = guidBytes[4];\n            guidBytes[4] = guidBytes[5];\n            guidBytes[5] = t;\n\n            // reverse next 2 bytes\n            t = guidBytes[6];\n            guidBytes[6] = guidBytes[7];\n            guidBytes[7] = t;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static byte[] HexStringToByteArray(string hex)\n        {\n            if (hex.Length % 2 == 1)\n            {\n                throw new Exception(\"The binary key cannot have an odd number of digits\");\n            }\n\n            var arr = new byte[hex.Length >> 1];\n\n            for (var i = 0; i < hex.Length >> 1; ++i)\n            {\n                arr[i] = (byte)((GetHexVal(hex[i << 1]) << 4) + (GetHexVal(hex[(i << 1) + 1])));\n            }\n\n            return arr;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static int GetHexVal(char hex)\n        {\n            var val = (int)hex;\n            //For uppercase A-F letters:\n            return val - (val < 58 ? 48 : 55);\n        }\n\n        private static ulong GetLong(byte[] bytes, int i)\n        {\n            ulong x = 0;\n            for (var j = 0; j < 8; j++)\n            {\n                x = (x << 8) | bytes[i + j];\n            }\n            return x;\n        }\n\n        public static bool operator ==(UniqueId left, UniqueId right)\n        {\n            return left.Equals(right);\n        }\n\n        public static bool operator !=(UniqueId left, UniqueId right)\n        {\n            return !left.Equals(right);\n        }\n\n        public bool Equals(UniqueId other)\n        {\n            return Hi == other.Hi && Lo == other.Lo;\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            return obj is UniqueId && Equals((UniqueId) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (Hi.GetHashCode() * 397) ^ Lo.GetHashCode();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Generate.cmd",
    "content": "set INTEROP_METADATA_PATH=..\\..\\..\\dsl\\interop-lang\\src\\main\\resources\nset INTEROP_MANIFEST_PATH=command_line_tool.interop\nset CSHARP_NAMESPACE=internal_access:Plexus.Host.Internal.Generated\nset CSHARP_OUT=Internal\\Generated\n\nplexus gen-csharp -b %INTEROP_METADATA_PATH% -i %INTEROP_MANIFEST_PATH% -o %CSHARP_OUT% -n %CSHARP_NAMESPACE% -v"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/BrokerCliOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using CommandLine;\n    using CommandLine.Text;\n\n#if !NET45\n    [Verb(\"start\", HelpText = \"Start interop broker.\")]\n#endif\n    internal class StartCliOptions\n    {\n        [Option('m', \"metadata\", Required = false, HelpText = \"Directory to seek for metadata files: apps.json and interop.json.\")]\n        public string Metadata { get; set; }\n\n        [Option('p', \"port\", Required = false, HelpText = \"WS port number to listen. If omitted, free port is selected automatically.\")]\n        public uint Port { get; set; }\n\n        [Option(\"wssport\", Required = false, HelpText = \"WSS port number to listen. If omitted, free port is selected automatically.\")]\n        public uint WssPort { get; set; }\n    }\n\n#if !NET45\n    [Verb(\"broker\", HelpText = \"Start interop broker.\")]\n#endif\n    internal class BrokerCliOptions : StartCliOptions\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/BrokerProgram.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Host.Internal\n{\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Interop;\n\n    internal sealed class BrokerProgram : IProgram\n    {\n        private int _stopped;\n        private IBroker _broker;\n\n        private readonly BrokerOptions _options;\n\n        public BrokerProgram(BrokerOptions options)\n        {\n            _options = options;\n        }\n\n        public string Name { get; } = \"Interop Broker\";\n\n        public string InstanceKey { get; } = \"plexus-interop-broker\";\n\n        public InstanceAwareness InstanceAwareness { get; } = InstanceAwareness.SingleInstancePerDirectory;\n\n        public async Task<Task> StartAsync()\n        {\n            _broker = BrokerFactory.Instance.Create(_options);\n            if (_stopped == 1)\n            {\n                return Task.FromResult(0);\n            }\n            await _broker.StartAsync().ConfigureAwait(false);\n            return _broker.Completion;\n        }\n\n        public async Task ShutdownAsync()\n        {\n            if (Interlocked.Exchange(ref _stopped, 1) == 0 && _broker != null)\n            {\n                _broker.Stop();\n                await _broker.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/AppConnectionDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_connection_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_connection_descriptor.proto</summary>\n  internal static partial class AppConnectionDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_connection_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppConnectionDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0b3IucHJvdG8SB2lu\",\n            \"dGVyb3AaF2ludGVyb3AvdW5pcXVlX2lkLnByb3RvGhVpbnRlcm9wL29wdGlv\",\n            \"bnMucHJvdG8i1AEKF0FwcENvbm5lY3Rpb25EZXNjcmlwdG9yEigKDWNvbm5l\",\n            \"Y3Rpb25faWQYASABKAsyES5pbnRlcm9wLlVuaXF1ZUlkEg4KBmFwcF9pZBgC\",\n            \"IAEoCRIqCg9hcHBfaW5zdGFuY2VfaWQYAyABKAsyES5pbnRlcm9wLlVuaXF1\",\n            \"ZUlkEi4KDnRyYW5zcG9ydF90eXBlGAQgASgOMhYuaW50ZXJvcC5UcmFuc3Bv\",\n            \"cnRUeXBlOiOS2wQfaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcio3\",\n            \"Cg1UcmFuc3BvcnRUeXBlEgsKB1Vua25vd24QABIICgRQaXBlEAESBgoCV3MQ\",\n            \"AhIHCgNXc3MQA0IhqgIeUGxleHVzLkhvc3QuSW50ZXJuYWwuR2VuZXJhdGVk\",\n            \"YgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Host.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Host.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Host.Internal.Generated.TransportType), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.AppConnectionDescriptor), global::Plexus.Host.Internal.Generated.AppConnectionDescriptor.Parser, new[]{ \"ConnectionId\", \"AppId\", \"AppInstanceId\", \"TransportType\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum TransportType {\n    [pbr::OriginalName(\"Unknown\")] Unknown = 0,\n    [pbr::OriginalName(\"Pipe\")] Pipe = 1,\n    [pbr::OriginalName(\"Ws\")] Ws = 2,\n    [pbr::OriginalName(\"Wss\")] Wss = 3,\n  }\n\n  #endregion\n\n  #region Messages\n  internal sealed partial class AppConnectionDescriptor : pb::IMessage<AppConnectionDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionDescriptor> _parser = new pb::MessageParser<AppConnectionDescriptor>(() => new AppConnectionDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppConnectionDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor(AppConnectionDescriptor other) : this() {\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      appId_ = other.appId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      transportType_ = other.transportType_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor Clone() {\n      return new AppConnectionDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 2;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 3;\n    private global::Plexus.Host.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"transport_type\" field.</summary>\n    public const int TransportTypeFieldNumber = 4;\n    private global::Plexus.Host.Internal.Generated.TransportType transportType_ = global::Plexus.Host.Internal.Generated.TransportType.Unknown;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.TransportType TransportType {\n      get { return transportType_; }\n      set {\n        transportType_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      if (AppId != other.AppId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (TransportType != other.TransportType) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (TransportType != global::Plexus.Host.Internal.Generated.TransportType.Unknown) hash ^= TransportType.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Host.Internal.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Host.Internal.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Host.Internal.Generated.TransportType.Unknown) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.TransportType != global::Plexus.Host.Internal.Generated.TransportType.Unknown) {\n        TransportType = other.TransportType;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Host.Internal.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Host.Internal.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/AppLaunchMode.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_launch_mode.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_launch_mode.proto</summary>\n  internal static partial class AppLaunchModeReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_launch_mode.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLaunchModeReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch1pbnRlcm9wL2FwcF9sYXVuY2hfbW9kZS5wcm90bxIHaW50ZXJvcBoVaW50\",\n            \"ZXJvcC9vcHRpb25zLnByb3RvKjgKDUFwcExhdW5jaE1vZGUSEwoPU0lOR0xF\",\n            \"X0lOU1RBTkNFEAASEgoOTVVMVElfSU5TVEFOQ0UQAUIhqgIeUGxleHVzLkhv\",\n            \"c3QuSW50ZXJuYWwuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Host.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Host.Internal.Generated.AppLaunchMode), }, null, null));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum AppLaunchMode {\n    [pbr::OriginalName(\"SINGLE_INSTANCE\")] SingleInstance = 0,\n    [pbr::OriginalName(\"MULTI_INSTANCE\")] MultiInstance = 1,\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/AppLifecycleService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_lifecycle_service.proto</summary>\n  internal static partial class AppLifecycleServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_lifecycle_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLifecycleServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2FwcF9saWZlY3ljbGVfc2VydmljZS5wcm90bxIHaW50ZXJv\",\n            \"cBoXaW50ZXJvcC91bmlxdWVfaWQucHJvdG8aHWludGVyb3AvYXBwX2xhdW5j\",\n            \"aF9tb2RlLnByb3RvGidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0\",\n            \"b3IucHJvdG8aI2ludGVyb3AvaW52b2NhdGlvbl9kZXNjcmlwdG9yLnByb3Rv\",\n            \"Ghtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aFWludGVyb3Avb3B0aW9u\",\n            \"cy5wcm90byJ0ChFSZXNvbHZlQXBwUmVxdWVzdBIOCgZhcHBfaWQYASABKAkS\",\n            \"MAoQYXBwX3Jlc29sdmVfbW9kZRgCIAEoDjIWLmludGVyb3AuQXBwTGF1bmNo\",\n            \"TW9kZTodktsEGWludGVyb3AuUmVzb2x2ZUFwcFJlcXVlc3QisAEKElJlc29s\",\n            \"dmVBcHBSZXNwb25zZRIqCg9hcHBfaW5zdGFuY2VfaWQYASABKAsyES5pbnRl\",\n            \"cm9wLlVuaXF1ZUlkEiwKEWFwcF9jb25uZWN0aW9uX2lkGAIgASgLMhEuaW50\",\n            \"ZXJvcC5VbmlxdWVJZBIgChhpc19uZXdfaW5zdGFuY2VfbGF1bmNoZWQYAyAB\",\n            \"KAg6HpLbBBppbnRlcm9wLlJlc29sdmVBcHBSZXNwb25zZSLWAQoRQXBwTGlm\",\n            \"ZWN5Y2xlRXZlbnQSLwoJY29ubmVjdGVkGAEgASgLMhouaW50ZXJvcC5BcHBD\",\n            \"b25uZWN0ZWRFdmVudEgAEjUKDGRpc2Nvbm5lY3RlZBgCIAEoCzIdLmludGVy\",\n            \"b3AuQXBwRGlzY29ubmVjdGVkRXZlbnRIABIxCgVlcnJvchgDIAEoCzIgLmlu\",\n            \"dGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnRIADodktsEGWludGVyb3Au\",\n            \"QXBwTGlmZWN5Y2xlRXZlbnRCBwoFZXZlbnQitwEKD0ludm9jYXRpb25FdmVu\",\n            \"dBI9ChJpbnZvY2F0aW9uX3N0YXJ0ZWQYASABKAsyHy5pbnRlcm9wLkludm9j\",\n            \"YXRpb25TdGFydGVkRXZlbnRIABI/ChNpbnZvY2F0aW9uX2ZpbmlzaGVkGAIg\",\n            \"ASgLMiAuaW50ZXJvcC5JbnZvY2F0aW9uRmluaXNoZWRFdmVudEgAOhuS2wQX\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uRXZlbnRCBwoFZXZlbnQicwoRQXBwQ29ubmVj\",\n            \"dGVkRXZlbnQSPwoVY29ubmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50\",\n            \"ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcjodktsEGWludGVyb3AuQXBw\",\n            \"Q29ubmVjdGVkRXZlbnQieQoUQXBwRGlzY29ubmVjdGVkRXZlbnQSPwoVY29u\",\n            \"bmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0\",\n            \"aW9uRGVzY3JpcHRvcjogktsEHGludGVyb3AuQXBwRGlzY29ubmVjdGVkRXZl\",\n            \"bnQifwoXQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQSPwoVY29ubmVjdGlvbl9k\",\n            \"ZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3Jp\",\n            \"cHRvcjojktsEH2ludGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQiegoW\",\n            \"SW52b2NhdGlvblN0YXJ0ZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0\",\n            \"b3IYASABKAsyHS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yOiKS2wQe\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uU3RhcnRlZEV2ZW50IrwBChdJbnZvY2F0aW9u\",\n            \"RmluaXNoZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0b3IYASABKAsy\",\n            \"HS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yEikKBnJlc3VsdBgCIAEo\",\n            \"DjIZLmludGVyb3AuSW52b2NhdGlvblJlc3VsdBITCgtkdXJhdGlvbl9tcxgD\",\n            \"IAEoAzojktsEH2ludGVyb3AuSW52b2NhdGlvbkZpbmlzaGVkRXZlbnQiqAEK\",\n            \"FUdldENvbm5lY3Rpb25zUmVxdWVzdBIWCg5hcHBsaWNhdGlvbl9pZBgBIAEo\",\n            \"CRIqCg9hcHBfaW5zdGFuY2VfaWQYAiABKAsyES5pbnRlcm9wLlVuaXF1ZUlk\",\n            \"EigKDWNvbm5lY3Rpb25faWQYAyABKAsyES5pbnRlcm9wLlVuaXF1ZUlkOiGS\",\n            \"2wQdaW50ZXJvcC5HZXRDb25uZWN0aW9uc1JlcXVlc3QicwoWR2V0Q29ubmVj\",\n            \"dGlvbnNSZXNwb25zZRI1Cgtjb25uZWN0aW9ucxgBIAMoCzIgLmludGVyb3Au\",\n            \"QXBwQ29ubmVjdGlvbkRlc2NyaXB0b3I6IpLbBB5pbnRlcm9wLkdldENvbm5l\",\n            \"Y3Rpb25zUmVzcG9uc2Ui8QEKE0dldENvbm5lY3Rpb25zRXZlbnQSNQoLY29u\",\n            \"bmVjdGlvbnMYASADKAsyIC5pbnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlw\",\n            \"dG9yEjoKDm5ld19jb25uZWN0aW9uGAIgASgLMiAuaW50ZXJvcC5BcHBDb25u\",\n            \"ZWN0aW9uRGVzY3JpcHRvckgAEj0KEWNsb3NlZF9jb25uZWN0aW9uGAMgASgL\",\n            \"MiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvckgAOh+S2wQbaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50QgcKBWV2ZW50KjsKEEludm9jYXRp\",\n            \"b25SZXN1bHQSDQoJU3VjY2VlZGVkEAASDAoIQ2FuY2VsZWQQARIKCgZGYWls\",\n            \"ZWQQAjLJAwoTQXBwTGlmZWN5Y2xlU2VydmljZRJFCgpSZXNvbHZlQXBwEhou\",\n            \"aW50ZXJvcC5SZXNvbHZlQXBwUmVxdWVzdBobLmludGVyb3AuUmVzb2x2ZUFw\",\n            \"cFJlc3BvbnNlEk8KF0dldExpZmVjeWNsZUV2ZW50U3RyZWFtEhYuZ29vZ2xl\",\n            \"LnByb3RvYnVmLkVtcHR5GhouaW50ZXJvcC5BcHBMaWZlY3ljbGVFdmVudDAB\",\n            \"Ek4KGEdldEludm9jYXRpb25FdmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1\",\n            \"Zi5FbXB0eRoYLmludGVyb3AuSW52b2NhdGlvbkV2ZW50MAESUQoOR2V0Q29u\",\n            \"bmVjdGlvbnMSHi5pbnRlcm9wLkdldENvbm5lY3Rpb25zUmVxdWVzdBofLmlu\",\n            \"dGVyb3AuR2V0Q29ubmVjdGlvbnNSZXNwb25zZRJWChRHZXRDb25uZWN0aW9u\",\n            \"c1N0cmVhbRIeLmludGVyb3AuR2V0Q29ubmVjdGlvbnNSZXF1ZXN0GhwuaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50MAEaH5LbBBtpbnRlcm9wLkFwcExp\",\n            \"ZmVjeWNsZVNlcnZpY2VCIaoCHlBsZXh1cy5Ib3N0LkludGVybmFsLkdlbmVy\",\n            \"YXRlZGIGcHJvdG8z\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Host.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Host.Internal.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Host.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Host.Internal.Generated.InvocationDescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Host.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Host.Internal.Generated.InvocationResult), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.ResolveAppRequest), global::Plexus.Host.Internal.Generated.ResolveAppRequest.Parser, new[]{ \"AppId\", \"AppResolveMode\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.ResolveAppResponse), global::Plexus.Host.Internal.Generated.ResolveAppResponse.Parser, new[]{ \"AppInstanceId\", \"AppConnectionId\", \"IsNewInstanceLaunched\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.AppLifecycleEvent), global::Plexus.Host.Internal.Generated.AppLifecycleEvent.Parser, new[]{ \"Connected\", \"Disconnected\", \"Error\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.InvocationEvent), global::Plexus.Host.Internal.Generated.InvocationEvent.Parser, new[]{ \"InvocationStarted\", \"InvocationFinished\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.AppConnectedEvent), global::Plexus.Host.Internal.Generated.AppConnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.AppDisconnectedEvent), global::Plexus.Host.Internal.Generated.AppDisconnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent), global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.InvocationStartedEvent), global::Plexus.Host.Internal.Generated.InvocationStartedEvent.Parser, new[]{ \"InvocationDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.InvocationFinishedEvent), global::Plexus.Host.Internal.Generated.InvocationFinishedEvent.Parser, new[]{ \"InvocationDescriptor\", \"Result\", \"DurationMs\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.GetConnectionsRequest), global::Plexus.Host.Internal.Generated.GetConnectionsRequest.Parser, new[]{ \"ApplicationId\", \"AppInstanceId\", \"ConnectionId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.GetConnectionsResponse), global::Plexus.Host.Internal.Generated.GetConnectionsResponse.Parser, new[]{ \"Connections\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.GetConnectionsEvent), global::Plexus.Host.Internal.Generated.GetConnectionsEvent.Parser, new[]{ \"Connections\", \"NewConnection\", \"ClosedConnection\" }, new[]{ \"Event\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum InvocationResult {\n    [pbr::OriginalName(\"Succeeded\")] Succeeded = 0,\n    [pbr::OriginalName(\"Canceled\")] Canceled = 1,\n    [pbr::OriginalName(\"Failed\")] Failed = 2,\n  }\n\n  #endregion\n\n  #region Messages\n  internal sealed partial class ResolveAppRequest : pb::IMessage<ResolveAppRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppRequest> _parser = new pb::MessageParser<ResolveAppRequest>(() => new ResolveAppRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest(ResolveAppRequest other) : this() {\n      appId_ = other.appId_;\n      appResolveMode_ = other.appResolveMode_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest Clone() {\n      return new ResolveAppRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_resolve_mode\" field.</summary>\n    public const int AppResolveModeFieldNumber = 2;\n    private global::Plexus.Host.Internal.Generated.AppLaunchMode appResolveMode_ = global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppLaunchMode AppResolveMode {\n      get { return appResolveMode_; }\n      set {\n        appResolveMode_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (AppResolveMode != other.AppResolveMode) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (AppResolveMode != global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance) hash ^= AppResolveMode.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.AppResolveMode != global::Plexus.Host.Internal.Generated.AppLaunchMode.SingleInstance) {\n        AppResolveMode = other.AppResolveMode;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Host.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Host.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ResolveAppResponse : pb::IMessage<ResolveAppResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppResponse> _parser = new pb::MessageParser<ResolveAppResponse>(() => new ResolveAppResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse(ResolveAppResponse other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appConnectionId_ = other.appConnectionId_ != null ? other.appConnectionId_.Clone() : null;\n      isNewInstanceLaunched_ = other.isNewInstanceLaunched_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse Clone() {\n      return new ResolveAppResponse(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_connection_id\" field.</summary>\n    public const int AppConnectionIdFieldNumber = 2;\n    private global::Plexus.Host.Internal.Generated.UniqueId appConnectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId AppConnectionId {\n      get { return appConnectionId_; }\n      set {\n        appConnectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"is_new_instance_launched\" field.</summary>\n    public const int IsNewInstanceLaunchedFieldNumber = 3;\n    private bool isNewInstanceLaunched_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool IsNewInstanceLaunched {\n      get { return isNewInstanceLaunched_; }\n      set {\n        isNewInstanceLaunched_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(AppConnectionId, other.AppConnectionId)) return false;\n      if (IsNewInstanceLaunched != other.IsNewInstanceLaunched) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (appConnectionId_ != null) hash ^= AppConnectionId.GetHashCode();\n      if (IsNewInstanceLaunched != false) hash ^= IsNewInstanceLaunched.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        size += 1 + 1;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.appConnectionId_ != null) {\n        if (appConnectionId_ == null) {\n          AppConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        AppConnectionId.MergeFrom(other.AppConnectionId);\n      }\n      if (other.IsNewInstanceLaunched != false) {\n        IsNewInstanceLaunched = other.IsNewInstanceLaunched;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppLifecycleEvent : pb::IMessage<AppLifecycleEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLifecycleEvent> _parser = new pb::MessageParser<AppLifecycleEvent>(() => new AppLifecycleEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLifecycleEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent(AppLifecycleEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          Connected = other.Connected.Clone();\n          break;\n        case EventOneofCase.Disconnected:\n          Disconnected = other.Disconnected.Clone();\n          break;\n        case EventOneofCase.Error:\n          Error = other.Error.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent Clone() {\n      return new AppLifecycleEvent(this);\n    }\n\n    /// <summary>Field number for the \"connected\" field.</summary>\n    public const int ConnectedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectedEvent Connected {\n      get { return eventCase_ == EventOneofCase.Connected ? (global::Plexus.Host.Internal.Generated.AppConnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Connected;\n      }\n    }\n\n    /// <summary>Field number for the \"disconnected\" field.</summary>\n    public const int DisconnectedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppDisconnectedEvent Disconnected {\n      get { return eventCase_ == EventOneofCase.Disconnected ? (global::Plexus.Host.Internal.Generated.AppDisconnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Disconnected;\n      }\n    }\n\n    /// <summary>Field number for the \"error\" field.</summary>\n    public const int ErrorFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent Error {\n      get { return eventCase_ == EventOneofCase.Error ? (global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Error;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      Connected = 1,\n      Disconnected = 2,\n      Error = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLifecycleEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLifecycleEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Connected, other.Connected)) return false;\n      if (!object.Equals(Disconnected, other.Disconnected)) return false;\n      if (!object.Equals(Error, other.Error)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.Connected) hash ^= Connected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Disconnected) hash ^= Disconnected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Error) hash ^= Error.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.Connected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Error);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLifecycleEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          if (Connected == null) {\n            Connected = new global::Plexus.Host.Internal.Generated.AppConnectedEvent();\n          }\n          Connected.MergeFrom(other.Connected);\n          break;\n        case EventOneofCase.Disconnected:\n          if (Disconnected == null) {\n            Disconnected = new global::Plexus.Host.Internal.Generated.AppDisconnectedEvent();\n          }\n          Disconnected.MergeFrom(other.Disconnected);\n          break;\n        case EventOneofCase.Error:\n          if (Error == null) {\n            Error = new global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent();\n          }\n          Error.MergeFrom(other.Error);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Host.Internal.Generated.AppConnectedEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Host.Internal.Generated.AppConnectedEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationEvent : pb::IMessage<InvocationEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationEvent> _parser = new pb::MessageParser<InvocationEvent>(() => new InvocationEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent(InvocationEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          InvocationStarted = other.InvocationStarted.Clone();\n          break;\n        case EventOneofCase.InvocationFinished:\n          InvocationFinished = other.InvocationFinished.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent Clone() {\n      return new InvocationEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_started\" field.</summary>\n    public const int InvocationStartedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.InvocationStartedEvent InvocationStarted {\n      get { return eventCase_ == EventOneofCase.InvocationStarted ? (global::Plexus.Host.Internal.Generated.InvocationStartedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationStarted;\n      }\n    }\n\n    /// <summary>Field number for the \"invocation_finished\" field.</summary>\n    public const int InvocationFinishedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.InvocationFinishedEvent InvocationFinished {\n      get { return eventCase_ == EventOneofCase.InvocationFinished ? (global::Plexus.Host.Internal.Generated.InvocationFinishedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationFinished;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      InvocationStarted = 1,\n      InvocationFinished = 2,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationStarted, other.InvocationStarted)) return false;\n      if (!object.Equals(InvocationFinished, other.InvocationFinished)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.InvocationStarted) hash ^= InvocationStarted.GetHashCode();\n      if (eventCase_ == EventOneofCase.InvocationFinished) hash ^= InvocationFinished.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          if (InvocationStarted == null) {\n            InvocationStarted = new global::Plexus.Host.Internal.Generated.InvocationStartedEvent();\n          }\n          InvocationStarted.MergeFrom(other.InvocationStarted);\n          break;\n        case EventOneofCase.InvocationFinished:\n          if (InvocationFinished == null) {\n            InvocationFinished = new global::Plexus.Host.Internal.Generated.InvocationFinishedEvent();\n          }\n          InvocationFinished.MergeFrom(other.InvocationFinished);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Host.Internal.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Host.Internal.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Host.Internal.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Host.Internal.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Host.Internal.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Host.Internal.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppConnectedEvent : pb::IMessage<AppConnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectedEvent> _parser = new pb::MessageParser<AppConnectedEvent>(() => new AppConnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent(AppConnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent Clone() {\n      return new AppConnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppDisconnectedEvent : pb::IMessage<AppDisconnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppDisconnectedEvent> _parser = new pb::MessageParser<AppDisconnectedEvent>(() => new AppDisconnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppDisconnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent(AppDisconnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent Clone() {\n      return new AppDisconnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppDisconnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppDisconnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppDisconnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppConnectionErrorEvent : pb::IMessage<AppConnectionErrorEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionErrorEvent> _parser = new pb::MessageParser<AppConnectionErrorEvent>(() => new AppConnectionErrorEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionErrorEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent(AppConnectionErrorEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent Clone() {\n      return new AppConnectionErrorEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionErrorEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionErrorEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionErrorEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationStartedEvent : pb::IMessage<InvocationStartedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationStartedEvent> _parser = new pb::MessageParser<InvocationStartedEvent>(() => new InvocationStartedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationStartedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent(InvocationStartedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent Clone() {\n      return new InvocationStartedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationStartedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationStartedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationStartedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationFinishedEvent : pb::IMessage<InvocationFinishedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationFinishedEvent> _parser = new pb::MessageParser<InvocationFinishedEvent>(() => new InvocationFinishedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationFinishedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent(InvocationFinishedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      result_ = other.result_;\n      durationMs_ = other.durationMs_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent Clone() {\n      return new InvocationFinishedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Host.Internal.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"result\" field.</summary>\n    public const int ResultFieldNumber = 2;\n    private global::Plexus.Host.Internal.Generated.InvocationResult result_ = global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.InvocationResult Result {\n      get { return result_; }\n      set {\n        result_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"duration_ms\" field.</summary>\n    public const int DurationMsFieldNumber = 3;\n    private long durationMs_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public long DurationMs {\n      get { return durationMs_; }\n      set {\n        durationMs_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationFinishedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationFinishedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      if (Result != other.Result) return false;\n      if (DurationMs != other.DurationMs) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (Result != global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded) hash ^= Result.GetHashCode();\n      if (DurationMs != 0L) hash ^= DurationMs.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result);\n      }\n      if (DurationMs != 0L) {\n        size += 1 + pb::CodedOutputStream.ComputeInt64Size(DurationMs);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationFinishedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      if (other.Result != global::Plexus.Host.Internal.Generated.InvocationResult.Succeeded) {\n        Result = other.Result;\n      }\n      if (other.DurationMs != 0L) {\n        DurationMs = other.DurationMs;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Host.Internal.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Host.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Host.Internal.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsRequest : pb::IMessage<GetConnectionsRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsRequest> _parser = new pb::MessageParser<GetConnectionsRequest>(() => new GetConnectionsRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest(GetConnectionsRequest other) : this() {\n      applicationId_ = other.applicationId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest Clone() {\n      return new GetConnectionsRequest(this);\n    }\n\n    /// <summary>Field number for the \"application_id\" field.</summary>\n    public const int ApplicationIdFieldNumber = 1;\n    private string applicationId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ApplicationId {\n      get { return applicationId_; }\n      set {\n        applicationId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Host.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 3;\n    private global::Plexus.Host.Internal.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ApplicationId != other.ApplicationId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ApplicationId.Length != 0) hash ^= ApplicationId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ApplicationId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ApplicationId.Length != 0) {\n        ApplicationId = other.ApplicationId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Host.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsResponse : pb::IMessage<GetConnectionsResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsResponse> _parser = new pb::MessageParser<GetConnectionsResponse>(() => new GetConnectionsResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse(GetConnectionsResponse other) : this() {\n      connections_ = other.connections_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse Clone() {\n      return new GetConnectionsResponse(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Host.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsResponse other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsEvent : pb::IMessage<GetConnectionsEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsEvent> _parser = new pb::MessageParser<GetConnectionsEvent>(() => new GetConnectionsEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[11]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent(GetConnectionsEvent other) : this() {\n      connections_ = other.connections_.Clone();\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          NewConnection = other.NewConnection.Clone();\n          break;\n        case EventOneofCase.ClosedConnection:\n          ClosedConnection = other.ClosedConnection.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent Clone() {\n      return new GetConnectionsEvent(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Host.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Host.Internal.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    /// <summary>Field number for the \"new_connection\" field.</summary>\n    public const int NewConnectionFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor NewConnection {\n      get { return eventCase_ == EventOneofCase.NewConnection ? (global::Plexus.Host.Internal.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.NewConnection;\n      }\n    }\n\n    /// <summary>Field number for the \"closed_connection\" field.</summary>\n    public const int ClosedConnectionFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor ClosedConnection {\n      get { return eventCase_ == EventOneofCase.ClosedConnection ? (global::Plexus.Host.Internal.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.ClosedConnection;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      NewConnection = 2,\n      ClosedConnection = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      if (!object.Equals(NewConnection, other.NewConnection)) return false;\n      if (!object.Equals(ClosedConnection, other.ClosedConnection)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (eventCase_ == EventOneofCase.NewConnection) hash ^= NewConnection.GetHashCode();\n      if (eventCase_ == EventOneofCase.ClosedConnection) hash ^= ClosedConnection.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsEvent other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          if (NewConnection == null) {\n            NewConnection = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n          }\n          NewConnection.MergeFrom(other.NewConnection);\n          break;\n        case EventOneofCase.ClosedConnection:\n          if (ClosedConnection == null) {\n            ClosedConnection = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n          }\n          ClosedConnection.MergeFrom(other.ClosedConnection);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Host.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Host.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Host.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/AppLifecycleService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Host.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class AppLifecycleService {\n\t\t\n\t\tpublic const string Id = \"interop.AppLifecycleService\";\t\t\t\n\t\tpublic const string ResolveAppMethodId = \"ResolveApp\";\n\t\tpublic const string GetLifecycleEventStreamMethodId = \"GetLifecycleEventStream\";\n\t\tpublic const string GetInvocationEventStreamMethodId = \"GetInvocationEventStream\";\n\t\tpublic const string GetConnectionsMethodId = \"GetConnections\";\n\t\tpublic const string GetConnectionsStreamMethodId = \"GetConnectionsStream\";\n\t\t\n\t\tpublic static readonly AppLifecycleService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppLifecycleService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppLifecycleService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IResolveAppProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Host.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Host.Internal.Generated.ResolveAppRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Host.Internal.Generated.AppLifecycleEvent> GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Host.Internal.Generated.InvocationEvent> GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Host.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Host.Internal.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Host.Internal.Generated.GetConnectionsEvent> GetConnectionsStream(global::Plexus.Host.Internal.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IResolveAppImpl {\n\t\t\tTask<global::Plexus.Host.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Host.Internal.Generated.ResolveAppRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamImpl {\n\t\t\tTask GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Host.Internal.Generated.AppLifecycleEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamImpl {\n\t\t\tTask GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Host.Internal.Generated.InvocationEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsImpl {\n\t\t\tTask<global::Plexus.Host.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Host.Internal.Generated.GetConnectionsRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamImpl {\n\t\t\tTask GetConnectionsStream(global::Plexus.Host.Internal.Generated.GetConnectionsRequest request, IWritableChannel<global::Plexus.Host.Internal.Generated.GetConnectionsEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Host.Internal.Generated.ResolveAppRequest, global::Plexus.Host.Internal.Generated.ResolveAppResponse> ResolveAppMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.AppLifecycleEvent> GetLifecycleEventStreamMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.InvocationEvent> GetInvocationEventStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsResponse> GetConnectionsMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsEvent> GetConnectionsStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Host.Internal.Generated.ResolveAppRequest, global::Plexus.Host.Internal.Generated.ResolveAppResponse>(Id, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.AppLifecycleEvent>(Id, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.InvocationEvent>(Id, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsResponse>(Id, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsEvent>(Id, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Host.Internal.Generated.ResolveAppRequest, global::Plexus.Host.Internal.Generated.ResolveAppResponse>(Id, alias, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.AppLifecycleEvent>(Id, alias, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Host.Internal.Generated.InvocationEvent>(Id, alias, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsResponse>(Id, alias, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Host.Internal.Generated.GetConnectionsRequest, global::Plexus.Host.Internal.Generated.GetConnectionsEvent>(Id, alias, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/CommandLineTool.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\command_line_tool.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Host.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tinternal partial interface ICommandLineToolClient: IClient {\n\t\tCommandLineToolClient.IAppLifecycleServiceProxy AppLifecycleService { get; }\n\t}\n\t\n\tinternal sealed partial class CommandLineToolClient: ClientBase, ICommandLineToolClient {\n\t\t\n\t\tpublic const string Id = \"interop.CommandLineTool\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t}\n\t\t\n\t\tpublic CommandLineToolClient(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t{ \n\t\t\tAppLifecycleService = new CommandLineToolClient.AppLifecycleServiceProxy(this.CallInvoker);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLifecycleServiceProxy:\n\t\t\tglobal::Plexus.Host.Internal.Generated.AppLifecycleService.IResolveAppProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class AppLifecycleServiceProxy: IAppLifecycleServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Host.Internal.Generated.AppLifecycleService.Descriptor Descriptor = global::Plexus.Host.Internal.Generated.AppLifecycleService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic AppLifecycleServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Host.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Host.Internal.Generated.ResolveAppRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ResolveAppMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IAppLifecycleServiceProxy AppLifecycleService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/InvocationDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/invocation_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/invocation_descriptor.proto</summary>\n  internal static partial class InvocationDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/invocation_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static InvocationDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2ludm9jYXRpb25fZGVzY3JpcHRvci5wcm90bxIHaW50ZXJv\",\n            \"cBonaW50ZXJvcC9hcHBfY29ubmVjdGlvbl9kZXNjcmlwdG9yLnByb3RvGhVp\",\n            \"bnRlcm9wL29wdGlvbnMucHJvdG8i3QEKFEludm9jYXRpb25EZXNjcmlwdG9y\",\n            \"EhIKCnNlcnZpY2VfaWQYASABKAkSGAoQc2VydmljZV9hbGlhc19pZBgCIAEo\",\n            \"CRIRCgltZXRob2RfaWQYAyABKAkSMAoGc291cmNlGAQgASgLMiAuaW50ZXJv\",\n            \"cC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvchIwCgZ0YXJnZXQYBSABKAsyIC5p\",\n            \"bnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlwdG9yOiCS2wQcaW50ZXJvcC5J\",\n            \"bnZvY2F0aW9uRGVzY3JpcHRvckIhqgIeUGxleHVzLkhvc3QuSW50ZXJuYWwu\",\n            \"R2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Host.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Host.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.InvocationDescriptor), global::Plexus.Host.Internal.Generated.InvocationDescriptor.Parser, new[]{ \"ServiceId\", \"ServiceAliasId\", \"MethodId\", \"Source\", \"Target\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class InvocationDescriptor : pb::IMessage<InvocationDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationDescriptor> _parser = new pb::MessageParser<InvocationDescriptor>(() => new InvocationDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.InvocationDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor(InvocationDescriptor other) : this() {\n      serviceId_ = other.serviceId_;\n      serviceAliasId_ = other.serviceAliasId_;\n      methodId_ = other.methodId_;\n      source_ = other.source_ != null ? other.source_.Clone() : null;\n      target_ = other.target_ != null ? other.target_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor Clone() {\n      return new InvocationDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"service_alias_id\" field.</summary>\n    public const int ServiceAliasIdFieldNumber = 2;\n    private string serviceAliasId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceAliasId {\n      get { return serviceAliasId_; }\n      set {\n        serviceAliasId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"method_id\" field.</summary>\n    public const int MethodIdFieldNumber = 3;\n    private string methodId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string MethodId {\n      get { return methodId_; }\n      set {\n        methodId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"source\" field.</summary>\n    public const int SourceFieldNumber = 4;\n    private global::Plexus.Host.Internal.Generated.AppConnectionDescriptor source_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor Source {\n      get { return source_; }\n      set {\n        source_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"target\" field.</summary>\n    public const int TargetFieldNumber = 5;\n    private global::Plexus.Host.Internal.Generated.AppConnectionDescriptor target_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Host.Internal.Generated.AppConnectionDescriptor Target {\n      get { return target_; }\n      set {\n        target_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (ServiceAliasId != other.ServiceAliasId) return false;\n      if (MethodId != other.MethodId) return false;\n      if (!object.Equals(Source, other.Source)) return false;\n      if (!object.Equals(Target, other.Target)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (ServiceAliasId.Length != 0) hash ^= ServiceAliasId.GetHashCode();\n      if (MethodId.Length != 0) hash ^= MethodId.GetHashCode();\n      if (source_ != null) hash ^= Source.GetHashCode();\n      if (target_ != null) hash ^= Target.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodId);\n      }\n      if (source_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Source);\n      }\n      if (target_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.ServiceAliasId.Length != 0) {\n        ServiceAliasId = other.ServiceAliasId;\n      }\n      if (other.MethodId.Length != 0) {\n        MethodId = other.MethodId;\n      }\n      if (other.source_ != null) {\n        if (source_ == null) {\n          Source = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n        }\n        Source.MergeFrom(other.Source);\n      }\n      if (other.target_ != null) {\n        if (target_ == null) {\n          Target = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n        }\n        Target.MergeFrom(other.Target);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Host.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  internal static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIhqgIeUGxleHVzLkhvc3QuSW50ZXJuYWwuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { OptionsExtensions.MessageId, OptionsExtensions.ServiceId, OptionsExtensions.MethodId }, null));\n    }\n    #endregion\n\n  }\n  /// <summary>Holder for extension identifiers generated from the top level of interop/options.proto</summary>\n  internal static partial class OptionsExtensions {\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string> MessageId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string> ServiceId =\n      new pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string> MethodId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n  }\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/Generated/interop/UniqueId.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/unique_id.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Host.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/unique_id.proto</summary>\n  internal static partial class UniqueIdReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/unique_id.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static UniqueIdReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChdpbnRlcm9wL3VuaXF1ZV9pZC5wcm90bxIHaW50ZXJvcBoVaW50ZXJvcC9v\",\n            \"cHRpb25zLnByb3RvIjgKCFVuaXF1ZUlkEgoKAmxvGAEgASgGEgoKAmhpGAIg\",\n            \"ASgGOhSS2wQQaW50ZXJvcC5VbmlxdWVJZEIhqgIeUGxleHVzLkhvc3QuSW50\",\n            \"ZXJuYWwuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Host.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Host.Internal.Generated.UniqueId), global::Plexus.Host.Internal.Generated.UniqueId.Parser, new[]{ \"Lo\", \"Hi\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  /// <summary>\n  /// Stores UUID in little-endian format (i.e. reversed).\n  /// To convert to bytes on little-endian systems (most common case): concat (toBytes(hi), toBytes(lo))\n  /// To convert to bytes on big-endian systems need to additionally reverse \"hi\" and \"lo\" parts: concat( reverse(toBytes(hi)), reverse(toBytes(lo)) )\n  /// </summary>\n  internal sealed partial class UniqueId : pb::IMessage<UniqueId>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<UniqueId> _parser = new pb::MessageParser<UniqueId>(() => new UniqueId());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<UniqueId> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Host.Internal.Generated.UniqueIdReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId(UniqueId other) : this() {\n      lo_ = other.lo_;\n      hi_ = other.hi_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId Clone() {\n      return new UniqueId(this);\n    }\n\n    /// <summary>Field number for the \"lo\" field.</summary>\n    public const int LoFieldNumber = 1;\n    private ulong lo_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Lo {\n      get { return lo_; }\n      set {\n        lo_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"hi\" field.</summary>\n    public const int HiFieldNumber = 2;\n    private ulong hi_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Hi {\n      get { return hi_; }\n      set {\n        hi_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as UniqueId);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(UniqueId other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Lo != other.Lo) return false;\n      if (Hi != other.Hi) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Lo != 0UL) hash ^= Lo.GetHashCode();\n      if (Hi != 0UL) hash ^= Hi.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Lo != 0UL) {\n        size += 1 + 8;\n      }\n      if (Hi != 0UL) {\n        size += 1 + 8;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(UniqueId other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Lo != 0UL) {\n        Lo = other.Lo;\n      }\n      if (other.Hi != 0UL) {\n        Hi = other.Hi;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/IProgram.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Host.Internal\n{\n    using System.Threading.Tasks;\n\n    internal interface IProgram\n    {\n        string Name { get; }\n        \n        string InstanceKey { get; }\n\n        InstanceAwareness InstanceAwareness { get; }\n\n        Task<Task> StartAsync();\n\n        Task ShutdownAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/InstanceAwareness.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    internal enum InstanceAwareness\n    {\n        MultiInstance,\n        SingleInstancePerDirectory,\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/InteropCliProgram.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Host.Internal\n{\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Plexus.Host.Internal.Generated;\n    using Plexus.Interop;\n    using UniqueId = Plexus.UniqueId;\n\n    internal sealed class InteropCliProgram : IProgram\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<InteropCliProgram>();\n\n        private readonly ICommandLineToolClient _client = new CommandLineToolClient(s => s.WithBrokerWorkingDir(Directory.GetCurrentDirectory()));\n\n        private readonly string[] _ids;\n\n        public InteropCliProgram(IEnumerable<string> ids)\n        {\n            _ids = ids.ToArray();\n        }\n\n        public string Name { get; } = \"Interop CLI\";\n\n        public string InstanceKey { get; } = \"interop-cli\";\n\n        public InstanceAwareness InstanceAwareness { get; } = InstanceAwareness.MultiInstance;\n\n        public async Task<Task> StartAsync()\n        {\n            if (_ids.Length == 0)\n            {\n                return TaskConstants.Completed;\n            }\n            await _client.ConnectAsync().ConfigureAwait(false);\n            return ProcessAsync();\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await Task.WhenAll(_ids.Select(LaunchAppAsync)).ConfigureAwait(false);\n            }\n            finally\n            {\n                await _client.DisconnectAsync().ConfigureAwait(false);\n            }\n        }\n\n        private async Task LaunchAppAsync(string appId)\n        {\n            try\n            {\n                Log.Info(\"Launching app {0}\", appId);\n                var request = new ResolveAppRequest\n                {\n                    AppId = appId,\n                    AppResolveMode = AppLaunchMode.MultiInstance\n                };\n                var response = await _client.AppLifecycleService.ResolveApp(request).ConfigureAwait(false);\n                var connectionId = UniqueId.FromHiLo(response.AppConnectionId.Hi, response.AppConnectionId.Lo);\n                var appInstanceId = UniqueId.FromHiLo(response.AppInstanceId.Hi, response.AppInstanceId.Lo);\n                Log.Info(\"Launched app {0}: connectionId={1}, appInstanceId={2}\", appId, connectionId, appInstanceId);\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Failed to launch app {0}\", appId);\n            }\n        }\n\n        public Task ShutdownAsync()\n        {\n            return _client.DisconnectAsync();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/LaunchCliOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using System.Collections.Generic;\n    using CommandLine;\n\n#if !NET45\n    [Verb(\"launch\", HelpText = \"Launch interop application.\")]\n#endif\n    internal sealed class LaunchCliOptions\n    {\n#if !NET45\n        [Option('a', \"application\", Required = true, HelpText = \"Identifier of application.\", Separator = ',')]\n#else\n        [OptionList('a', \"application\", Required = true, HelpText = \"Identifier of application.\", Separator = ',')]\n#endif\n        public IEnumerable<string> ApplicationIds { get; set; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/LockFile.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Text;\n    using System.Threading;\n\n    internal sealed class LockFile : IDisposable\n    {\n        private readonly string _lockFileContent;\n        private FileStream _fileStream;\n\n        public LockFile(string lockFileName, string lockFileContent)\n        {\n            Name = lockFileName;\n            _lockFileContent = lockFileContent;\n        }\n\n        public string Name { get; }\n\n        public bool TryEnter(int timeoutMs)\n        {\n            var stopwatch = new Stopwatch();\n            stopwatch.Start();\n            do\n            {\n                try\n                {\n                    _fileStream = new FileStream(Name, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);\n                    var bytes = Encoding.UTF8.GetBytes(_lockFileContent);\n                    _fileStream.Write(bytes, 0, bytes.Length);\n                    _fileStream.Flush(true);\n                }\n                catch\n                {\n                    Thread.Sleep(50);\n                }\n            } while (_fileStream == null && stopwatch.ElapsedMilliseconds < timeoutMs);\n            stopwatch.Stop();\n            return _fileStream != null;\n        }\n\n        public void Release()\n        {\n            if (_fileStream == null)\n            {\n                return;\n            }\n            _fileStream.Dispose();\n            try\n            {\n                if (File.Exists(Name))\n                {\n                    File.Delete(Name);\n                }\n            }\n            catch\n            {\n                // ignore\n            }\n        }\n\n        public void Dispose()\n        {\n            Release();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/ProgramLoader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Logging.NLog;\n\n    internal sealed class ProgramLoader : IDisposable\n    {\n        private static readonly TimeSpan ShutdownTimeout = TimeoutConstants.Timeout5Sec;\n\n        private readonly LoggingInitializer _loggingInitializer;\n        private readonly ILogger _log;\n        private readonly IProgram _program;\n        private int _isShuttingDown;\n\n        public ProgramLoader(IProgram program)\n        {\n            _program = program;\n            _loggingInitializer = new LoggingInitializer();\n            _log = LogManager.GetLogger<ProgramLoader>();\n        }\n\n        public async Task<int> LoadAndRunAsync()\n        {\n            LockFile lockFile = null;\n            try\n            {\n                _log.Info(\"Starting {0}\", _program.Name);\n\n                if (_program.InstanceAwareness == InstanceAwareness.SingleInstancePerDirectory)\n                {\n                    var workingDir = Directory.GetCurrentDirectory();\n                    _log.Info($\"Checking if another instance of {_program.Name} is already running in directory {workingDir}\");\n                    var lockFileName = _program.InstanceKey + \"-lock\";\n                    lockFile = new LockFile(lockFileName, Process.GetCurrentProcess().Id.ToString());\n                    _log.Info(\"Trying to acquire lock file {0}\", lockFile.Name);\n                    var isFirstInstance = lockFile.TryEnter(500);\n                    if (!isFirstInstance)\n                    {\n                        _log.Info($\"Another instance of {_program.InstanceKey} is already running in directory {workingDir}. Exiting.\");\n                        return 1;\n                    }\n                }\n\n                var parentProcessVar = Environment.GetEnvironmentVariable(EnvironmentHelper.ParentProcessIdVarName);\n                if (!string.IsNullOrWhiteSpace(parentProcessVar) && int.TryParse(parentProcessVar, out var parentPid))\n                {\n                    var parentProcess = Process.GetProcessById(parentPid);\n                    AttachToParent(parentProcess);\n                }\n\n                RegisterShutdownEvent();\n\n                var task = await _program.StartAsync().ConfigureAwait(false);\n                _log.Info(\"{0} started\", _program.Name);\n                await task.ConfigureAwait(false);\n                _log.Info(\"{0} completed\", _program.Name);\n            }\n            catch (Exception ex)\n            {\n                _log.Error(ex, \"Unhandled exception while running {0}\", _program.Name);\n                return 1;\n            }\n            finally\n            {\n                if (lockFile != null)\n                {\n                    _log.Info(\"Releasing lock file {0}\", lockFile.Name);\n                    lockFile.Dispose();\n                }\n            }\n\n            _log.Info(\"{0} completed successfully\", _program.Name);\n            return 0;\n        }\n\n        private void RegisterShutdownEvent()\n        {\n            Console.CancelKeyPress += (x, y) =>\n            {\n                ShutdownAsync().IgnoreAwait(_log);\n                y.Cancel = true;\n            };\n\n            var shutdownEventName = \"plexus-host-shutdown-\" + Process.GetCurrentProcess().Id;\n            _log.Debug(\"Registering shutdown event: {0}\", shutdownEventName);\n            var shutdownEvent = new EventWaitHandle(false, EventResetMode.AutoReset, shutdownEventName);\n            ThreadPool.RegisterWaitForSingleObject(\n                shutdownEvent,\n                (state, timedOut) => ShutdownAsync().IgnoreAwait(_log),\n                null,\n                Timeout.Infinite,\n                true);\n        }\n\n        private void AttachToParent(Process parentProcess)\n        {\n            _log.Info(\"Attaching the current process to the parent process \\\"{0}\\\" ({1})\", parentProcess.ProcessName, parentProcess.Id);\n\n            void OnParentProcessExited()\n            {\n                _log.Warn(\"Exiting because the attached parent process \\\"{0}\\\" ({1}) exited with code {2}\", parentProcess.ProcessName, parentProcess.Id, parentProcess.ExitCode);\n                _loggingInitializer?.Dispose();\n                Environment.Exit(1);\n            }\n            parentProcess.EnableRaisingEvents = true;\n            parentProcess.Exited += (sender, args) =>\n            {\n                OnParentProcessExited();\n            };\n            if (parentProcess.HasExited)\n            {\n                OnParentProcessExited();\n            }\n        }\n\n        private async Task ShutdownAsync()\n        {\n            if (Interlocked.Exchange(ref _isShuttingDown, 1) == 1)\n            {\n                return;\n            }\n            if (_program == null)\n            {\n                _loggingInitializer?.Dispose();\n                Environment.Exit(0);\n            }\n            else\n            {\n                _log.Info(\"Shutting down\");\n\n                var task = TaskRunner.RunInBackground(_program.ShutdownAsync);\n\n                var completed = await Task.WhenAny(task, Task.Delay(ShutdownTimeout)).ConfigureAwait(false);\n                if (completed != task)\n                {\n                    _log.Error(\"Program {0} failed to shutdown gracefully withing the given timeout {1} sec\", _program.GetType(), ShutdownTimeout.TotalSeconds);\n                    _loggingInitializer?.Dispose();\n                    Environment.Exit(1);\n                }\n                if (task.IsFaulted)\n                {\n                    _log.Error(task.Exception.ExtractInner(), \"Exception while shutting down program {0}\", _program.GetType());\n                    _loggingInitializer?.Dispose();\n                    Environment.Exit(1);\n                }\n            }\n        }\n\n        public void Dispose()\n        {\n            _loggingInitializer?.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/StopCliOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using CommandLine;\n\n#if !NET45\n    [Verb(\"stop\", HelpText = \"Stop interop broker.\")]\n#endif\n    internal sealed class StopCliOptions\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/StudioCliOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Host.Internal\n{\n    using CommandLine;\n\n#if !NET45\n    [Verb(\"studio\", HelpText = \"Start Plexus Studio.\")]\n#endif\n    internal sealed class StudioCliOptions\n    {\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Host/Internal/VerbOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Host.Internal\n{\n    using CommandLine;\n    using CommandLine.Text;\n\n#if NET45\n    internal sealed class VerbOptions\n    {\n        [HelpVerbOption]\n        public string DoHelpForVerb(string verbName)\n        {\n            return HelpText.AutoBuild(this,\n                current => HelpText.DefaultParsingErrorsHandler(this, current),\n                true);\n        }\n\n        [VerbOption(\"start\", HelpText = \"Start interop broker.\")]\n        public StartCliOptions StartVerb { get; set; }\n\n        [VerbOption(\"broker\", HelpText = \"Start interop broker.\")]\n        public BrokerCliOptions BrokerVerb { get; set; }\n\n        [VerbOption(\"launch\", HelpText = \"Launch interop application.\")]\n        public LaunchCliOptions LaunchCliVerb { get; set; }\n \n        [VerbOption(\"stop\", HelpText = \"Stop interop broker.\")]\n        public StopCliOptions StopVerb { get; set; }\n\n        [VerbOption(\"studio\", HelpText = \"Start Plexus Studio.\")]\n        public StudioCliOptions StudioVerb { get; set; }\n    }\n#endif\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Plexus.Host.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup Condition=\" '$(CORE_ONLY)' == ''\">\n    <TargetFramework>net45</TargetFramework>\n    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\" '$(CORE_ONLY)' != ''\">\n    <TargetFramework>netcoreapp2.1</TargetFramework>\n    <RuntimeIdentifier>win-x64</RuntimeIdentifier>\n    <PlatformTarget>x64</PlatformTarget>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <AssemblyName>plexus</AssemblyName>\n\n    <RepoRootDir>../../../</RepoRootDir>\n    <ArtifactsDir>$(RepoRootDir)bin/$(TargetFramework)-$(PlatformTarget)/</ArtifactsDir>\n    <PublishDir>$(ArtifactsDir)broker/</PublishDir>\n\n    <IsPackable>true</IsPackable>\n    <NuspecFile>$(MSBuildThisFileDirectory)Plexus.Interop.Broker.Redist.nuspec</NuspecFile>\n  </PropertyGroup>\n\n  <ItemGroup Condition=\"'$(TargetFramework)' == 'netcoreapp2.1'\">\n    <PackageReference Include=\"CommandLineParser\" Version=\"2.4.3\" />\n    <PackageReference Include=\"System.Console\" Version=\"4.3.1\" />\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n    <PackageReference Include=\"System.IO.Pipes\" Version=\"4.3.0\" />\n    <PackageReference Include=\"System.Text.Encoding.CodePages\" Version=\"4.5.1\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\"'$(TargetFramework)' == 'net45'\">\n    <PackageReference Include=\"CommandLineParser\" Version=\"1.9.71\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Broker\\Plexus.Interop.Broker.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Samples.Metadata\\Plexus.Interop.Samples.Metadata.csproj\">\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n      <IncludeAssets>Build</IncludeAssets>\n    </ProjectReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Target Name=\"PublishAfterBuild\" AfterTargets=\"Build\" DependsOnTargets=\"Publish\" />\n\n  <Target Name=\"SetNuspecProperties\" BeforeTargets=\"GenerateNuspec\">\n    <PropertyGroup>\n      <NuspecProperties Condition=\"'$(TargetFramework)' == 'net45'\">$(NuspecProperties);id=Plexus.Interop.Broker.Redist</NuspecProperties>\n      <NuspecProperties Condition=\"'$(TargetFramework)' == 'netcoreapp2.1'\">$(NuspecProperties);id=Plexus.Interop.Broker.Redist-$(RuntimeIdentifier)</NuspecProperties>\n      <NuspecProperties>$(NuspecProperties);version=$(PackageVersion)</NuspecProperties>\n      <NuspecProperties>$(NuspecProperties);artifacts=$(TargetFramework)-$(PlatformTarget)</NuspecProperties>\n    </PropertyGroup>\n    <Message Importance=\"high\" Text=\"NuspecProperties: $(NuspecProperties)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Plexus.Interop.Broker.Redist.nuspec",
    "content": "<?xml version=\"1.0\"?>\n<package >\n  <metadata>\n    <id>$id$</id>\n    <version>$version$</version>\n    <title>$id$</title>\n    <authors>Plexus Interop Deutsche Bank AG</authors>\n    <licenseUrl>https://github.com/finos-plexus/plexus-interop/blob/master/LICENSE</licenseUrl>\n    <projectUrl>http://plexus.finos.org</projectUrl>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <description>Plexus Interop Broker Binaries</description>\n    <copyright>Copyright 2017</copyright>\n    <tags>plexus interop broker ipc rpc messaging interoperability</tags>\n  </metadata>\n  <files>\n    <file src=\"..\\..\\..\\bin\\$artifacts$\\broker\\\" target=\"\\redist\\$id$\" />\n    <file src=\"Plexus.Interop.Broker.Redist.targets\" target=\"\\build\\$id$.targets\" />\n  </files>\n</package>"
  },
  {
    "path": "desktop/src/Plexus.Host/Plexus.Interop.Broker.Redist.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n   <Target Name=\"CopyPlexusBrokerRedistToOutput\" Label=\"Default\" AfterTargets=\"AfterBuild\">\n     <ItemGroup>\n       <NativeLibs Include=\"$(MSBuildThisFileDirectory)..\\redist\\**\\*.*\" />\n     </ItemGroup>\n     <Copy SourceFiles=\"@(NativeLibs)\" DestinationFolder=\"$(TargetDir)%(RecursiveDir)\" SkipUnchangedFiles=\"true\" />\n  </Target>\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Host/Program.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Host\n{\n    using CommandLine;\n    using Plexus.Host.Internal;\n    using Plexus.Interop;\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Linq;\n    using System.Text;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public sealed class Program\n    {\n        private static readonly TimeSpan ShutdownTimeout = TimeoutConstants.Timeout5Sec;\n\n        public static int Main(string[] args)\n        {\n            InitializeProcess();\n            return new Program().RunAsync(args).GetResult();\n        }\n\n        public async Task<int> RunAsync(string[] args)\n        {\n#if NET45\n            var invokedVerb = string.Empty;\n            object invokedVerbInstance = null;\n\n            var options = new VerbOptions();\n            if (!Parser.Default.ParseArguments(args, options,\n                (verb, subOptions) =>\n                {\n                    invokedVerb = verb;\n                    invokedVerbInstance = subOptions;\n                }))\n            {\n                Console.WriteLine(\"There is no mandatory cmd argument. Exit immediately\");\n                return Parser.DefaultExitCodeFail;\n            }\n\n            switch (invokedVerb)\n            {\n                case \"start\":\n                    return await StartBrokerAsync((StartCliOptions)invokedVerbInstance).ConfigureAwait(false);\n                case \"broker\":\n                    return await StartBrokerAsync((BrokerCliOptions)invokedVerbInstance).ConfigureAwait(false);\n                case \"launch\":\n                    return await LaunchAppAsync((LaunchCliOptions)invokedVerbInstance).ConfigureAwait(false);\n                case \"stop\":\n                    return await StopBrokerAsync().ConfigureAwait(false);\n                case \"studio\":\n                    return await StartStudioAsync().ConfigureAwait(false);\n                default:\n                    Console.WriteLine(\"There is no mandatory cmd argument. Exit immediately\");\n                    return Parser.DefaultExitCodeFail;\n            }\n#else\n            return await Parser.Default\n                .ParseArguments<BrokerCliOptions, StartCliOptions, LaunchCliOptions, StopCliOptions, StudioCliOptions>(args)\n                .MapResult(\n                    (BrokerCliOptions opts) => StartBrokerAsync(opts),\n                    (StartCliOptions opts) => StartBrokerAsync(opts),\n                    (LaunchCliOptions opts) => LaunchAppAsync(opts),\n                    (StopCliOptions opts) => StopBrokerAsync(),\n                    (StudioCliOptions opts) => StartStudioAsync(),\n                    errs => Task.FromResult(1));\n#endif\n        }        \n\n        private static async Task<int> LoadAndRunProgramAsync(IProgram program)\n        {\n            using (var loader = new ProgramLoader(program))\n            {\n                return await loader.LoadAndRunAsync().ConfigureAwait(false);\n            }\n        }\n\n        private static async Task<int> LaunchAppAsync(LaunchCliOptions opts)\n        {\n            var program = new InteropCliProgram(opts.ApplicationIds);\n            return await LoadAndRunProgramAsync(program).ConfigureAwait(false);\n        }\n\n        private static async Task<int> StartBrokerAsync(StartCliOptions opts)\n        {\n            var brokerOptions = new BrokerOptions(opts.Metadata, opts.Port, opts.WssPort);\n            var program = new BrokerProgram(brokerOptions);\n            return await LoadAndRunProgramAsync(program).ConfigureAwait(false);\n        }\n\n        private static async Task<int> StopBrokerAsync()\n        {\n            const string lockFileName = \"plexus-interop-broker-lock\";\n            var pid = -1;\n            if (File.Exists(lockFileName))\n            {\n                using (var stream = new FileStream(lockFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n                using (var streamReader = new StreamReader(stream))\n                {\n                    if (!int.TryParse(streamReader.ReadToEnd(), out pid))\n                    {\n                        pid = -1;\n                    }\n                }\n            }\n\n            if (pid == -1)\n            {\n                Console.WriteLine(\"Plexus Broker is not running in current directory {0}\", Directory.GetCurrentDirectory());\n                return 0;\n            }\n\n            var processes = Process.GetProcesses().Where(x => x.Id == pid);\n\n            async Task ShutdownProcessAsync(Process process)\n            {\n                Console.WriteLine($\"Shutting down plexus process {process.Id}\");\n                process.EnableRaisingEvents = true;\n                var exitPromise = new Promise<int>();\n                process.Exited += (sender, eventArgs) => exitPromise.TryComplete(((Process) sender).ExitCode);\n                if (process.HasExited)\n                {\n                    exitPromise.TryComplete(process.ExitCode);\n                }\n                else\n                {\n                    var evtName = \"plexus-host-shutdown-\" + process.Id;\n                    var evt = new EventWaitHandle(false, EventResetMode.AutoReset, evtName);\n                    evt.Set();\n                    var completed = await Task.WhenAny(exitPromise.Task,\n                        Task.Delay(ShutdownTimeout));\n                    if (completed != exitPromise.Task)\n                    {\n                        Console.WriteLine($\"Killing plexus process {process.Id} which failed to shutdown gracefully in the given timeout {ShutdownTimeout.TotalSeconds} sec\");\n                        process.Kill();\n                    }\n                }\n                var exitCode = await exitPromise.Task.ConfigureAwait(false);\n                Console.WriteLine($\"Plexus process {process.Id} exited with code {exitCode}\");\n            }\n\n            var tasks = processes.Select(ShutdownProcessAsync);\n\n            await Task.WhenAll(tasks).IgnoreExceptions().ConfigureAwait(false);\n\n            return 0;\n        }\n\n        private static Task<int> StartStudioAsync()\n        {\n            var dir = Directory.GetCurrentDirectory();\n            var addressFile = Path.Combine(dir, \"servers\", \"ws-v1\", \"address\");\n            if (!File.Exists(addressFile))\n            {\n                throw new InvalidOperationException($\"Broker is not running in the current folder {dir}\");\n            }\n            var wsUri = new Uri(File.ReadAllText(addressFile));\n            var uriBuilder = new UriBuilder(wsUri)\n            {\n                Scheme = \"http\",\n                Path = \"studio/index.html\"\n            };\n            var uri = uriBuilder.Uri;\n            Console.WriteLine(\"Starting \" + uri);\n            Process.Start(new ProcessStartInfo(uri.ToString()) {UseShellExecute = true});\n            return Task.FromResult(0);\n        }\n\n        private static void InitializeProcess()\n        {\n#if !NET45\n            // by default, .NET Core doesn't have all code pages needed for Console apps.\n            // see the .NET Core Notes in https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx\n            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);\n#else\n            // For .NET 4.5 increasing min threads count\n            ThreadPool.GetMaxThreads(out var minWorkerThreads, out var minCompletionPortThreads);\n            ThreadPool.SetMinThreads(minWorkerThreads, minCompletionPortThreads);\n#endif\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Host/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Samples Broker\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\plexus.cmd\",\n      \"commandLineArgs\": \"broker\",\n      \"workingDirectory\": \"$(ArtifactsSamplesDir)\"\n    },\n    \"QuickStart Broker\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\plexus.cmd\",\n      \"commandLineArgs\": \"broker\",\n      \"workingDirectory\": \"$(QuickStartSamplesDir)\"\n    }\n  }\n}"
  },
  {
    "path": "desktop/src/Plexus.Host/nlog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"false\"\n      internalLogLevel=\"Warn\"\n      internalLogIncludeTimestamp=\"true\"\n      internalLogToConsole=\"true\"\n      internalLogToConsoleError=\"true\">\n\n  <extensions>\n    <add assembly=\"Plexus.Logging.NLog\"/>\n  </extensions>\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception:${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${when:when='${environment:PLEXUS_BROKER_LOG_DIR}'='':inner=${workDir}/logs/:else=${environment:PLEXUS_BROKER_LOG_DIR}}\"/>\n\n  <targets async=\"true\">\n    \n    <target xsi:type=\"File\"\n            name=\"FileTarget\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/plexus.log\"\n            keepFileOpen=\"false\"\n            archiveFileName=\"${logsDir}/plexus.{##}.log\"\n            archiveNumbering=\"Sequence\"\n            archiveAboveSize=\"2097152\"\n            maxArchiveFiles=\"5\"\n            />\n\n    <target xsi:type=\"File\"\n            name=\"BrokerFileTarget\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/plexus.broker.log\"\n            keepFileOpen=\"false\"\n            archiveFileName=\"${logsDir}/plexus.broker.{##}.log\"\n            archiveNumbering=\"Sequence\"\n            archiveAboveSize=\"2097152\"\n            maxArchiveFiles=\"5\"\n    />\n    \n    <target xsi:type=\"ColoredConsole\"\n            name=\"ColoredConsoleTarget\"\n            layout=\"${processtime} | ${message} ${onexception:${exception:format=type,message}}\"\n            useDefaultRowHighlightingRules=\"true\"\n            detectConsoleAvailable=\"true\"\n            />\n    \n  </targets>\n  <rules>\n    <logger name=\"*\" writeTo=\"ColoredConsoleTarget\" minlevel=\"Info\" />\n    <logger name=\"*\" writeTo=\"FileTarget\" minlevel=\"Debug\" />\n    <logger name=\"Plexus.Interop.Broker.*\" writeTo=\"BrokerFileTarget\" minlevel=\"Debug\" />\n    <logger name=\"Plexus.Interop.Apps.*\" writeTo=\"BrokerFileTarget\" minlevel=\"Debug\" />    \n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Generate.cmd",
    "content": "set INTEROP_METADATA_PATH=..\\..\\..\\dsl\\interop-lang\\src\\main\\resources\nset INTEROP_MANIFEST_PATH={app_lifecycle_manager.interop,native_app_launcher.interop}\nset CSHARP_NAMESPACE=internal_access:Plexus.Interop.Apps.Internal.Generated\nset CSHARP_OUT=Internal\\Generated\n\nplexus gen-csharp -b %INTEROP_METADATA_PATH% -i %INTEROP_MANIFEST_PATH% -o %CSHARP_OUT% -n %CSHARP_NAMESPACE% -v"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/IAppLaunchedEventConsumer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    using System;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    interface IAppLaunchedEventConsumer\n    {\n        IObserver<AppLaunchedEvent> AppLaunchedEventObserver { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n\n    internal sealed class AppConnection : IAppConnection\n    {\n        private readonly ILogger _log;\n        private readonly ITransportConnection _connection;\n\n        public AppConnection(ITransportConnection connection, AppConnectionDescriptor appInfo)\n        {\n            Id = connection.Id;\n            _log = LogManager.GetLogger<AppConnection>(Id.ToString());\n            Info = appInfo;\n            _connection = connection;\n            Completion = ProcessAsync();\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await IncomingChannels.Completion.ConfigureAwait(false);\n                _connection.TryComplete();\n            }\n            catch (Exception ex)\n            {\n                _connection.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                await _connection.Completion.ConfigureAwait(false);\n            }\n        }\n\n        public UniqueId Id { get; }\n\n        public AppConnectionDescriptor Info { get; }\n\n        public Task Completion { get; }\n\n        public IReadableChannel<ITransportChannel> IncomingChannels => _connection.IncomingChannels;\n\n        public async ValueTask<ITransportChannel> CreateChannelAsync()\n        {\n            return await _connection.CreateChannelAsync().ConfigureAwait(false);\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is AppConnection connection &&\n                   EqualityComparer<AppConnectionDescriptor>.Default.Equals(Info, connection.Info);\n        }\n\n        public override int GetHashCode()\n        {\n            return 1340155117 + EqualityComparer<AppConnectionDescriptor>.Default.GetHashCode(Info);\n        }\n\n        public override string ToString()\n        {\n            return Info.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class AppDto\n    {\n        private Dictionary<string, object> _launcherParams = new Dictionary<string, object>();\n\n        [DataMember(Name = \"id\", IsRequired = true)]\n        public string Id { get; set; }\n\n        [DataMember(Name = \"displayName\")]\n        public string DisplayName { get; set; }\n\n        [DataMember(Name = \"launcherId\")]\n        public string LauncherId { get; set; }\n\n        [DataMember(Name = \"launcherParams\")]\n        public Dictionary<string, object> LauncherParams\n        {\n            get => _launcherParams = _launcherParams ?? new Dictionary<string, object>();\n            set => _launcherParams = value ?? new Dictionary<string, object>();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppInfo.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.Collections.Generic;\n\n    internal class AppInfo\n    {\n        public AppInfo(string id, string displayName, string launcherId, IDictionary<string, object> launcherParams)\n        {\n            Id = id;\n            DisplayName = displayName;\n            LauncherId = launcherId;\n            LauncherParams = launcherParams == null\n                ? new Dictionary<string, object>()\n                : new Dictionary<string, object>(launcherParams);\n        }\n\n        public string Id { get; set; }\n\n        public string DisplayName { get; set; }\n\n        public string LauncherId { get; set; }\n\n        public IDictionary<string, object> LauncherParams { get; set; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppLaunchedEventProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Reactive.Subjects;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal class AppLaunchedEventProvider : IAppLaunchedEventProvider, IAppLaunchedEventConsumer\n    {\n        private readonly ReplaySubject<AppLaunchedEvent> _appLaunchedSubject = new ReplaySubject<AppLaunchedEvent>(10);\n\n        public IObservable<AppLaunchedEvent> AppLaunchedStream => _appLaunchedSubject;\n        public IObserver<AppLaunchedEvent> AppLaunchedEventObserver => _appLaunchedSubject;\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppLaunchedEventSubscriber.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Linq;\n    using System.Reactive.Linq;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using Plexus.Interop.Metamodel;\n    using AppConnectionDescriptor = Plexus.AppConnectionDescriptor;\n    using UniqueId = Plexus.UniqueId;\n\n    internal class AppLaunchedEventSubscriber\n    {\n        private readonly IRegistryProvider _registryProvider;\n        private readonly IAppLaunchedEventConsumer _appLaunchedEventConsumer;\n        private readonly IAppLifecycleManagerClientClientRepository _lifecycleManagerClientRepo;\n        private ILogger Log { get; } = LogManager.GetLogger<AppLaunchedEventSubscriber>();\n\n        public AppLaunchedEventSubscriber(\n            IAppLifecycleManager appConnectedEventProvider,\n            IRegistryProvider registryProvider,\n            IAppLaunchedEventConsumer appLaunchedEventConsumer,\n            IAppLifecycleManagerClientClientRepository lifecycleManagerClientRepo)\n        {\n            _registryProvider = registryProvider;\n            _appLaunchedEventConsumer = appLaunchedEventConsumer;\n            _lifecycleManagerClientRepo = lifecycleManagerClientRepo;\n            appConnectedEventProvider.ConnectionEventsStream\n                .Where(ev => ev.Type == ConnectionEventType.AppConnected)\n                .Select(ev => ev.Connection)\n                .Subscribe(OnAppConnected);\n        }\n\n        private void OnAppConnected(AppConnectionDescriptor appConnectionDescriptor)\n        {\n            if (IsLauncher(appConnectionDescriptor, out var applicationId))\n            {\n                SubscribeToApplicationLaunchedEventStream(applicationId, appConnectionDescriptor.ConnectionId);\n            }\n        }\n\n        private bool IsLauncher(AppConnectionDescriptor appConnectionDescriptor, out string applicationId)\n        {\n            applicationId = appConnectionDescriptor.ApplicationId;\n            return _registryProvider.Current.Applications.TryGetValue(applicationId, out var application)\n                && application.ProvidedServices.Any(service => service.Service.Id == AppLauncherService.Id);\n        }\n\n        private void SubscribeToApplicationLaunchedEventStream(string applicationId, UniqueId connectionId)\n        {\n            var appLauncherServiceId = AppLauncherService.Id;\n            var appLaunchedEventStreamMethodId = AppLauncherService.AppLaunchedEventStreamMethodId;\n            var methodCallDescriptor = ProvidedMethodReference.CreateWithConnectionId(appLauncherServiceId, appLaunchedEventStreamMethodId, applicationId, connectionId);\n\n            _lifecycleManagerClientRepo.GetClientObservable()\n                .Subscribe(client => SubscribeToLaunchedEventStream(client, connectionId, applicationId, methodCallDescriptor));\n        }\n\n        private void SubscribeToLaunchedEventStream(AppLifecycleManagerClient client, UniqueId connectionId, string applicationId, ProvidedMethodReference methodCallDescriptor)\n        {\n            Task.Factory.StartNew(async () =>\n            {\n                Log.Info($\"Subscribing client '{client.ApplicationInstanceId}' to ApplicationLaunchedEventStream of {connectionId} application ({applicationId})\");\n\n                await client.CallInvoker\n                    .CallServerStreaming<Empty, AppLaunchedEvent>(methodCallDescriptor.CallDescriptor, new Empty())\n                    .ResponseStream.PipeAsync(_appLaunchedEventConsumer.AppLaunchedEventObserver).ConfigureAwait(false);\n                Log.Info($\"Subscription to ApplicationLaunchedEventStream of {connectionId} application ({applicationId}) have finished\");\n            }, TaskCreationOptions.LongRunning);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppLifecycleManager.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using AppConnectionDescriptor = Plexus.AppConnectionDescriptor;\n    using UniqueId = Plexus.UniqueId;\n\n    internal sealed class AppLifecycleManager : IAppLifecycleManager\n    {\n        private readonly object _sync = new object();\n        private readonly HashSet<UniqueId> _appInstanceIds = new HashSet<UniqueId>();\n        private readonly Dictionary<UniqueId, IAppConnection> _connections = new Dictionary<UniqueId, IAppConnection>();\n        private readonly Dictionary<UniqueId, Dictionary<string, IAppConnection>> _appInstanceConnections = new Dictionary<UniqueId, Dictionary<string, IAppConnection>>();\n        private readonly Dictionary<string, List<IAppConnection>> _appConnections = new Dictionary<string, List<IAppConnection>>();\n\n        private readonly Dictionary<(UniqueId AppInstanceId, string AppId), Promise<IAppConnection>> _appInstanceConnectionsInProgress = new Dictionary<(UniqueId, string), Promise<IAppConnection>>();\n\n        private readonly IAppRegistryProvider _appRegistryProvider;\n        private readonly IAppLifecycleManagerClientClientRepository _appLifecycleManagerClientClientRepo;\n\n        private readonly Subject<AppConnectionEvent> _connectionSubject = new Subject<AppConnectionEvent>();\n\n        public AppLifecycleManager(\n            IAppRegistryProvider appRegistryProvider,\n            IAppLaunchedEventProvider appLaunchedEventProvider,\n            IAppLifecycleManagerClientClientRepository appLifecycleManagerClientClientRepo)\n        {\n            _appRegistryProvider = appRegistryProvider;\n            _appLifecycleManagerClientClientRepo = appLifecycleManagerClientClientRepo;\n            appLaunchedEventProvider.AppLaunchedStream.Subscribe(OnApplicationLaunchedEvent);\n        }\n\n        private ILogger Log { get; } = LogManager.GetLogger<AppLifecycleManager>();\n\n        public IObservable<AppConnectionEvent> ConnectionEventsStream => _connectionSubject;\n\n        public IReadOnlyCollection<IAppConnection> GetAppInstanceConnections(UniqueId appInstanceId)\n        {\n            lock (_sync)\n            {\n                if (_appInstanceConnections.TryGetValue(appInstanceId, out Dictionary<string, IAppConnection> connections))\n                {\n                    return connections.Values.ToList();\n                }\n                return new IAppConnection[0];\n            }\n        }\n\n        public IReadOnlyCollection<IAppConnection> GetAppConnections(string appId)\n        {\n            lock (_sync)\n            {\n                if (_appConnections.TryGetValue(appId, out var appConnections))\n                {\n                    return appConnections.ToList();\n                }\n                return new IAppConnection[0];\n            }\n        }\n\n        public IAppConnection AcceptConnection(\n            ITransportConnection connection,\n            AppConnectionDescriptor connectionInfo)\n        {\n            AppConnection clientConnection;\n            Promise<IAppConnection> waiter;\n            lock (_sync)\n            {\n                clientConnection = new AppConnection(connection, connectionInfo);\n                if (_connections.ContainsKey(clientConnection.Id))\n                {\n                    throw new InvalidOperationException($\"Connection id already exists: {clientConnection.Id}\");\n                }\n\n                _connections[clientConnection.Id] = clientConnection;\n                var appInstanceId = clientConnection.Info.ApplicationInstanceId;\n                if (!_appInstanceConnections.TryGetValue(appInstanceId, out var appConnections))\n                {\n                    appConnections = new Dictionary<string, IAppConnection>();\n                    _appInstanceConnections[appInstanceId] = appConnections;\n                }\n                appConnections[clientConnection.Info.ApplicationId] = clientConnection;\n\n                var appId = clientConnection.Info.ApplicationId;\n                if (!_appConnections.TryGetValue(appId, out var appConnectionList))\n                {\n                    appConnectionList = new List<IAppConnection>();\n                    _appConnections[appId] = appConnectionList;\n                }\n                appConnectionList.Add(clientConnection);\n\n                Log.Debug(\"New connection accepted: {{{0}}}\", clientConnection);\n\n                var deferredConnectionKey = (appInstanceId, appId);\n                if (_appInstanceConnectionsInProgress.TryGetValue(deferredConnectionKey, out waiter))\n                {\n                    Log.Debug(\"Resolving deferred connection {{{0}}} to accepted connection {{{1}}}\", deferredConnectionKey, connection);\n                    _appInstanceConnectionsInProgress.Remove(deferredConnectionKey);\n                }\n            }\n\n            waiter?.TryComplete(clientConnection);\n            _connectionSubject.OnNext(new AppConnectionEvent(connectionInfo, ConnectionEventType.AppConnected));\n\n            return clientConnection;\n        }\n\n        public bool TryRemoveConnection(IAppConnection connection)\n        {\n            Log.Debug(\"Removing connection {0}\", connection.Info);\n            Promise<IAppConnection> waiter;\n            lock (_sync)\n            {\n                if (!_connections.Remove(connection.Id))\n                {\n                    return false;\n                }\n\n                var appInstanceId = connection.Info.ApplicationInstanceId;\n                var appId = connection.Info.ApplicationId;\n                if (_appInstanceConnections.TryGetValue(appInstanceId, out var connections))\n                {\n                    connections.Remove(appId);\n                    if (connections.Count == 0)\n                    {\n                        _appInstanceConnections.Remove(appInstanceId);\n                    }\n                }\n\n                if (_appConnections.TryGetValue(appId, out var appConnectionList))\n                {\n                    appConnectionList.Remove(connection);\n                    if (appConnectionList.Count == 0)\n                    {\n                        _appConnections.Remove(appId);\n                    }\n                }\n\n                var deferredConnectionKey = (appInstanceId, connection.Info.ApplicationId);\n                if (_appInstanceConnectionsInProgress.TryGetValue(deferredConnectionKey, out waiter))\n                {\n                    _appInstanceConnectionsInProgress.Remove(deferredConnectionKey);\n                }\n            }\n\n            waiter?.TryCancel();\n            _connectionSubject.OnNext(new AppConnectionEvent(connection.Info, ConnectionEventType.AppDisconnected));\n            return true;\n        }\n\n        public void ReportConnectionError(AppConnectionDescriptor connectionInfo)\n            => _connectionSubject.OnNext(new AppConnectionEvent(connectionInfo, ConnectionEventType.AppConnectionError));\n\n        public bool TryGetConnectionInProgress(UniqueId appInstanceId, string appId, out Task<IAppConnection> appConnection)\n        {\n            lock (_sync)\n            {\n                if (_appInstanceConnections.TryGetValue(appInstanceId, out var connections) && connections.TryGetValue(appId, out var existingConnection))\n                {\n                    appConnection = Task.FromResult(existingConnection);\n                    return true;\n                }\n                if (_appInstanceConnectionsInProgress.TryGetValue((appInstanceId, appId), out var promise))\n                {\n                    appConnection = promise.Task;\n                    return true;\n                }\n\n                appConnection = null;\n                return false;\n            }\n        }\n\n        public bool TryGetOnlineConnection(UniqueId connectionId, out IAppConnection connection)\n        {\n            lock (_sync)\n            {\n                return _connections.TryGetValue(connectionId, out connection);\n            }\n        }\n\n        public bool TryGetOnlineConnection(UniqueId appInstanceId, string app, out IAppConnection connection)\n        {\n            connection = null;\n            lock (_sync)\n            {\n                return _appInstanceConnections.TryGetValue(appInstanceId, out var appConnections) &&\n                       appConnections.TryGetValue(app, out connection);\n            }\n        }\n\n        public IEnumerable<string> FilterCanBeLaunched(IEnumerable<string> appIds)\n        {\n            return appIds.Join(_appRegistryProvider.Current.Apps, x => x, y => y.Id, (x, y) => x).Distinct();\n        }\n\n        public bool CanBeLaunched(string appId)\n        {\n            return FilterCanBeLaunched(new[] { appId }).Contains(appId);\n        }\n\n        public async Task<ResolvedConnection> LaunchAndConnectAsync(string appId, ResolveMode mode, AppConnectionDescriptor referrerConnectionInfo)\n        {\n            var suggestedInstanceId = UniqueId.Generate();\n            Log.Debug($\"Resolving connection for app {appId} with mode {mode} to new instance with suggested id {suggestedInstanceId}\");\n            var resolvedConnection = await LaunchAndWaitConnectionAsync(appId, suggestedInstanceId, mode, referrerConnectionInfo).ConfigureAwait(false);\n\n            Log.Debug($\"Resolved connection for app {appId} with mode {mode} to launched instance {{{resolvedConnection}}} by request from {{{referrerConnectionInfo}}}\");\n            return new ResolvedConnection(resolvedConnection, suggestedInstanceId == resolvedConnection.Info.ApplicationInstanceId);\n        }\n\n        public IReadOnlyCollection<IAppConnection> GetOnlineConnections()\n        {\n            lock (_sync)\n            {\n                return _connections.Values.ToList();\n            }\n        }\n\n        private async Task<IAppConnection> LaunchAndWaitConnectionAsync(\n            string appId,\n            UniqueId suggestedAppInstanceId,\n            ResolveMode resolveMode,\n            AppConnectionDescriptor referrerConnectionInfo)\n        {\n            var appInstanceId = suggestedAppInstanceId;\n            Log.Info(\"Launching {0}\", appId);\n            var deferredConnectionKey = (suggestedAppInstanceId, appId);\n            try\n            {\n                appInstanceId = await LaunchAsync(appId, appInstanceId, resolveMode, referrerConnectionInfo).ConfigureAwait(false);\n\n                deferredConnectionKey = (appInstanceId, appId);\n\n                Promise<IAppConnection> connectionPromise;\n                lock (_sync)\n                {\n                    if (_appInstanceConnections.TryGetValue(appInstanceId, out var connections) && connections.TryGetValue(appId, out var existingConnection))\n                    {\n                        Log.Debug(\"Resolving deferred connection {{{0}}} to existing connection {{{1}}}\", deferredConnectionKey, existingConnection);\n                        return existingConnection;\n                    }\n                    else\n                    {\n                        if (_appInstanceConnectionsInProgress.TryGetValue(deferredConnectionKey, out var existingPromise))\n                        {\n                            connectionPromise = existingPromise;\n                        }\n                        else\n                        {\n                            connectionPromise = new Promise<IAppConnection>();\n                            _appInstanceConnectionsInProgress[deferredConnectionKey] = connectionPromise;\n                        }\n                    }\n                }\n\n                return await connectionPromise.Task.ConfigureAwait(false);\n            }\n            finally\n            {\n                lock (_sync)\n                {\n                    _appInstanceConnectionsInProgress.Remove(deferredConnectionKey);\n                }\n            }\n        }\n\n        private void OnApplicationLaunchedEvent(AppLaunchedEvent appLaunchedEvent)\n        {\n            var appInstanceId = appLaunchedEvent.AppInstanceId.ToUniqueId();\n            RegisterAppInstanceConnection(appLaunchedEvent.AppIds, appInstanceId);\n        }\n\n        public void RegisterAppInstanceConnection(string appId, UniqueId appInstanceId)\n        {\n            RegisterAppInstanceConnection(new[] { appId }, appInstanceId);\n        }\n\n        private void RegisterAppInstanceConnection(IEnumerable<string> appIds, UniqueId appInstanceId)\n        {\n            lock (_sync)\n            {\n                foreach (var appId in appIds)\n                {\n                    if (_appInstanceConnections.TryGetValue(appInstanceId, out var connections) && connections.TryGetValue(appId, out var _))\n                    {\n                        continue;\n                    }\n                    var deferredConnectionKey = (appInstanceId, appId);\n                    if (_appInstanceConnectionsInProgress.TryGetValue(deferredConnectionKey, out _))\n                    {\n                        continue;\n                    }\n                    _appInstanceConnectionsInProgress[deferredConnectionKey] = new Promise<IAppConnection>();\n                }\n                RegisterAppInstance(appInstanceId);\n            }\n        }\n\n        public void RegisterAppInstance(UniqueId appInstanceId)\n        {\n            bool added;\n            lock (_sync)\n            {\n                added = _appInstanceIds.Add(appInstanceId);\n            }\n            if (added)\n            {\n                Log.Debug($\"{nameof(RegisterAppInstance)}: {appInstanceId}\");\n            }\n        }\n\n        public bool IsAppInstanceRegistered(UniqueId appInstanceId)\n        {\n            lock (_sync)\n            {\n                return _appInstanceIds.Contains(appInstanceId);\n            }\n        }\n\n        private async Task<UniqueId> LaunchAsync(\n            string appId,\n            UniqueId suggestedAppInstanceId,\n            ResolveMode resolveMode,\n            AppConnectionDescriptor referrerConnectionInfo)\n        {\n            var appDto = _appRegistryProvider.Current.Apps.FirstOrDefault(x => string.Equals(x.Id, appId));\n            if (appDto == null)\n            {\n                throw new InvalidOperationException($\"The requested application {appId} is not defined in application registry\");\n            }\n\n            if (string.IsNullOrEmpty(appDto.LauncherId))\n            {\n                throw new InvalidOperationException($\"Launcher is not defined for application {appId}\");\n            }\n\n            Log.Debug(\"Sending request to launcher {0}: appId={1}, params={2}\", appDto.LauncherId, appId, string.Join(\"; \", appDto.LauncherParams.Select(kvp => $\"{kvp.Key}:{kvp.Value}\")));\n\n            var referrer = new AppLaunchReferrer\n            {\n                AppId = referrerConnectionInfo.ApplicationId,\n                AppInstanceId = referrerConnectionInfo.ApplicationInstanceId.ToProto(),\n                ConnectionId = referrerConnectionInfo.ConnectionId.ToProto()\n            };\n\n            var request = new AppLaunchRequest\n            {\n                AppId = appId,\n                LaunchParamsJson = JsonConvert.Serialize(appDto.LauncherParams),\n                SuggestedAppInstanceId = suggestedAppInstanceId.ToProto(),\n                LaunchMode = Convert(resolveMode),\n                Referrer = referrer\n            };\n\n            var response = await LaunchUsingLauncherAsync(appDto.LauncherId, request).ConfigureAwait(false);\n\n            var appInstanceId = UniqueId.FromHiLo(response.AppInstanceId.Hi, response.AppInstanceId.Lo);\n\n            Log.Info(\"Received launch response for app {0} from {1}: {2}\", appId, appDto.LauncherId, response);\n\n            return appInstanceId;\n        }\n\n        private async Task<AppLaunchResponse> LaunchUsingLauncherAsync(string launcherId, AppLaunchRequest request)\n        {\n            var appLauncherServiceId = AppLauncherService.Id;\n            var launchMethodId = AppLauncherService.LaunchMethodId;\n            var launchMethodReference = ProvidedMethodReference.Create(appLauncherServiceId, launchMethodId, launcherId);\n\n            var client = await _appLifecycleManagerClientClientRepo.GetClientAsync().ConfigureAwait(false);\n\n            var response = await client.CallInvoker\n                .CallUnary<AppLaunchRequest, AppLaunchResponse>(launchMethodReference.CallDescriptor, request)\n                .ConfigureAwait(false);\n\n            return response;\n        }\n\n        private static AppLaunchMode Convert(ResolveMode resolveMode)\n        {\n            switch (resolveMode)\n            {\n                case ResolveMode.SingleInstance:\n                    return AppLaunchMode.SingleInstance;\n                case ResolveMode.MultiInstance:\n                    return AppLaunchMode.MultiInstance;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(resolveMode), resolveMode, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppLifecycleManagerClientClientRepository.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal class AppLifecycleManagerClientClientRepository : IAppLifecycleManagerClientClientRepository\n    {\n        private ILogger Log { get; } = LogManager.GetLogger<AppLifecycleManagerClientClientRepository>();\n        private readonly object _lifecycleClientAccess = new object();\n        private readonly Subject<AppLifecycleManagerClient> _clientConnections = new Subject<AppLifecycleManagerClient>();\n\n        private AppLifecycleManagerClient _lifecycleManagerClient = null;\n        private bool _started = false;\n\n        public void Stop()\n        {\n            _started = false;\n\n            GetRunningClient()?.Disconnect();\n        }\n\n        public IObservable<AppLifecycleManagerClient> GetClientObservable()\n        {\n            var clientObservable = _clientConnections.AsObservable();\n\n            AppLifecycleManagerClient runningClient = GetRunningClient();\n            if (runningClient != null)\n            {\n                return Observable.Return(runningClient).Merge(clientObservable).DistinctUntilChanged();\n            }\n\n            return clientObservable;\n        }\n\n        public async Task<AppLifecycleManagerClient> GetClientAsync()\n        {\n            AppLifecycleManagerClient runningClient = GetRunningClient();\n            if (runningClient != null)\n            {\n                return runningClient;\n            }\n\n            return await _clientConnections.AsObservable().FirstOrDefaultAsync();\n        }\n\n        public async Task Start(Func<AppLifecycleManagerClient> createClientFunc)\n        {\n            var client = createClientFunc();\n            _started = true;\n\n            while (_started)\n            {\n                await client.ConnectAsync();\n                SetConnectedClient(client);\n                if (!_started)\n                {\n                    Disconnect(client);\n                }\n\n                try\n                {\n                    await client.Completion;\n                }\n                catch (Exception ex)\n                {\n                    Log.Warn(\"AppLifecycleManager completed with error\", ex);\n                }\n\n                RemoveCurrentClient();\n\n                if (_started)\n                {\n                    Log.Info(\"Trying to automatically reconnect AppLifecycleManager client\");\n                    client = createClientFunc();\n                }\n            }\n\n            _clientConnections.OnCompleted();\n        }\n\n        private void Disconnect(AppLifecycleManagerClient client)\n        {\n            client?.Disconnect();\n        }\n\n        private AppLifecycleManagerClient GetRunningClient()\n        {\n            lock (_lifecycleClientAccess)\n            {\n                return _lifecycleManagerClient;\n            }\n        }\n\n        private void SetConnectedClient(AppLifecycleManagerClient client)\n        {\n            lock (_lifecycleClientAccess)\n            {\n                _lifecycleManagerClient = client;\n            }\n            _clientConnections.OnNext(client);\n        }\n\n        private void RemoveCurrentClient()\n        {\n            AppLifecycleManagerClient client;\n            lock (_lifecycleClientAccess)\n            {\n                client = _lifecycleManagerClient;\n                _lifecycleManagerClient = null;\n            }\n            client?.Dispose();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppRegistry.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.Collections.Generic;\n\n    internal class AppRegistry\n    {\n        public AppRegistry(IEnumerable<AppInfo> apps)\n        {\n            Apps = new List<AppInfo>(apps);\n        }\n\n        public IReadOnlyCollection<AppInfo> Apps { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/AppsDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class AppsDto\n    {\n        [DataMember(Name = \"apps\")]\n        public List<AppDto> Apps { get; set; } = new List<AppDto>();\n\n        public static AppsDto FromContent(string content) => JsonConvert.Deserialize<AppsDto>(content);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppConnectionDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_connection_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_connection_descriptor.proto</summary>\n  internal static partial class AppConnectionDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_connection_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppConnectionDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0b3IucHJvdG8SB2lu\",\n            \"dGVyb3AaF2ludGVyb3AvdW5pcXVlX2lkLnByb3RvGhVpbnRlcm9wL29wdGlv\",\n            \"bnMucHJvdG8i1AEKF0FwcENvbm5lY3Rpb25EZXNjcmlwdG9yEigKDWNvbm5l\",\n            \"Y3Rpb25faWQYASABKAsyES5pbnRlcm9wLlVuaXF1ZUlkEg4KBmFwcF9pZBgC\",\n            \"IAEoCRIqCg9hcHBfaW5zdGFuY2VfaWQYAyABKAsyES5pbnRlcm9wLlVuaXF1\",\n            \"ZUlkEi4KDnRyYW5zcG9ydF90eXBlGAQgASgOMhYuaW50ZXJvcC5UcmFuc3Bv\",\n            \"cnRUeXBlOiOS2wQfaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcio3\",\n            \"Cg1UcmFuc3BvcnRUeXBlEgsKB1Vua25vd24QABIICgRQaXBlEAESBgoCV3MQ\",\n            \"AhIHCgNXc3MQA0IpqgImUGxleHVzLkludGVyb3AuQXBwcy5JbnRlcm5hbC5H\",\n            \"ZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Apps.Internal.Generated.TransportType), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor), global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor.Parser, new[]{ \"ConnectionId\", \"AppId\", \"AppInstanceId\", \"TransportType\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum TransportType {\n    [pbr::OriginalName(\"Unknown\")] Unknown = 0,\n    [pbr::OriginalName(\"Pipe\")] Pipe = 1,\n    [pbr::OriginalName(\"Ws\")] Ws = 2,\n    [pbr::OriginalName(\"Wss\")] Wss = 3,\n  }\n\n  #endregion\n\n  #region Messages\n  internal sealed partial class AppConnectionDescriptor : pb::IMessage<AppConnectionDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionDescriptor> _parser = new pb::MessageParser<AppConnectionDescriptor>(() => new AppConnectionDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor(AppConnectionDescriptor other) : this() {\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      appId_ = other.appId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      transportType_ = other.transportType_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor Clone() {\n      return new AppConnectionDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 2;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"transport_type\" field.</summary>\n    public const int TransportTypeFieldNumber = 4;\n    private global::Plexus.Interop.Apps.Internal.Generated.TransportType transportType_ = global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.TransportType TransportType {\n      get { return transportType_; }\n      set {\n        transportType_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      if (AppId != other.AppId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (TransportType != other.TransportType) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (TransportType != global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown) hash ^= TransportType.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.TransportType != global::Plexus.Interop.Apps.Internal.Generated.TransportType.Unknown) {\n        TransportType = other.TransportType;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Interop.Apps.Internal.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Interop.Apps.Internal.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLaunchMode.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_launch_mode.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_launch_mode.proto</summary>\n  internal static partial class AppLaunchModeReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_launch_mode.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLaunchModeReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch1pbnRlcm9wL2FwcF9sYXVuY2hfbW9kZS5wcm90bxIHaW50ZXJvcBoVaW50\",\n            \"ZXJvcC9vcHRpb25zLnByb3RvKjgKDUFwcExhdW5jaE1vZGUSEwoPU0lOR0xF\",\n            \"X0lOU1RBTkNFEAASEgoOTVVMVElfSU5TVEFOQ0UQAUIpqgImUGxleHVzLklu\",\n            \"dGVyb3AuQXBwcy5JbnRlcm5hbC5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode), }, null, null));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum AppLaunchMode {\n    [pbr::OriginalName(\"SINGLE_INSTANCE\")] SingleInstance = 0,\n    [pbr::OriginalName(\"MULTI_INSTANCE\")] MultiInstance = 1,\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLauncherService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_launcher_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_launcher_service.proto</summary>\n  internal static partial class AppLauncherServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_launcher_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLauncherServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiJpbnRlcm9wL2FwcF9sYXVuY2hlcl9zZXJ2aWNlLnByb3RvEgdpbnRlcm9w\",\n            \"Ghtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aF2ludGVyb3AvdW5pcXVl\",\n            \"X2lkLnByb3RvGh1pbnRlcm9wL2FwcF9sYXVuY2hfbW9kZS5wcm90bxoVaW50\",\n            \"ZXJvcC9vcHRpb25zLnByb3RvIu0BChBBcHBMYXVuY2hSZXF1ZXN0Eg4KBmFw\",\n            \"cF9pZBgBIAEoCRIaChJsYXVuY2hfcGFyYW1zX2pzb24YAiABKAkSKwoLbGF1\",\n            \"bmNoX21vZGUYAyABKA4yFi5pbnRlcm9wLkFwcExhdW5jaE1vZGUSNAoZc3Vn\",\n            \"Z2VzdGVkX2FwcF9pbnN0YW5jZV9pZBgEIAEoCzIRLmludGVyb3AuVW5pcXVl\",\n            \"SWQSLAoIcmVmZXJyZXIYBSABKAsyGi5pbnRlcm9wLkFwcExhdW5jaFJlZmVy\",\n            \"cmVyOhyS2wQYaW50ZXJvcC5BcHBMYXVuY2hSZXF1ZXN0IpgBChFBcHBMYXVu\",\n            \"Y2hSZWZlcnJlchIOCgZhcHBfaWQYASABKAkSKgoPYXBwX2luc3RhbmNlX2lk\",\n            \"GAIgASgLMhEuaW50ZXJvcC5VbmlxdWVJZBIoCg1jb25uZWN0aW9uX2lkGAMg\",\n            \"ASgLMhEuaW50ZXJvcC5VbmlxdWVJZDodktsEGWludGVyb3AuQXBwTGF1bmNo\",\n            \"UmVmZXJyZXIiXgoRQXBwTGF1bmNoUmVzcG9uc2USKgoPYXBwX2luc3RhbmNl\",\n            \"X2lkGAEgASgLMhEuaW50ZXJvcC5VbmlxdWVJZDodktsEGWludGVyb3AuQXBw\",\n            \"TGF1bmNoUmVzcG9uc2UimwEKEEFwcExhdW5jaGVkRXZlbnQSKgoPYXBwX2lu\",\n            \"c3RhbmNlX2lkGAEgASgLMhEuaW50ZXJvcC5VbmlxdWVJZBIPCgdhcHBfaWRz\",\n            \"GAIgAygJEiwKCHJlZmVycmVyGAMgASgLMhouaW50ZXJvcC5BcHBMYXVuY2hS\",\n            \"ZWZlcnJlcjocktsEGGludGVyb3AuQXBwTGF1bmNoZWRFdmVudDLEAQoSQXBw\",\n            \"TGF1bmNoZXJTZXJ2aWNlEj8KBkxhdW5jaBIZLmludGVyb3AuQXBwTGF1bmNo\",\n            \"UmVxdWVzdBoaLmludGVyb3AuQXBwTGF1bmNoUmVzcG9uc2USTQoWQXBwTGF1\",\n            \"bmNoZWRFdmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoZLmlu\",\n            \"dGVyb3AuQXBwTGF1bmNoZWRFdmVudDABGh6S2wQaaW50ZXJvcC5BcHBMYXVu\",\n            \"Y2hlclNlcnZpY2VCKaoCJlBsZXh1cy5JbnRlcm9wLkFwcHMuSW50ZXJuYWwu\",\n            \"R2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest), global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest.Parser, new[]{ \"AppId\", \"LaunchParamsJson\", \"LaunchMode\", \"SuggestedAppInstanceId\", \"Referrer\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer), global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer.Parser, new[]{ \"AppId\", \"AppInstanceId\", \"ConnectionId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse), global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse.Parser, new[]{ \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent), global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent.Parser, new[]{ \"AppInstanceId\", \"AppIds\", \"Referrer\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class AppLaunchRequest : pb::IMessage<AppLaunchRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchRequest> _parser = new pb::MessageParser<AppLaunchRequest>(() => new AppLaunchRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest(AppLaunchRequest other) : this() {\n      appId_ = other.appId_;\n      launchParamsJson_ = other.launchParamsJson_;\n      launchMode_ = other.launchMode_;\n      suggestedAppInstanceId_ = other.suggestedAppInstanceId_ != null ? other.suggestedAppInstanceId_.Clone() : null;\n      referrer_ = other.referrer_ != null ? other.referrer_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest Clone() {\n      return new AppLaunchRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_params_json\" field.</summary>\n    public const int LaunchParamsJsonFieldNumber = 2;\n    private string launchParamsJson_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string LaunchParamsJson {\n      get { return launchParamsJson_; }\n      set {\n        launchParamsJson_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_mode\" field.</summary>\n    public const int LaunchModeFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode launchMode_ = global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode LaunchMode {\n      get { return launchMode_; }\n      set {\n        launchMode_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"suggested_app_instance_id\" field.</summary>\n    public const int SuggestedAppInstanceIdFieldNumber = 4;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId suggestedAppInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId SuggestedAppInstanceId {\n      get { return suggestedAppInstanceId_; }\n      set {\n        suggestedAppInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"referrer\" field.</summary>\n    public const int ReferrerFieldNumber = 5;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer referrer_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer Referrer {\n      get { return referrer_; }\n      set {\n        referrer_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (LaunchParamsJson != other.LaunchParamsJson) return false;\n      if (LaunchMode != other.LaunchMode) return false;\n      if (!object.Equals(SuggestedAppInstanceId, other.SuggestedAppInstanceId)) return false;\n      if (!object.Equals(Referrer, other.Referrer)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (LaunchParamsJson.Length != 0) hash ^= LaunchParamsJson.GetHashCode();\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) hash ^= LaunchMode.GetHashCode();\n      if (suggestedAppInstanceId_ != null) hash ^= SuggestedAppInstanceId.GetHashCode();\n      if (referrer_ != null) hash ^= Referrer.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Referrer);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.LaunchParamsJson.Length != 0) {\n        LaunchParamsJson = other.LaunchParamsJson;\n      }\n      if (other.LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        LaunchMode = other.LaunchMode;\n      }\n      if (other.suggestedAppInstanceId_ != null) {\n        if (suggestedAppInstanceId_ == null) {\n          SuggestedAppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        SuggestedAppInstanceId.MergeFrom(other.SuggestedAppInstanceId);\n      }\n      if (other.referrer_ != null) {\n        if (referrer_ == null) {\n          Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n        }\n        Referrer.MergeFrom(other.Referrer);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            LaunchParamsJson = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 34: {\n            if (suggestedAppInstanceId_ == null) {\n              SuggestedAppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(SuggestedAppInstanceId);\n            break;\n          }\n          case 42: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            LaunchParamsJson = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 34: {\n            if (suggestedAppInstanceId_ == null) {\n              SuggestedAppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(SuggestedAppInstanceId);\n            break;\n          }\n          case 42: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppLaunchReferrer : pb::IMessage<AppLaunchReferrer>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchReferrer> _parser = new pb::MessageParser<AppLaunchReferrer>(() => new AppLaunchReferrer());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchReferrer> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer(AppLaunchReferrer other) : this() {\n      appId_ = other.appId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer Clone() {\n      return new AppLaunchReferrer(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchReferrer);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchReferrer other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchReferrer other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppLaunchResponse : pb::IMessage<AppLaunchResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchResponse> _parser = new pb::MessageParser<AppLaunchResponse>(() => new AppLaunchResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse(AppLaunchResponse other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse Clone() {\n      return new AppLaunchResponse(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppLaunchedEvent : pb::IMessage<AppLaunchedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchedEvent> _parser = new pb::MessageParser<AppLaunchedEvent>(() => new AppLaunchedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent(AppLaunchedEvent other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appIds_ = other.appIds_.Clone();\n      referrer_ = other.referrer_ != null ? other.referrer_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent Clone() {\n      return new AppLaunchedEvent(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_ids\" field.</summary>\n    public const int AppIdsFieldNumber = 2;\n    private static readonly pb::FieldCodec<string> _repeated_appIds_codec\n        = pb::FieldCodec.ForString(18);\n    private readonly pbc::RepeatedField<string> appIds_ = new pbc::RepeatedField<string>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> AppIds {\n      get { return appIds_; }\n    }\n\n    /// <summary>Field number for the \"referrer\" field.</summary>\n    public const int ReferrerFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer referrer_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer Referrer {\n      get { return referrer_; }\n      set {\n        referrer_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if(!appIds_.Equals(other.appIds_)) return false;\n      if (!object.Equals(Referrer, other.Referrer)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      hash ^= appIds_.GetHashCode();\n      if (referrer_ != null) hash ^= Referrer.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(output, _repeated_appIds_codec);\n      if (referrer_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(ref output, _repeated_appIds_codec);\n      if (referrer_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      size += appIds_.CalculateSize(_repeated_appIds_codec);\n      if (referrer_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Referrer);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      appIds_.Add(other.appIds_);\n      if (other.referrer_ != null) {\n        if (referrer_ == null) {\n          Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n        }\n        Referrer.MergeFrom(other.Referrer);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(ref input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Apps.Internal.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLauncherService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_launcher_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class AppLauncherService {\n\t\t\n\t\tpublic const string Id = \"interop.AppLauncherService\";\t\t\t\n\t\tpublic const string LaunchMethodId = \"Launch\";\n\t\tpublic const string AppLaunchedEventStreamMethodId = \"AppLaunchedEventStream\";\n\t\t\n\t\tpublic static readonly AppLauncherService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppLauncherService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppLauncherService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppLauncherService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppLauncherService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface ILaunchProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLaunchedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface ILaunchImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLaunchedEventStreamImpl {\n\t\t\tTask AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> LaunchMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> AppLaunchedEventStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tLaunchMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse>(Id, LaunchMethodId);\n\t\t\t\tAppLaunchedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent>(Id, AppLaunchedEventStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tLaunchMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse>(Id, alias, LaunchMethodId);\n\t\t\t\tAppLaunchedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent>(Id, alias, AppLaunchedEventStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLifecycleManager.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_lifecycle_manager.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tinternal partial interface IAppLifecycleManagerClient: IClient {\n\t\tAppLifecycleManagerClient.IAppLauncherServiceProxy AppLauncherService { get; }\n\t}\n\t\n\tinternal sealed partial class AppLifecycleManagerClient: ClientBase, IAppLifecycleManagerClient {\n\t\t\n\t\tpublic const string Id = \"interop.AppLifecycleManager\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(AppLifecycleManagerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic AppLifecycleManagerClient(\n\t\t\tAppLifecycleManagerClient.IAppLifecycleServiceImpl appLifecycleService,\n\t\t\tAppLifecycleManagerClient.IAppMetadataServiceImpl appMetadataService,\n\t\t\tAppLifecycleManagerClient.IContextLinkageServiceImpl contextLinkageService,\n\t\t\tAppLifecycleManagerClient.IAppRegistrationServiceImpl appRegistrationService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new AppLifecycleManagerClient.ServiceBinder(\n\t\t\tappLifecycleService,\n\t\t\tappMetadataService,\n\t\t\tcontextLinkageService,\n\t\t\tappRegistrationService\n\t\t), setup) { }\n\t\t\n\t\tpublic AppLifecycleManagerClient(AppLifecycleManagerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t\tAppLauncherService = new AppLifecycleManagerClient.AppLauncherServiceProxy(this.CallInvoker);\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tAppLifecycleManagerClient.IAppLifecycleServiceImpl appLifecycleService,\n\t\t\t\tAppLifecycleManagerClient.IAppMetadataServiceImpl appMetadataService,\n\t\t\t\tAppLifecycleManagerClient.IContextLinkageServiceImpl contextLinkageService,\n\t\t\t\tAppLifecycleManagerClient.IAppRegistrationServiceImpl appRegistrationService\n\t\t\t) {\n\t\t\t\t_appLifecycleServiceBinder = new AppLifecycleManagerClient.AppLifecycleServiceBinder(appLifecycleService);\n\t\t\t\t_appMetadataServiceBinder = new AppLifecycleManagerClient.AppMetadataServiceBinder(appMetadataService);\n\t\t\t\t_contextLinkageServiceBinder = new AppLifecycleManagerClient.ContextLinkageServiceBinder(contextLinkageService);\n\t\t\t\t_appRegistrationServiceBinder = new AppLifecycleManagerClient.AppRegistrationServiceBinder(appRegistrationService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate AppLifecycleServiceBinder _appLifecycleServiceBinder;\n\t\t\tprivate AppMetadataServiceBinder _appMetadataServiceBinder;\n\t\t\tprivate ContextLinkageServiceBinder _contextLinkageServiceBinder;\n\t\t\tprivate AppRegistrationServiceBinder _appRegistrationServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _appLifecycleServiceBinder.Bind(builder);\n\t\t\t\tbuilder = _appMetadataServiceBinder.Bind(builder);\n\t\t\t\tbuilder = _contextLinkageServiceBinder.Bind(builder);\n\t\t\t\tbuilder = _appRegistrationServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface IAppLifecycleServiceImpl:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IResolveAppImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetLifecycleEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetInvocationEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetConnectionsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetConnectionsStreamImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class AppLifecycleServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IAppLifecycleServiceImpl _impl;\n\t\t\t\n\t\t\tpublic AppLifecycleServiceBinder(IAppLifecycleServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse>(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.ResolveAppMethodId, _impl.ResolveApp);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.GetLifecycleEventStreamMethodId, _impl.GetLifecycleEventStream);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.GetInvocationEventStreamMethodId, _impl.GetInvocationEventStream);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse>(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.GetConnectionsMethodId, _impl.GetConnections);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.GetConnectionsStreamMethodId, _impl.GetConnectionsStream);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class AppLifecycleServiceImpl: IAppLifecycleServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> _resolveAppHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> _getLifecycleEventStreamHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> _getInvocationEventStreamHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> _getConnectionsHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> _getConnectionsStreamHandler;\n\t\t\t\n\t\t\tpublic AppLifecycleServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> resolveAppHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> getLifecycleEventStreamHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> getInvocationEventStreamHandler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> getConnectionsHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> getConnectionsStreamHandler\n\t\t\t) {\n\t\t\t\t_resolveAppHandler = resolveAppHandler;\n\t\t\t\t_getLifecycleEventStreamHandler = getLifecycleEventStreamHandler;\n\t\t\t\t_getInvocationEventStreamHandler = getInvocationEventStreamHandler;\n\t\t\t\t_getConnectionsHandler = getConnectionsHandler;\n\t\t\t\t_getConnectionsStreamHandler = getConnectionsStreamHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest request, MethodCallContext context) {\n\t\t\t\treturn _resolveAppHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _getLifecycleEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _getInvocationEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, MethodCallContext context) {\n\t\t\t\treturn _getConnectionsHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetConnectionsStream(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _getConnectionsStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class AppLifecycleServiceImpl<T>: IAppLifecycleServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IResolveAppImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetLifecycleEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetInvocationEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetConnectionsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLifecycleService.IGetConnectionsStreamImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic AppLifecycleServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.ResolveApp(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.GetLifecycleEventStream(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.GetInvocationEventStream(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.GetConnections(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetConnectionsStream(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.GetConnectionsStream(request, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IAppMetadataServiceImpl:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.IGetAppMetadataChangedEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.IGetMetamodelChangedEventStreamImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class AppMetadataServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IAppMetadataServiceImpl _impl;\n\t\t\t\n\t\t\tpublic AppMetadataServiceBinder(IAppMetadataServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.GetAppMetadataChangedEventStreamMethodId, _impl.GetAppMetadataChangedEventStream);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.GetMetamodelChangedEventStreamMethodId, _impl.GetMetamodelChangedEventStream);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class AppMetadataServiceImpl: IAppMetadataServiceImpl\n\t\t{\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> _getAppMetadataChangedEventStreamHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> _getMetamodelChangedEventStreamHandler;\n\t\t\t\n\t\t\tpublic AppMetadataServiceImpl(\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> getAppMetadataChangedEventStreamHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> getMetamodelChangedEventStreamHandler\n\t\t\t) {\n\t\t\t\t_getAppMetadataChangedEventStreamHandler = getAppMetadataChangedEventStreamHandler;\n\t\t\t\t_getMetamodelChangedEventStreamHandler = getMetamodelChangedEventStreamHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _getAppMetadataChangedEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _getMetamodelChangedEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class AppMetadataServiceImpl<T>: IAppMetadataServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.IGetAppMetadataChangedEventStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppMetadataService.IGetMetamodelChangedEventStreamImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic AppMetadataServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.GetAppMetadataChangedEventStream(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.GetMetamodelChangedEventStream(request, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IContextLinkageServiceImpl:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IContextLoadedStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.ICreateContextImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.ICreateContext2Impl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IJoinContextImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetContextsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetLinkedInvocationsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetAllLinkedInvocationsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IAppJoinedContextStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IRestoreContextsLinkageImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class ContextLinkageServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IContextLinkageServiceImpl _impl;\n\t\t\t\n\t\t\tpublic ContextLinkageServiceBinder(IContextLinkageServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.ContextLoadedStreamMethodId, _impl.ContextLoadedStream);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.CreateContextMethodId, _impl.CreateContext);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.CreateContext2MethodId, _impl.CreateContext2);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.JoinContextMethodId, _impl.JoinContext);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.GetContextsMethodId, _impl.GetContexts);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.GetLinkedInvocationsMethodId, _impl.GetLinkedInvocations);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.GetAllLinkedInvocationsMethodId, _impl.GetAllLinkedInvocations);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.AppJoinedContextStreamMethodId, _impl.AppJoinedContextStream);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse>(global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.RestoreContextsLinkageMethodId, _impl.RestoreContextsLinkage);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class ContextLinkageServiceImpl: IContextLinkageServiceImpl\n\t\t{\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> _contextLoadedStreamHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context> _createContextHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context> _createContext2Handler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty> _joinContextHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList> _getContextsHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> _getLinkedInvocationsHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> _getAllLinkedInvocationsHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> _appJoinedContextStreamHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> _restoreContextsLinkageHandler;\n\t\t\t\n\t\t\tpublic ContextLinkageServiceImpl(\n\t\t\t\tServerStreamingMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> contextLoadedStreamHandler,\n\t\t\t\tUnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context> createContextHandler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context> createContext2Handler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty> joinContextHandler,\n\t\t\t\tUnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList> getContextsHandler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> getLinkedInvocationsHandler,\n\t\t\t\tUnaryMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> getAllLinkedInvocationsHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> appJoinedContextStreamHandler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> restoreContextsLinkageHandler\n\t\t\t) {\n\t\t\t\t_contextLoadedStreamHandler = contextLoadedStreamHandler;\n\t\t\t\t_createContextHandler = createContextHandler;\n\t\t\t\t_createContext2Handler = createContext2Handler;\n\t\t\t\t_joinContextHandler = joinContextHandler;\n\t\t\t\t_getContextsHandler = getContextsHandler;\n\t\t\t\t_getLinkedInvocationsHandler = getLinkedInvocationsHandler;\n\t\t\t\t_getAllLinkedInvocationsHandler = getAllLinkedInvocationsHandler;\n\t\t\t\t_appJoinedContextStreamHandler = appJoinedContextStreamHandler;\n\t\t\t\t_restoreContextsLinkageHandler = restoreContextsLinkageHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ContextLoadedStream(global::Plexus.Interop.Apps.Internal.Generated.Context request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> responseStream, MethodCallContext context) {\n\t\t\t\treturn _contextLoadedStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _createContextHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext2(global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest request, MethodCallContext context) {\n\t\t\t\treturn _createContext2Handler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context) {\n\t\t\t\treturn _joinContextHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _getContextsHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context) {\n\t\t\t\treturn _getLinkedInvocationsHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _getAllLinkedInvocationsHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _appJoinedContextStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest request, MethodCallContext context) {\n\t\t\t\treturn _restoreContextsLinkageHandler(request, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class ContextLinkageServiceImpl<T>: IContextLinkageServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IContextLoadedStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.ICreateContextImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.ICreateContext2Impl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IJoinContextImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetContextsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetLinkedInvocationsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IGetAllLinkedInvocationsImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IAppJoinedContextStreamImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.ContextLinkageService.IRestoreContextsLinkageImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic ContextLinkageServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ContextLoadedStream(global::Plexus.Interop.Apps.Internal.Generated.Context request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.ContextLoadedStream(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _impl.CreateContext(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext2(global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.CreateContext2(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context) {\n\t\t\t\treturn _impl.JoinContext(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _impl.GetContexts(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context) {\n\t\t\t\treturn _impl.GetLinkedInvocations(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context) {\n\t\t\t\treturn _impl.GetAllLinkedInvocations(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.AppJoinedContextStream(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.RestoreContextsLinkage(request, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IAppRegistrationServiceImpl:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.IRequestInstanceIdImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.IRegisterInstanceIdImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class AppRegistrationServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IAppRegistrationServiceImpl _impl;\n\t\t\t\n\t\t\tpublic AppRegistrationServiceBinder(IAppRegistrationServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId>(global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.RequestInstanceIdMethodId, _impl.RequestInstanceId);\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse>(global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.RegisterInstanceIdMethodId, _impl.RegisterInstanceId);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class AppRegistrationServiceImpl: IAppRegistrationServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId> _requestInstanceIdHandler;\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> _registerInstanceIdHandler;\n\t\t\t\n\t\t\tpublic AppRegistrationServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId> requestInstanceIdHandler,\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> registerInstanceIdHandler\n\t\t\t) {\n\t\t\t\t_requestInstanceIdHandler = requestInstanceIdHandler;\n\t\t\t\t_registerInstanceIdHandler = registerInstanceIdHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest request, MethodCallContext context) {\n\t\t\t\treturn _requestInstanceIdHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest request, MethodCallContext context) {\n\t\t\t\treturn _registerInstanceIdHandler(request, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class AppRegistrationServiceImpl<T>: IAppRegistrationServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.IRequestInstanceIdImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppRegistrationService.IRegisterInstanceIdImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic AppRegistrationServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.RequestInstanceId(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.RegisterInstanceId(request, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLauncherServiceProxy:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.ILaunchProxy,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.IAppLaunchedEventStreamProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class AppLauncherServiceProxy: IAppLauncherServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.Descriptor Descriptor = global::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic AppLauncherServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.LaunchMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.AppLaunchedEventStreamMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IAppLauncherServiceProxy AppLauncherService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLifecycleService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_lifecycle_service.proto</summary>\n  internal static partial class AppLifecycleServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_lifecycle_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLifecycleServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2FwcF9saWZlY3ljbGVfc2VydmljZS5wcm90bxIHaW50ZXJv\",\n            \"cBoXaW50ZXJvcC91bmlxdWVfaWQucHJvdG8aHWludGVyb3AvYXBwX2xhdW5j\",\n            \"aF9tb2RlLnByb3RvGidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0\",\n            \"b3IucHJvdG8aI2ludGVyb3AvaW52b2NhdGlvbl9kZXNjcmlwdG9yLnByb3Rv\",\n            \"Ghtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aFWludGVyb3Avb3B0aW9u\",\n            \"cy5wcm90byJ0ChFSZXNvbHZlQXBwUmVxdWVzdBIOCgZhcHBfaWQYASABKAkS\",\n            \"MAoQYXBwX3Jlc29sdmVfbW9kZRgCIAEoDjIWLmludGVyb3AuQXBwTGF1bmNo\",\n            \"TW9kZTodktsEGWludGVyb3AuUmVzb2x2ZUFwcFJlcXVlc3QisAEKElJlc29s\",\n            \"dmVBcHBSZXNwb25zZRIqCg9hcHBfaW5zdGFuY2VfaWQYASABKAsyES5pbnRl\",\n            \"cm9wLlVuaXF1ZUlkEiwKEWFwcF9jb25uZWN0aW9uX2lkGAIgASgLMhEuaW50\",\n            \"ZXJvcC5VbmlxdWVJZBIgChhpc19uZXdfaW5zdGFuY2VfbGF1bmNoZWQYAyAB\",\n            \"KAg6HpLbBBppbnRlcm9wLlJlc29sdmVBcHBSZXNwb25zZSLWAQoRQXBwTGlm\",\n            \"ZWN5Y2xlRXZlbnQSLwoJY29ubmVjdGVkGAEgASgLMhouaW50ZXJvcC5BcHBD\",\n            \"b25uZWN0ZWRFdmVudEgAEjUKDGRpc2Nvbm5lY3RlZBgCIAEoCzIdLmludGVy\",\n            \"b3AuQXBwRGlzY29ubmVjdGVkRXZlbnRIABIxCgVlcnJvchgDIAEoCzIgLmlu\",\n            \"dGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnRIADodktsEGWludGVyb3Au\",\n            \"QXBwTGlmZWN5Y2xlRXZlbnRCBwoFZXZlbnQitwEKD0ludm9jYXRpb25FdmVu\",\n            \"dBI9ChJpbnZvY2F0aW9uX3N0YXJ0ZWQYASABKAsyHy5pbnRlcm9wLkludm9j\",\n            \"YXRpb25TdGFydGVkRXZlbnRIABI/ChNpbnZvY2F0aW9uX2ZpbmlzaGVkGAIg\",\n            \"ASgLMiAuaW50ZXJvcC5JbnZvY2F0aW9uRmluaXNoZWRFdmVudEgAOhuS2wQX\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uRXZlbnRCBwoFZXZlbnQicwoRQXBwQ29ubmVj\",\n            \"dGVkRXZlbnQSPwoVY29ubmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50\",\n            \"ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcjodktsEGWludGVyb3AuQXBw\",\n            \"Q29ubmVjdGVkRXZlbnQieQoUQXBwRGlzY29ubmVjdGVkRXZlbnQSPwoVY29u\",\n            \"bmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0\",\n            \"aW9uRGVzY3JpcHRvcjogktsEHGludGVyb3AuQXBwRGlzY29ubmVjdGVkRXZl\",\n            \"bnQifwoXQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQSPwoVY29ubmVjdGlvbl9k\",\n            \"ZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3Jp\",\n            \"cHRvcjojktsEH2ludGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQiegoW\",\n            \"SW52b2NhdGlvblN0YXJ0ZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0\",\n            \"b3IYASABKAsyHS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yOiKS2wQe\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uU3RhcnRlZEV2ZW50IrwBChdJbnZvY2F0aW9u\",\n            \"RmluaXNoZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0b3IYASABKAsy\",\n            \"HS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yEikKBnJlc3VsdBgCIAEo\",\n            \"DjIZLmludGVyb3AuSW52b2NhdGlvblJlc3VsdBITCgtkdXJhdGlvbl9tcxgD\",\n            \"IAEoAzojktsEH2ludGVyb3AuSW52b2NhdGlvbkZpbmlzaGVkRXZlbnQiqAEK\",\n            \"FUdldENvbm5lY3Rpb25zUmVxdWVzdBIWCg5hcHBsaWNhdGlvbl9pZBgBIAEo\",\n            \"CRIqCg9hcHBfaW5zdGFuY2VfaWQYAiABKAsyES5pbnRlcm9wLlVuaXF1ZUlk\",\n            \"EigKDWNvbm5lY3Rpb25faWQYAyABKAsyES5pbnRlcm9wLlVuaXF1ZUlkOiGS\",\n            \"2wQdaW50ZXJvcC5HZXRDb25uZWN0aW9uc1JlcXVlc3QicwoWR2V0Q29ubmVj\",\n            \"dGlvbnNSZXNwb25zZRI1Cgtjb25uZWN0aW9ucxgBIAMoCzIgLmludGVyb3Au\",\n            \"QXBwQ29ubmVjdGlvbkRlc2NyaXB0b3I6IpLbBB5pbnRlcm9wLkdldENvbm5l\",\n            \"Y3Rpb25zUmVzcG9uc2Ui8QEKE0dldENvbm5lY3Rpb25zRXZlbnQSNQoLY29u\",\n            \"bmVjdGlvbnMYASADKAsyIC5pbnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlw\",\n            \"dG9yEjoKDm5ld19jb25uZWN0aW9uGAIgASgLMiAuaW50ZXJvcC5BcHBDb25u\",\n            \"ZWN0aW9uRGVzY3JpcHRvckgAEj0KEWNsb3NlZF9jb25uZWN0aW9uGAMgASgL\",\n            \"MiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvckgAOh+S2wQbaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50QgcKBWV2ZW50KjsKEEludm9jYXRp\",\n            \"b25SZXN1bHQSDQoJU3VjY2VlZGVkEAASDAoIQ2FuY2VsZWQQARIKCgZGYWls\",\n            \"ZWQQAjLJAwoTQXBwTGlmZWN5Y2xlU2VydmljZRJFCgpSZXNvbHZlQXBwEhou\",\n            \"aW50ZXJvcC5SZXNvbHZlQXBwUmVxdWVzdBobLmludGVyb3AuUmVzb2x2ZUFw\",\n            \"cFJlc3BvbnNlEk8KF0dldExpZmVjeWNsZUV2ZW50U3RyZWFtEhYuZ29vZ2xl\",\n            \"LnByb3RvYnVmLkVtcHR5GhouaW50ZXJvcC5BcHBMaWZlY3ljbGVFdmVudDAB\",\n            \"Ek4KGEdldEludm9jYXRpb25FdmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1\",\n            \"Zi5FbXB0eRoYLmludGVyb3AuSW52b2NhdGlvbkV2ZW50MAESUQoOR2V0Q29u\",\n            \"bmVjdGlvbnMSHi5pbnRlcm9wLkdldENvbm5lY3Rpb25zUmVxdWVzdBofLmlu\",\n            \"dGVyb3AuR2V0Q29ubmVjdGlvbnNSZXNwb25zZRJWChRHZXRDb25uZWN0aW9u\",\n            \"c1N0cmVhbRIeLmludGVyb3AuR2V0Q29ubmVjdGlvbnNSZXF1ZXN0GhwuaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50MAEaH5LbBBtpbnRlcm9wLkFwcExp\",\n            \"ZmVjeWNsZVNlcnZpY2VCKaoCJlBsZXh1cy5JbnRlcm9wLkFwcHMuSW50ZXJu\",\n            \"YWwuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationResult), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest), global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest.Parser, new[]{ \"AppId\", \"AppResolveMode\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse), global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse.Parser, new[]{ \"AppInstanceId\", \"AppConnectionId\", \"IsNewInstanceLaunched\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent), global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent.Parser, new[]{ \"Connected\", \"Disconnected\", \"Error\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent), global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent.Parser, new[]{ \"InvocationStarted\", \"InvocationFinished\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent), global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent), global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent), global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent), global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent.Parser, new[]{ \"InvocationDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent), global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent.Parser, new[]{ \"InvocationDescriptor\", \"Result\", \"DurationMs\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest), global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest.Parser, new[]{ \"ApplicationId\", \"AppInstanceId\", \"ConnectionId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse), global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse.Parser, new[]{ \"Connections\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent), global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent.Parser, new[]{ \"Connections\", \"NewConnection\", \"ClosedConnection\" }, new[]{ \"Event\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum InvocationResult {\n    [pbr::OriginalName(\"Succeeded\")] Succeeded = 0,\n    [pbr::OriginalName(\"Canceled\")] Canceled = 1,\n    [pbr::OriginalName(\"Failed\")] Failed = 2,\n  }\n\n  #endregion\n\n  #region Messages\n  internal sealed partial class ResolveAppRequest : pb::IMessage<ResolveAppRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppRequest> _parser = new pb::MessageParser<ResolveAppRequest>(() => new ResolveAppRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest(ResolveAppRequest other) : this() {\n      appId_ = other.appId_;\n      appResolveMode_ = other.appResolveMode_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest Clone() {\n      return new ResolveAppRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_resolve_mode\" field.</summary>\n    public const int AppResolveModeFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode appResolveMode_ = global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode AppResolveMode {\n      get { return appResolveMode_; }\n      set {\n        appResolveMode_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (AppResolveMode != other.AppResolveMode) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (AppResolveMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) hash ^= AppResolveMode.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.AppResolveMode != global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode.SingleInstance) {\n        AppResolveMode = other.AppResolveMode;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Interop.Apps.Internal.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ResolveAppResponse : pb::IMessage<ResolveAppResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppResponse> _parser = new pb::MessageParser<ResolveAppResponse>(() => new ResolveAppResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse(ResolveAppResponse other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appConnectionId_ = other.appConnectionId_ != null ? other.appConnectionId_.Clone() : null;\n      isNewInstanceLaunched_ = other.isNewInstanceLaunched_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse Clone() {\n      return new ResolveAppResponse(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_connection_id\" field.</summary>\n    public const int AppConnectionIdFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appConnectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppConnectionId {\n      get { return appConnectionId_; }\n      set {\n        appConnectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"is_new_instance_launched\" field.</summary>\n    public const int IsNewInstanceLaunchedFieldNumber = 3;\n    private bool isNewInstanceLaunched_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool IsNewInstanceLaunched {\n      get { return isNewInstanceLaunched_; }\n      set {\n        isNewInstanceLaunched_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(AppConnectionId, other.AppConnectionId)) return false;\n      if (IsNewInstanceLaunched != other.IsNewInstanceLaunched) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (appConnectionId_ != null) hash ^= AppConnectionId.GetHashCode();\n      if (IsNewInstanceLaunched != false) hash ^= IsNewInstanceLaunched.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        size += 1 + 1;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.appConnectionId_ != null) {\n        if (appConnectionId_ == null) {\n          AppConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppConnectionId.MergeFrom(other.AppConnectionId);\n      }\n      if (other.IsNewInstanceLaunched != false) {\n        IsNewInstanceLaunched = other.IsNewInstanceLaunched;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppLifecycleEvent : pb::IMessage<AppLifecycleEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLifecycleEvent> _parser = new pb::MessageParser<AppLifecycleEvent>(() => new AppLifecycleEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLifecycleEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent(AppLifecycleEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          Connected = other.Connected.Clone();\n          break;\n        case EventOneofCase.Disconnected:\n          Disconnected = other.Disconnected.Clone();\n          break;\n        case EventOneofCase.Error:\n          Error = other.Error.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent Clone() {\n      return new AppLifecycleEvent(this);\n    }\n\n    /// <summary>Field number for the \"connected\" field.</summary>\n    public const int ConnectedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent Connected {\n      get { return eventCase_ == EventOneofCase.Connected ? (global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Connected;\n      }\n    }\n\n    /// <summary>Field number for the \"disconnected\" field.</summary>\n    public const int DisconnectedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent Disconnected {\n      get { return eventCase_ == EventOneofCase.Disconnected ? (global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Disconnected;\n      }\n    }\n\n    /// <summary>Field number for the \"error\" field.</summary>\n    public const int ErrorFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent Error {\n      get { return eventCase_ == EventOneofCase.Error ? (global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Error;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      Connected = 1,\n      Disconnected = 2,\n      Error = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLifecycleEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLifecycleEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Connected, other.Connected)) return false;\n      if (!object.Equals(Disconnected, other.Disconnected)) return false;\n      if (!object.Equals(Error, other.Error)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.Connected) hash ^= Connected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Disconnected) hash ^= Disconnected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Error) hash ^= Error.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.Connected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Error);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLifecycleEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          if (Connected == null) {\n            Connected = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent();\n          }\n          Connected.MergeFrom(other.Connected);\n          break;\n        case EventOneofCase.Disconnected:\n          if (Disconnected == null) {\n            Disconnected = new global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent();\n          }\n          Disconnected.MergeFrom(other.Disconnected);\n          break;\n        case EventOneofCase.Error:\n          if (Error == null) {\n            Error = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent();\n          }\n          Error.MergeFrom(other.Error);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationEvent : pb::IMessage<InvocationEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationEvent> _parser = new pb::MessageParser<InvocationEvent>(() => new InvocationEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent(InvocationEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          InvocationStarted = other.InvocationStarted.Clone();\n          break;\n        case EventOneofCase.InvocationFinished:\n          InvocationFinished = other.InvocationFinished.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent Clone() {\n      return new InvocationEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_started\" field.</summary>\n    public const int InvocationStartedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent InvocationStarted {\n      get { return eventCase_ == EventOneofCase.InvocationStarted ? (global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationStarted;\n      }\n    }\n\n    /// <summary>Field number for the \"invocation_finished\" field.</summary>\n    public const int InvocationFinishedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent InvocationFinished {\n      get { return eventCase_ == EventOneofCase.InvocationFinished ? (global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationFinished;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      InvocationStarted = 1,\n      InvocationFinished = 2,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationStarted, other.InvocationStarted)) return false;\n      if (!object.Equals(InvocationFinished, other.InvocationFinished)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.InvocationStarted) hash ^= InvocationStarted.GetHashCode();\n      if (eventCase_ == EventOneofCase.InvocationFinished) hash ^= InvocationFinished.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          if (InvocationStarted == null) {\n            InvocationStarted = new global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent();\n          }\n          InvocationStarted.MergeFrom(other.InvocationStarted);\n          break;\n        case EventOneofCase.InvocationFinished:\n          if (InvocationFinished == null) {\n            InvocationFinished = new global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent();\n          }\n          InvocationFinished.MergeFrom(other.InvocationFinished);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppConnectedEvent : pb::IMessage<AppConnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectedEvent> _parser = new pb::MessageParser<AppConnectedEvent>(() => new AppConnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent(AppConnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent Clone() {\n      return new AppConnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppDisconnectedEvent : pb::IMessage<AppDisconnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppDisconnectedEvent> _parser = new pb::MessageParser<AppDisconnectedEvent>(() => new AppDisconnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppDisconnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent(AppDisconnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent Clone() {\n      return new AppDisconnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppDisconnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppDisconnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppDisconnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppConnectionErrorEvent : pb::IMessage<AppConnectionErrorEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionErrorEvent> _parser = new pb::MessageParser<AppConnectionErrorEvent>(() => new AppConnectionErrorEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionErrorEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent(AppConnectionErrorEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent Clone() {\n      return new AppConnectionErrorEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionErrorEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionErrorEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionErrorEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationStartedEvent : pb::IMessage<InvocationStartedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationStartedEvent> _parser = new pb::MessageParser<InvocationStartedEvent>(() => new InvocationStartedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationStartedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent(InvocationStartedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent Clone() {\n      return new InvocationStartedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationStartedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationStartedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationStartedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationFinishedEvent : pb::IMessage<InvocationFinishedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationFinishedEvent> _parser = new pb::MessageParser<InvocationFinishedEvent>(() => new InvocationFinishedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationFinishedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent(InvocationFinishedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      result_ = other.result_;\n      durationMs_ = other.durationMs_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent Clone() {\n      return new InvocationFinishedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"result\" field.</summary>\n    public const int ResultFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.InvocationResult result_ = global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationResult Result {\n      get { return result_; }\n      set {\n        result_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"duration_ms\" field.</summary>\n    public const int DurationMsFieldNumber = 3;\n    private long durationMs_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public long DurationMs {\n      get { return durationMs_; }\n      set {\n        durationMs_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationFinishedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationFinishedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      if (Result != other.Result) return false;\n      if (DurationMs != other.DurationMs) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (Result != global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded) hash ^= Result.GetHashCode();\n      if (DurationMs != 0L) hash ^= DurationMs.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result);\n      }\n      if (DurationMs != 0L) {\n        size += 1 + pb::CodedOutputStream.ComputeInt64Size(DurationMs);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationFinishedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      if (other.Result != global::Plexus.Interop.Apps.Internal.Generated.InvocationResult.Succeeded) {\n        Result = other.Result;\n      }\n      if (other.DurationMs != 0L) {\n        DurationMs = other.DurationMs;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Interop.Apps.Internal.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Interop.Apps.Internal.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsRequest : pb::IMessage<GetConnectionsRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsRequest> _parser = new pb::MessageParser<GetConnectionsRequest>(() => new GetConnectionsRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest(GetConnectionsRequest other) : this() {\n      applicationId_ = other.applicationId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest Clone() {\n      return new GetConnectionsRequest(this);\n    }\n\n    /// <summary>Field number for the \"application_id\" field.</summary>\n    public const int ApplicationIdFieldNumber = 1;\n    private string applicationId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ApplicationId {\n      get { return applicationId_; }\n      set {\n        applicationId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ApplicationId != other.ApplicationId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ApplicationId.Length != 0) hash ^= ApplicationId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ApplicationId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ApplicationId.Length != 0) {\n        ApplicationId = other.ApplicationId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsResponse : pb::IMessage<GetConnectionsResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsResponse> _parser = new pb::MessageParser<GetConnectionsResponse>(() => new GetConnectionsResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse(GetConnectionsResponse other) : this() {\n      connections_ = other.connections_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse Clone() {\n      return new GetConnectionsResponse(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsResponse other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class GetConnectionsEvent : pb::IMessage<GetConnectionsEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsEvent> _parser = new pb::MessageParser<GetConnectionsEvent>(() => new GetConnectionsEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[11]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent(GetConnectionsEvent other) : this() {\n      connections_ = other.connections_.Clone();\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          NewConnection = other.NewConnection.Clone();\n          break;\n        case EventOneofCase.ClosedConnection:\n          ClosedConnection = other.ClosedConnection.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent Clone() {\n      return new GetConnectionsEvent(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    /// <summary>Field number for the \"new_connection\" field.</summary>\n    public const int NewConnectionFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor NewConnection {\n      get { return eventCase_ == EventOneofCase.NewConnection ? (global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.NewConnection;\n      }\n    }\n\n    /// <summary>Field number for the \"closed_connection\" field.</summary>\n    public const int ClosedConnectionFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor ClosedConnection {\n      get { return eventCase_ == EventOneofCase.ClosedConnection ? (global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.ClosedConnection;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      NewConnection = 2,\n      ClosedConnection = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      if (!object.Equals(NewConnection, other.NewConnection)) return false;\n      if (!object.Equals(ClosedConnection, other.ClosedConnection)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (eventCase_ == EventOneofCase.NewConnection) hash ^= NewConnection.GetHashCode();\n      if (eventCase_ == EventOneofCase.ClosedConnection) hash ^= ClosedConnection.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsEvent other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          if (NewConnection == null) {\n            NewConnection = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n          }\n          NewConnection.MergeFrom(other.NewConnection);\n          break;\n        case EventOneofCase.ClosedConnection:\n          if (ClosedConnection == null) {\n            ClosedConnection = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n          }\n          ClosedConnection.MergeFrom(other.ClosedConnection);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppLifecycleService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class AppLifecycleService {\n\t\t\n\t\tpublic const string Id = \"interop.AppLifecycleService\";\t\t\t\n\t\tpublic const string ResolveAppMethodId = \"ResolveApp\";\n\t\tpublic const string GetLifecycleEventStreamMethodId = \"GetLifecycleEventStream\";\n\t\tpublic const string GetInvocationEventStreamMethodId = \"GetInvocationEventStream\";\n\t\tpublic const string GetConnectionsMethodId = \"GetConnections\";\n\t\tpublic const string GetConnectionsStreamMethodId = \"GetConnectionsStream\";\n\t\t\n\t\tpublic static readonly AppLifecycleService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppLifecycleService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppLifecycleService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IResolveAppProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> GetConnectionsStream(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IResolveAppImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamImpl {\n\t\t\tTask GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamImpl {\n\t\t\tTask GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamImpl {\n\t\t\tTask GetConnectionsStream(global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse> ResolveAppMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent> GetLifecycleEventStreamMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent> GetInvocationEventStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse> GetConnectionsMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent> GetConnectionsStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse>(Id, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent>(Id, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent>(Id, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse>(Id, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent>(Id, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.ResolveAppRequest, global::Plexus.Interop.Apps.Internal.Generated.ResolveAppResponse>(Id, alias, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLifecycleEvent>(Id, alias, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.InvocationEvent>(Id, alias, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsResponse>(Id, alias, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsRequest, global::Plexus.Interop.Apps.Internal.Generated.GetConnectionsEvent>(Id, alias, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppMetadataService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_metadata_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_metadata_service.proto</summary>\n  internal static partial class AppMetadataServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_metadata_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppMetadataServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiJpbnRlcm9wL2FwcF9tZXRhZGF0YV9zZXJ2aWNlLnByb3RvEgdpbnRlcm9w\",\n            \"GhdpbnRlcm9wL3VuaXF1ZV9pZC5wcm90bxodaW50ZXJvcC9hcHBfbGF1bmNo\",\n            \"X21vZGUucHJvdG8aJ2ludGVyb3AvYXBwX2Nvbm5lY3Rpb25fZGVzY3JpcHRv\",\n            \"ci5wcm90bxojaW50ZXJvcC9pbnZvY2F0aW9uX2Rlc2NyaXB0b3IucHJvdG8a\",\n            \"G2dvb2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90bxoVaW50ZXJvcC9vcHRpb25z\",\n            \"LnByb3RvImYKF0FwcE1ldGFkYXRhQ2hhbmdlZEV2ZW50EiYKBGFwcHMYASAD\",\n            \"KAsyGC5pbnRlcm9wLkFwcE1ldGFkYXRhSW5mbzojktsEH2ludGVyb3AuQXBw\",\n            \"TWV0YWRhdGFDaGFuZ2VkRXZlbnQimAEKD0FwcE1ldGFkYXRhSW5mbxIKCgJp\",\n            \"ZBgBIAEoCRIUCgxkaXNwbGF5X25hbWUYAiABKAkSEwoLbGF1bmNoZXJfaWQY\",\n            \"AyABKAkSMQoPbGF1bmNoZXJfcGFyYW1zGAQgAygLMhguaW50ZXJvcC5PcHRp\",\n            \"b25QYXJhbWV0ZXI6G5LbBBdpbnRlcm9wLkFwcE1ldGFkYXRhSW5mbyKPAQoV\",\n            \"TWV0YW1vZGVsQ2hhbmdlZEV2ZW50Ei8KDGFwcGxpY2F0aW9ucxgBIAMoCzIZ\",\n            \"LmludGVyb3AuQXBwTWV0YW1vZGVsSW5mbxIiCghzZXJ2aWNlcxgCIAMoCzIQ\",\n            \"LmludGVyb3AuU2VydmljZTohktsEHWludGVyb3AuTWV0YW1vZGVsQ2hhbmdl\",\n            \"ZEV2ZW50IqYBChBBcHBNZXRhbW9kZWxJbmZvEgoKAmlkGAEgASgJEjMKEWNv\",\n            \"bnN1bWVkX3NlcnZpY2VzGAIgAygLMhguaW50ZXJvcC5Db25zdW1lZFNlcnZp\",\n            \"Y2USMwoRcHJvdmlkZWRfc2VydmljZXMYAyADKAsyGC5pbnRlcm9wLlByb3Zp\",\n            \"ZGVkU2VydmljZTocktsEGGludGVyb3AuQXBwTWV0YW1vZGVsSW5mbyJ7Cg9Q\",\n            \"cm92aWRlZFNlcnZpY2USEgoKc2VydmljZV9pZBgBIAEoCRINCgVhbGlhcxgC\",\n            \"IAEoCRIoCgdtZXRob2RzGAMgAygLMhcuaW50ZXJvcC5Qcm92aWRlZE1ldGhv\",\n            \"ZDobktsEF2ludGVyb3AuUHJvdmlkZWRTZXJ2aWNlInsKD0NvbnN1bWVkU2Vy\",\n            \"dmljZRISCgpzZXJ2aWNlX2lkGAEgASgJEg0KBWFsaWFzGAIgASgJEigKB21l\",\n            \"dGhvZHMYAyADKAsyFy5pbnRlcm9wLkNvbnN1bWVkTWV0aG9kOhuS2wQXaW50\",\n            \"ZXJvcC5Db25zdW1lZFNlcnZpY2UiOgoOQ29uc3VtZWRNZXRob2QSDAoEbmFt\",\n            \"ZRgBIAEoCToaktsEFmludGVyb3AuQ29uc3VtZWRNZXRob2QikgIKDlByb3Zp\",\n            \"ZGVkTWV0aG9kEgwKBG5hbWUYASABKAkSDQoFdGl0bGUYAiABKAkSQAoLbGF1\",\n            \"bmNoX21vZGUYAyABKA4yKy5pbnRlcm9wLlByb3ZpZGVkTWV0aG9kLk1ldGFt\",\n            \"b2RlbExhdW5jaE1vZGUSEgoKdGltZW91dF9tcxgEIAEoBRIpCgdvcHRpb25z\",\n            \"GAUgAygLMhguaW50ZXJvcC5PcHRpb25QYXJhbWV0ZXIiRgoTTWV0YW1vZGVs\",\n            \"TGF1bmNoTW9kZRIICgROb25lEAASEgoOU2luZ2xlSW5zdGFuY2UQARIRCg1N\",\n            \"dWx0aUluc3RhbmNlEAI6GpLbBBZpbnRlcm9wLlByb3ZpZGVkTWV0aG9kInsK\",\n            \"B1NlcnZpY2USCgoCaWQYASABKAkSJAoHbWV0aG9kcxgCIAMoCzITLmludGVy\",\n            \"b3AuTWV0aG9kSW5mbxIpCgdvcHRpb25zGAMgAygLMhguaW50ZXJvcC5PcHRp\",\n            \"b25QYXJhbWV0ZXI6E5LbBA9pbnRlcm9wLlNlcnZpY2Ui8QEKCk1ldGhvZElu\",\n            \"Zm8SDAoEbmFtZRgBIAEoCRIaChJyZXF1ZXN0X21lc3NhZ2VfaWQYAyABKAkS\",\n            \"GwoTcmVzcG9uc2VfbWVzc2FnZV9pZBgEIAEoCRIsCgR0eXBlGAUgASgOMh4u\",\n            \"aW50ZXJvcC5NZXRob2RJbmZvLk1ldGhvZFR5cGUiVgoKTWV0aG9kVHlwZRIJ\",\n            \"CgVVbmFyeRAAEhMKD1NlcnZlclN0cmVhbWluZxABEhMKD0NsaWVudFN0cmVh\",\n            \"bWluZxACEhMKD0R1cGxleFN0cmVhbWluZxADOhaS2wQSaW50ZXJvcC5NZXRo\",\n            \"b2RJbmZvIkoKD09wdGlvblBhcmFtZXRlchILCgNrZXkYASABKAkSDQoFdmFs\",\n            \"dWUYAiABKAk6G5LbBBdpbnRlcm9wLk9wdGlvblBhcmFtZXRlcjLwAQoSQXBw\",\n            \"TWV0YWRhdGFTZXJ2aWNlEl4KIEdldEFwcE1ldGFkYXRhQ2hhbmdlZEV2ZW50\",\n            \"U3RyZWFtEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GiAuaW50ZXJvcC5BcHBN\",\n            \"ZXRhZGF0YUNoYW5nZWRFdmVudDABEloKHkdldE1ldGFtb2RlbENoYW5nZWRF\",\n            \"dmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoeLmludGVyb3Au\",\n            \"TWV0YW1vZGVsQ2hhbmdlZEV2ZW50MAEaHpLbBBppbnRlcm9wLkFwcE1ldGFk\",\n            \"YXRhU2VydmljZUIpqgImUGxleHVzLkludGVyb3AuQXBwcy5JbnRlcm5hbC5H\",\n            \"ZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent), global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent.Parser, new[]{ \"Apps\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo), global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo.Parser, new[]{ \"Id\", \"DisplayName\", \"LauncherId\", \"LauncherParams\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent), global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent.Parser, new[]{ \"Applications\", \"Services\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo), global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo.Parser, new[]{ \"Id\", \"ConsumedServices\", \"ProvidedServices\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ProvidedService), global::Plexus.Interop.Apps.Internal.Generated.ProvidedService.Parser, new[]{ \"ServiceId\", \"Alias\", \"Methods\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ConsumedService), global::Plexus.Interop.Apps.Internal.Generated.ConsumedService.Parser, new[]{ \"ServiceId\", \"Alias\", \"Methods\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod), global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod.Parser, new[]{ \"Name\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod), global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Parser, new[]{ \"Name\", \"Title\", \"LaunchMode\", \"TimeoutMs\", \"Options\" }, null, new[]{ typeof(global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode) }, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.Service), global::Plexus.Interop.Apps.Internal.Generated.Service.Parser, new[]{ \"Id\", \"Methods\", \"Options\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.MethodInfo), global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Parser, new[]{ \"Name\", \"RequestMessageId\", \"ResponseMessageId\", \"Type\" }, null, new[]{ typeof(global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType) }, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.OptionParameter), global::Plexus.Interop.Apps.Internal.Generated.OptionParameter.Parser, new[]{ \"Key\", \"Value\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class AppMetadataChangedEvent : pb::IMessage<AppMetadataChangedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetadataChangedEvent> _parser = new pb::MessageParser<AppMetadataChangedEvent>(() => new AppMetadataChangedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetadataChangedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent(AppMetadataChangedEvent other) : this() {\n      apps_ = other.apps_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent Clone() {\n      return new AppMetadataChangedEvent(this);\n    }\n\n    /// <summary>Field number for the \"apps\" field.</summary>\n    public const int AppsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo> _repeated_apps_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo> apps_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataInfo> Apps {\n      get { return apps_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetadataChangedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetadataChangedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!apps_.Equals(other.apps_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= apps_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      apps_.WriteTo(output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      apps_.WriteTo(ref output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += apps_.CalculateSize(_repeated_apps_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetadataChangedEvent other) {\n      if (other == null) {\n        return;\n      }\n      apps_.Add(other.apps_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(ref input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppMetadataInfo : pb::IMessage<AppMetadataInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetadataInfo> _parser = new pb::MessageParser<AppMetadataInfo>(() => new AppMetadataInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetadataInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo(AppMetadataInfo other) : this() {\n      id_ = other.id_;\n      displayName_ = other.displayName_;\n      launcherId_ = other.launcherId_;\n      launcherParams_ = other.launcherParams_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo Clone() {\n      return new AppMetadataInfo(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"display_name\" field.</summary>\n    public const int DisplayNameFieldNumber = 2;\n    private string displayName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string DisplayName {\n      get { return displayName_; }\n      set {\n        displayName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launcher_id\" field.</summary>\n    public const int LauncherIdFieldNumber = 3;\n    private string launcherId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string LauncherId {\n      get { return launcherId_; }\n      set {\n        launcherId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launcher_params\" field.</summary>\n    public const int LauncherParamsFieldNumber = 4;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> _repeated_launcherParams_codec\n        = pb::FieldCodec.ForMessage(34, global::Plexus.Interop.Apps.Internal.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> launcherParams_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> LauncherParams {\n      get { return launcherParams_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetadataInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetadataInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if (DisplayName != other.DisplayName) return false;\n      if (LauncherId != other.LauncherId) return false;\n      if(!launcherParams_.Equals(other.launcherParams_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      if (DisplayName.Length != 0) hash ^= DisplayName.GetHashCode();\n      if (LauncherId.Length != 0) hash ^= LauncherId.GetHashCode();\n      hash ^= launcherParams_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (DisplayName.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(LauncherId);\n      }\n      launcherParams_.WriteTo(output, _repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (DisplayName.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(LauncherId);\n      }\n      launcherParams_.WriteTo(ref output, _repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      if (DisplayName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(LauncherId);\n      }\n      size += launcherParams_.CalculateSize(_repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetadataInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      if (other.DisplayName.Length != 0) {\n        DisplayName = other.DisplayName;\n      }\n      if (other.LauncherId.Length != 0) {\n        LauncherId = other.LauncherId;\n      }\n      launcherParams_.Add(other.launcherParams_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            DisplayName = input.ReadString();\n            break;\n          }\n          case 26: {\n            LauncherId = input.ReadString();\n            break;\n          }\n          case 34: {\n            launcherParams_.AddEntriesFrom(input, _repeated_launcherParams_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            DisplayName = input.ReadString();\n            break;\n          }\n          case 26: {\n            LauncherId = input.ReadString();\n            break;\n          }\n          case 34: {\n            launcherParams_.AddEntriesFrom(ref input, _repeated_launcherParams_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class MetamodelChangedEvent : pb::IMessage<MetamodelChangedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<MetamodelChangedEvent> _parser = new pb::MessageParser<MetamodelChangedEvent>(() => new MetamodelChangedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<MetamodelChangedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent(MetamodelChangedEvent other) : this() {\n      applications_ = other.applications_.Clone();\n      services_ = other.services_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent Clone() {\n      return new MetamodelChangedEvent(this);\n    }\n\n    /// <summary>Field number for the \"applications\" field.</summary>\n    public const int ApplicationsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo> _repeated_applications_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo> applications_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo> Applications {\n      get { return applications_; }\n    }\n\n    /// <summary>Field number for the \"services\" field.</summary>\n    public const int ServicesFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.Service> _repeated_services_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Apps.Internal.Generated.Service.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Service> services_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Service>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Service> Services {\n      get { return services_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as MetamodelChangedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(MetamodelChangedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!applications_.Equals(other.applications_)) return false;\n      if(!services_.Equals(other.services_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= applications_.GetHashCode();\n      hash ^= services_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      applications_.WriteTo(output, _repeated_applications_codec);\n      services_.WriteTo(output, _repeated_services_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      applications_.WriteTo(ref output, _repeated_applications_codec);\n      services_.WriteTo(ref output, _repeated_services_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += applications_.CalculateSize(_repeated_applications_codec);\n      size += services_.CalculateSize(_repeated_services_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(MetamodelChangedEvent other) {\n      if (other == null) {\n        return;\n      }\n      applications_.Add(other.applications_);\n      services_.Add(other.services_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            applications_.AddEntriesFrom(input, _repeated_applications_codec);\n            break;\n          }\n          case 18: {\n            services_.AddEntriesFrom(input, _repeated_services_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            applications_.AddEntriesFrom(ref input, _repeated_applications_codec);\n            break;\n          }\n          case 18: {\n            services_.AddEntriesFrom(ref input, _repeated_services_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppMetamodelInfo : pb::IMessage<AppMetamodelInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetamodelInfo> _parser = new pb::MessageParser<AppMetamodelInfo>(() => new AppMetamodelInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetamodelInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo(AppMetamodelInfo other) : this() {\n      id_ = other.id_;\n      consumedServices_ = other.consumedServices_.Clone();\n      providedServices_ = other.providedServices_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo Clone() {\n      return new AppMetamodelInfo(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"consumed_services\" field.</summary>\n    public const int ConsumedServicesFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.ConsumedService> _repeated_consumedServices_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Apps.Internal.Generated.ConsumedService.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedService> consumedServices_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedService>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedService> ConsumedServices {\n      get { return consumedServices_; }\n    }\n\n    /// <summary>Field number for the \"provided_services\" field.</summary>\n    public const int ProvidedServicesFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.ProvidedService> _repeated_providedServices_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Apps.Internal.Generated.ProvidedService.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedService> providedServices_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedService>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedService> ProvidedServices {\n      get { return providedServices_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetamodelInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetamodelInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if(!consumedServices_.Equals(other.consumedServices_)) return false;\n      if(!providedServices_.Equals(other.providedServices_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      hash ^= consumedServices_.GetHashCode();\n      hash ^= providedServices_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      consumedServices_.WriteTo(output, _repeated_consumedServices_codec);\n      providedServices_.WriteTo(output, _repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      consumedServices_.WriteTo(ref output, _repeated_consumedServices_codec);\n      providedServices_.WriteTo(ref output, _repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      size += consumedServices_.CalculateSize(_repeated_consumedServices_codec);\n      size += providedServices_.CalculateSize(_repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetamodelInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      consumedServices_.Add(other.consumedServices_);\n      providedServices_.Add(other.providedServices_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            consumedServices_.AddEntriesFrom(input, _repeated_consumedServices_codec);\n            break;\n          }\n          case 26: {\n            providedServices_.AddEntriesFrom(input, _repeated_providedServices_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            consumedServices_.AddEntriesFrom(ref input, _repeated_consumedServices_codec);\n            break;\n          }\n          case 26: {\n            providedServices_.AddEntriesFrom(ref input, _repeated_providedServices_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ProvidedService : pb::IMessage<ProvidedService>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ProvidedService> _parser = new pb::MessageParser<ProvidedService>(() => new ProvidedService());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ProvidedService> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService(ProvidedService other) : this() {\n      serviceId_ = other.serviceId_;\n      alias_ = other.alias_;\n      methods_ = other.methods_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService Clone() {\n      return new ProvidedService(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"alias\" field.</summary>\n    public const int AliasFieldNumber = 2;\n    private string alias_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Alias {\n      get { return alias_; }\n      set {\n        alias_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod> Methods {\n      get { return methods_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ProvidedService);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ProvidedService other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (Alias != other.Alias) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (Alias.Length != 0) hash ^= Alias.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Alias);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ProvidedService other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.Alias.Length != 0) {\n        Alias = other.Alias;\n      }\n      methods_.Add(other.methods_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ConsumedService : pb::IMessage<ConsumedService>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ConsumedService> _parser = new pb::MessageParser<ConsumedService>(() => new ConsumedService());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ConsumedService> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService(ConsumedService other) : this() {\n      serviceId_ = other.serviceId_;\n      alias_ = other.alias_;\n      methods_ = other.methods_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService Clone() {\n      return new ConsumedService(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"alias\" field.</summary>\n    public const int AliasFieldNumber = 2;\n    private string alias_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Alias {\n      get { return alias_; }\n      set {\n        alias_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ConsumedMethod> Methods {\n      get { return methods_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ConsumedService);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ConsumedService other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (Alias != other.Alias) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (Alias.Length != 0) hash ^= Alias.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Alias);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ConsumedService other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.Alias.Length != 0) {\n        Alias = other.Alias;\n      }\n      methods_.Add(other.methods_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ConsumedMethod : pb::IMessage<ConsumedMethod>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ConsumedMethod> _parser = new pb::MessageParser<ConsumedMethod>(() => new ConsumedMethod());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ConsumedMethod> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod(ConsumedMethod other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod Clone() {\n      return new ConsumedMethod(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ConsumedMethod);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ConsumedMethod other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ConsumedMethod other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ProvidedMethod : pb::IMessage<ProvidedMethod>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ProvidedMethod> _parser = new pb::MessageParser<ProvidedMethod>(() => new ProvidedMethod());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ProvidedMethod> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod(ProvidedMethod other) : this() {\n      name_ = other.name_;\n      title_ = other.title_;\n      launchMode_ = other.launchMode_;\n      timeoutMs_ = other.timeoutMs_;\n      options_ = other.options_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod Clone() {\n      return new ProvidedMethod(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"title\" field.</summary>\n    public const int TitleFieldNumber = 2;\n    private string title_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Title {\n      get { return title_; }\n      set {\n        title_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_mode\" field.</summary>\n    public const int LaunchModeFieldNumber = 3;\n    private global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode launchMode_ = global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode LaunchMode {\n      get { return launchMode_; }\n      set {\n        launchMode_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"timeout_ms\" field.</summary>\n    public const int TimeoutMsFieldNumber = 4;\n    private int timeoutMs_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int TimeoutMs {\n      get { return timeoutMs_; }\n      set {\n        timeoutMs_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"options\" field.</summary>\n    public const int OptionsFieldNumber = 5;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> _repeated_options_codec\n        = pb::FieldCodec.ForMessage(42, global::Plexus.Interop.Apps.Internal.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> options_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> Options {\n      get { return options_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ProvidedMethod);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ProvidedMethod other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      if (Title != other.Title) return false;\n      if (LaunchMode != other.LaunchMode) return false;\n      if (TimeoutMs != other.TimeoutMs) return false;\n      if(!options_.Equals(other.options_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (Title.Length != 0) hash ^= Title.GetHashCode();\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) hash ^= LaunchMode.GetHashCode();\n      if (TimeoutMs != 0) hash ^= TimeoutMs.GetHashCode();\n      hash ^= options_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (Title.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        output.WriteRawTag(32);\n        output.WriteInt32(TimeoutMs);\n      }\n      options_.WriteTo(output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (Title.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        output.WriteRawTag(32);\n        output.WriteInt32(TimeoutMs);\n      }\n      options_.WriteTo(ref output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (Title.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeInt32Size(TimeoutMs);\n      }\n      size += options_.CalculateSize(_repeated_options_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ProvidedMethod other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      if (other.Title.Length != 0) {\n        Title = other.Title;\n      }\n      if (other.LaunchMode != global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        LaunchMode = other.LaunchMode;\n      }\n      if (other.TimeoutMs != 0) {\n        TimeoutMs = other.TimeoutMs;\n      }\n      options_.Add(other.options_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 18: {\n            Title = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 32: {\n            TimeoutMs = input.ReadInt32();\n            break;\n          }\n          case 42: {\n            options_.AddEntriesFrom(input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 18: {\n            Title = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Apps.Internal.Generated.ProvidedMethod.Types.MetamodelLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 32: {\n            TimeoutMs = input.ReadInt32();\n            break;\n          }\n          case 42: {\n            options_.AddEntriesFrom(ref input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n    #region Nested types\n    /// <summary>Container for nested types declared in the ProvidedMethod message type.</summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static partial class Types {\n      internal enum MetamodelLaunchMode {\n        [pbr::OriginalName(\"None\")] None = 0,\n        [pbr::OriginalName(\"SingleInstance\")] SingleInstance = 1,\n        [pbr::OriginalName(\"MultiInstance\")] MultiInstance = 2,\n      }\n\n    }\n    #endregion\n\n  }\n\n  internal sealed partial class Service : pb::IMessage<Service>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<Service> _parser = new pb::MessageParser<Service>(() => new Service());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<Service> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service(Service other) : this() {\n      id_ = other.id_;\n      methods_ = other.methods_.Clone();\n      options_ = other.options_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service Clone() {\n      return new Service(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.MethodInfo> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.MethodInfo> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.MethodInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.MethodInfo> Methods {\n      get { return methods_; }\n    }\n\n    /// <summary>Field number for the \"options\" field.</summary>\n    public const int OptionsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> _repeated_options_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Apps.Internal.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> options_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.OptionParameter> Options {\n      get { return options_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as Service);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(Service other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      if(!options_.Equals(other.options_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      hash ^= options_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      options_.WriteTo(output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      options_.WriteTo(ref output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      size += options_.CalculateSize(_repeated_options_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(Service other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      methods_.Add(other.methods_);\n      options_.Add(other.options_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n          case 26: {\n            options_.AddEntriesFrom(input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n          case 26: {\n            options_.AddEntriesFrom(ref input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class MethodInfo : pb::IMessage<MethodInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<MethodInfo> _parser = new pb::MessageParser<MethodInfo>(() => new MethodInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<MethodInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo(MethodInfo other) : this() {\n      name_ = other.name_;\n      requestMessageId_ = other.requestMessageId_;\n      responseMessageId_ = other.responseMessageId_;\n      type_ = other.type_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo Clone() {\n      return new MethodInfo(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"request_message_id\" field.</summary>\n    public const int RequestMessageIdFieldNumber = 3;\n    private string requestMessageId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string RequestMessageId {\n      get { return requestMessageId_; }\n      set {\n        requestMessageId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"response_message_id\" field.</summary>\n    public const int ResponseMessageIdFieldNumber = 4;\n    private string responseMessageId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ResponseMessageId {\n      get { return responseMessageId_; }\n      set {\n        responseMessageId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"type\" field.</summary>\n    public const int TypeFieldNumber = 5;\n    private global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType type_ = global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType Type {\n      get { return type_; }\n      set {\n        type_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as MethodInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(MethodInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      if (RequestMessageId != other.RequestMessageId) return false;\n      if (ResponseMessageId != other.ResponseMessageId) return false;\n      if (Type != other.Type) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (RequestMessageId.Length != 0) hash ^= RequestMessageId.GetHashCode();\n      if (ResponseMessageId.Length != 0) hash ^= ResponseMessageId.GetHashCode();\n      if (Type != global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary) hash ^= Type.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        output.WriteRawTag(34);\n        output.WriteString(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) Type);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        output.WriteRawTag(34);\n        output.WriteString(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) Type);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(MethodInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      if (other.RequestMessageId.Length != 0) {\n        RequestMessageId = other.RequestMessageId;\n      }\n      if (other.ResponseMessageId.Length != 0) {\n        ResponseMessageId = other.ResponseMessageId;\n      }\n      if (other.Type != global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType.Unary) {\n        Type = other.Type;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 26: {\n            RequestMessageId = input.ReadString();\n            break;\n          }\n          case 34: {\n            ResponseMessageId = input.ReadString();\n            break;\n          }\n          case 40: {\n            Type = (global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 26: {\n            RequestMessageId = input.ReadString();\n            break;\n          }\n          case 34: {\n            ResponseMessageId = input.ReadString();\n            break;\n          }\n          case 40: {\n            Type = (global::Plexus.Interop.Apps.Internal.Generated.MethodInfo.Types.MethodType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n    #region Nested types\n    /// <summary>Container for nested types declared in the MethodInfo message type.</summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static partial class Types {\n      internal enum MethodType {\n        [pbr::OriginalName(\"Unary\")] Unary = 0,\n        [pbr::OriginalName(\"ServerStreaming\")] ServerStreaming = 1,\n        [pbr::OriginalName(\"ClientStreaming\")] ClientStreaming = 2,\n        [pbr::OriginalName(\"DuplexStreaming\")] DuplexStreaming = 3,\n      }\n\n    }\n    #endregion\n\n  }\n\n  internal sealed partial class OptionParameter : pb::IMessage<OptionParameter>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<OptionParameter> _parser = new pb::MessageParser<OptionParameter>(() => new OptionParameter());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<OptionParameter> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter(OptionParameter other) : this() {\n      key_ = other.key_;\n      value_ = other.value_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter Clone() {\n      return new OptionParameter(this);\n    }\n\n    /// <summary>Field number for the \"key\" field.</summary>\n    public const int KeyFieldNumber = 1;\n    private string key_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Key {\n      get { return key_; }\n      set {\n        key_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"value\" field.</summary>\n    public const int ValueFieldNumber = 2;\n    private string value_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Value {\n      get { return value_; }\n      set {\n        value_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as OptionParameter);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(OptionParameter other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Key != other.Key) return false;\n      if (Value != other.Value) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Key.Length != 0) hash ^= Key.GetHashCode();\n      if (Value.Length != 0) hash ^= Value.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Key.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Key);\n      }\n      if (Value.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Value);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Key.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Key);\n      }\n      if (Value.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Value);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Key.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Key);\n      }\n      if (Value.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Value);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(OptionParameter other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Key.Length != 0) {\n        Key = other.Key;\n      }\n      if (other.Value.Length != 0) {\n        Value = other.Value;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Key = input.ReadString();\n            break;\n          }\n          case 18: {\n            Value = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Key = input.ReadString();\n            break;\n          }\n          case 18: {\n            Value = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppMetadataService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_metadata_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class AppMetadataService {\n\t\t\n\t\tpublic const string Id = \"interop.AppMetadataService\";\t\t\t\n\t\tpublic const string GetAppMetadataChangedEventStreamMethodId = \"GetAppMetadataChangedEventStream\";\n\t\tpublic const string GetMetamodelChangedEventStreamMethodId = \"GetMetamodelChangedEventStream\";\n\t\t\n\t\tpublic static readonly AppMetadataService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppMetadataService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppMetadataService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppMetadataService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppMetadataService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IGetAppMetadataChangedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetMetamodelChangedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAppMetadataChangedEventStreamImpl {\n\t\t\tTask GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetMetamodelChangedEventStreamImpl {\n\t\t\tTask GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent> GetAppMetadataChangedEventStreamMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent> GetMetamodelChangedEventStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tGetAppMetadataChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent>(Id, GetAppMetadataChangedEventStreamMethodId);\n\t\t\t\tGetMetamodelChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent>(Id, GetMetamodelChangedEventStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tGetAppMetadataChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataChangedEvent>(Id, alias, GetAppMetadataChangedEventStreamMethodId);\n\t\t\t\tGetMetamodelChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.MetamodelChangedEvent>(Id, alias, GetMetamodelChangedEventStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppRegistrationService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_registration_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_registration_service.proto</summary>\n  internal static partial class AppRegistrationServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_registration_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppRegistrationServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL2FwcF9yZWdpc3RyYXRpb25fc2VydmljZS5wcm90bxIHaW50\",\n            \"ZXJvcBoXaW50ZXJvcC91bmlxdWVfaWQucHJvdG8aFWludGVyb3Avb3B0aW9u\",\n            \"cy5wcm90byJAChhSZXF1ZXN0SW5zdGFuY2VJZFJlcXVlc3Q6JJLbBCBpbnRl\",\n            \"cm9wLlJlcXVlc3RJbnN0YW5jZUlkUmVxdWVzdCJuChlSZWdpc3Rlckluc3Rh\",\n            \"bmNlSWRSZXF1ZXN0EioKD2FwcF9pbnN0YW5jZV9pZBgBIAEoCzIRLmludGVy\",\n            \"b3AuVW5pcXVlSWQ6JZLbBCFpbnRlcm9wLlJlZ2lzdGVySW5zdGFuY2VJZFJl\",\n            \"cXVlc3QiRAoaUmVnaXN0ZXJJbnN0YW5jZUlkUmVzcG9uc2U6JpLbBCJpbnRl\",\n            \"cm9wLlJlZ2lzdGVySW5zdGFuY2VJZFJlc3BvbnNlMuYBChZBcHBSZWdpc3Ry\",\n            \"YXRpb25TZXJ2aWNlEkkKEVJlcXVlc3RJbnN0YW5jZUlkEiEuaW50ZXJvcC5S\",\n            \"ZXF1ZXN0SW5zdGFuY2VJZFJlcXVlc3QaES5pbnRlcm9wLlVuaXF1ZUlkEl0K\",\n            \"ElJlZ2lzdGVySW5zdGFuY2VJZBIiLmludGVyb3AuUmVnaXN0ZXJJbnN0YW5j\",\n            \"ZUlkUmVxdWVzdBojLmludGVyb3AuUmVnaXN0ZXJJbnN0YW5jZUlkUmVzcG9u\",\n            \"c2UaIpLbBB5pbnRlcm9wLkFwcFJlZ2lzdHJhdGlvblNlcnZpY2VCKaoCJlBs\",\n            \"ZXh1cy5JbnRlcm9wLkFwcHMuSW50ZXJuYWwuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest), global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest.Parser, null, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest), global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest.Parser, new[]{ \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse), global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse.Parser, null, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class RequestInstanceIdRequest : pb::IMessage<RequestInstanceIdRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RequestInstanceIdRequest> _parser = new pb::MessageParser<RequestInstanceIdRequest>(() => new RequestInstanceIdRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RequestInstanceIdRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest(RequestInstanceIdRequest other) : this() {\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest Clone() {\n      return new RequestInstanceIdRequest(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RequestInstanceIdRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RequestInstanceIdRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RequestInstanceIdRequest other) {\n      if (other == null) {\n        return;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class RegisterInstanceIdRequest : pb::IMessage<RegisterInstanceIdRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RegisterInstanceIdRequest> _parser = new pb::MessageParser<RegisterInstanceIdRequest>(() => new RegisterInstanceIdRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RegisterInstanceIdRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest(RegisterInstanceIdRequest other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest Clone() {\n      return new RegisterInstanceIdRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RegisterInstanceIdRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RegisterInstanceIdRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RegisterInstanceIdRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class RegisterInstanceIdResponse : pb::IMessage<RegisterInstanceIdResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RegisterInstanceIdResponse> _parser = new pb::MessageParser<RegisterInstanceIdResponse>(() => new RegisterInstanceIdResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RegisterInstanceIdResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse(RegisterInstanceIdResponse other) : this() {\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse Clone() {\n      return new RegisterInstanceIdResponse(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RegisterInstanceIdResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RegisterInstanceIdResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RegisterInstanceIdResponse other) {\n      if (other == null) {\n        return;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/AppRegistrationService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_registration_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class AppRegistrationService {\n\t\t\n\t\tpublic const string Id = \"interop.AppRegistrationService\";\t\t\t\n\t\tpublic const string RequestInstanceIdMethodId = \"RequestInstanceId\";\n\t\tpublic const string RegisterInstanceIdMethodId = \"RegisterInstanceId\";\n\t\t\n\t\tpublic static readonly AppRegistrationService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppRegistrationService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppRegistrationService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppRegistrationService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppRegistrationService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IRequestInstanceIdProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRegisterInstanceIdProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRequestInstanceIdImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IRegisterInstanceIdImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId> RequestInstanceIdMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse> RegisterInstanceIdMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tRequestInstanceIdMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId>(Id, RequestInstanceIdMethodId);\n\t\t\t\tRegisterInstanceIdMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse>(Id, RegisterInstanceIdMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tRequestInstanceIdMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.UniqueId>(Id, alias, RequestInstanceIdMethodId);\n\t\t\t\tRegisterInstanceIdMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Apps.Internal.Generated.RegisterInstanceIdResponse>(Id, alias, RegisterInstanceIdMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/ContextLinkage.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/context_linkage.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/context_linkage.proto</summary>\n  internal static partial class ContextLinkageReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/context_linkage.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static ContextLinkageReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch1pbnRlcm9wL2NvbnRleHRfbGlua2FnZS5wcm90bxIHaW50ZXJvcBobZ29v\",\n            \"Z2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGhdpbnRlcm9wL3VuaXF1ZV9pZC5w\",\n            \"cm90bxonaW50ZXJvcC9hcHBfY29ubmVjdGlvbl9kZXNjcmlwdG9yLnByb3Rv\",\n            \"GiJpbnRlcm9wL2FwcF9tZXRhZGF0YV9zZXJ2aWNlLnByb3RvGhVpbnRlcm9w\",\n            \"L29wdGlvbnMucHJvdG8iRQoHQ29udGV4dBIKCgJpZBgBIAEoCRILCgNvd24Y\",\n            \"AiABKAgSDAoEa2luZBgDIAEoCToTktsED2ludGVyb3AuQ29udGV4dCJMCgxD\",\n            \"b250ZXh0c0xpc3QSIgoIY29udGV4dHMYASADKAsyEC5pbnRlcm9wLkNvbnRl\",\n            \"eHQ6GJLbBBRpbnRlcm9wLkNvbnRleHRzTGlzdCJGChRDcmVhdGVDb250ZXh0\",\n            \"UmVxdWVzdBIMCgRraW5kGAEgASgJOiCS2wQcaW50ZXJvcC5DcmVhdGVDb250\",\n            \"ZXh0UmVxdWVzdCLrAQoUQ29udGV4dExvYWRpbmdVcGRhdGUSLQoGc3RhdHVz\",\n            \"GAEgASgOMh0uaW50ZXJvcC5Db250ZXh0TG9hZGluZ1N0YXR1cxJAChZsb2Fk\",\n            \"ZWRfYXBwX2Rlc2NyaXB0b3JzGAIgAygLMiAuaW50ZXJvcC5BcHBDb25uZWN0\",\n            \"aW9uRGVzY3JpcHRvchJAChZmYWlsZWRfYXBwX2Rlc2NyaXB0b3JzGAMgAygL\",\n            \"MiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcjogktsEHGludGVy\",\n            \"b3AuQ29udGV4dExvYWRpbmdVcGRhdGUiiQEKDUludm9jYXRpb25SZWYSKwoI\",\n            \"YXBwX2luZm8YASABKAsyGS5pbnRlcm9wLkFwcE1ldGFtb2RlbEluZm8SMAoG\",\n            \"dGFyZ2V0GAIgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRv\",\n            \"cjoZktsEFWludGVyb3AuSW52b2NhdGlvblJlZiJbCg9JbnZvY2F0aW9uc0xp\",\n            \"c3QSKwoLaW52b2NhdGlvbnMYASADKAsyFi5pbnRlcm9wLkludm9jYXRpb25S\",\n            \"ZWY6G5LbBBdpbnRlcm9wLkludm9jYXRpb25zTGlzdCKKAQoUQ29udGV4dFRv\",\n            \"SW52b2NhdGlvbnMSIQoHY29udGV4dBgBIAEoCzIQLmludGVyb3AuQ29udGV4\",\n            \"dBItCgtpbnZvY2F0aW9ucxgCIAEoCzIYLmludGVyb3AuSW52b2NhdGlvbnNM\",\n            \"aXN0OiCS2wQcaW50ZXJvcC5Db250ZXh0VG9JbnZvY2F0aW9ucyJxChhDb250\",\n            \"ZXh0VG9JbnZvY2F0aW9uc0xpc3QSLwoIY29udGV4dHMYASADKAsyHS5pbnRl\",\n            \"cm9wLkNvbnRleHRUb0ludm9jYXRpb25zOiSS2wQgaW50ZXJvcC5Db250ZXh0\",\n            \"VG9JbnZvY2F0aW9uc0xpc3QiiQEKFUFwcEpvaW5lZENvbnRleHRFdmVudBIh\",\n            \"Cgdjb250ZXh0GAEgASgLMhAuaW50ZXJvcC5Db250ZXh0EioKD2FwcF9pbnN0\",\n            \"YW5jZV9pZBgCIAEoCzIRLmludGVyb3AuVW5pcXVlSWQ6IZLbBB1pbnRlcm9w\",\n            \"LkFwcEpvaW5lZENvbnRleHRFdmVudCJ3Ch1SZXN0b3JlQ29udGV4dHNMaW5r\",\n            \"YWdlUmVxdWVzdBIrCgRhcHBzGAEgAygLMh0uaW50ZXJvcC5SZXN0b3JpbmdB\",\n            \"cHBJbnN0YW5jZTopktsEJWludGVyb3AuUmVzdG9yZUNvbnRleHRzTGlua2Fn\",\n            \"ZVJlcXVlc3QisgEKFFJlc3RvcmluZ0FwcEluc3RhbmNlEioKD2FwcF9pbnN0\",\n            \"YW5jZV9pZBgBIAEoCzIRLmludGVyb3AuVW5pcXVlSWQSDwoHYXBwX2lkcxgC\",\n            \"IAMoCRIXCgtjb250ZXh0X2lkcxgDIAMoCUICGAESIgoIY29udGV4dHMYBCAD\",\n            \"KAsyEC5pbnRlcm9wLkNvbnRleHQ6IJLbBBxpbnRlcm9wLlJlc3RvcmluZ0Fw\",\n            \"cEluc3RhbmNlIvgBCh5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2US\",\n            \"XQoUY3JlYXRlZF9jb250ZXh0c19tYXAYASADKAsyPy5pbnRlcm9wLlJlc3Rv\",\n            \"cmVDb250ZXh0c0xpbmthZ2VSZXNwb25zZS5DcmVhdGVkQ29udGV4dHNNYXBF\",\n            \"bnRyeRpLChdDcmVhdGVkQ29udGV4dHNNYXBFbnRyeRILCgNrZXkYASABKAkS\",\n            \"HwoFdmFsdWUYAiABKAsyEC5pbnRlcm9wLkNvbnRleHQ6AjgBOiqS2wQmaW50\",\n            \"ZXJvcC5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2UqQQoUQ29udGV4\",\n            \"dExvYWRpbmdTdGF0dXMSDwoLSU5fUFJPR1JFU1MQABIKCgZGQUlMRUQQARIM\",\n            \"CghGSU5JU0hFRBACMtcFChVDb250ZXh0TGlua2FnZVNlcnZpY2USSAoTQ29u\",\n            \"dGV4dExvYWRlZFN0cmVhbRIQLmludGVyb3AuQ29udGV4dBodLmludGVyb3Au\",\n            \"Q29udGV4dExvYWRpbmdVcGRhdGUwARI+Cg1DcmVhdGVDb250ZXh0EhYuZ29v\",\n            \"Z2xlLnByb3RvYnVmLkVtcHR5GhAuaW50ZXJvcC5Db250ZXh0IgOIAgESQQoO\",\n            \"Q3JlYXRlQ29udGV4dDISHS5pbnRlcm9wLkNyZWF0ZUNvbnRleHRSZXF1ZXN0\",\n            \"GhAuaW50ZXJvcC5Db250ZXh0EjcKC0pvaW5Db250ZXh0EhAuaW50ZXJvcC5D\",\n            \"b250ZXh0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5EjwKC0dldENvbnRleHRz\",\n            \"EhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhUuaW50ZXJvcC5Db250ZXh0c0xp\",\n            \"c3QSQgoUR2V0TGlua2VkSW52b2NhdGlvbnMSEC5pbnRlcm9wLkNvbnRleHQa\",\n            \"GC5pbnRlcm9wLkludm9jYXRpb25zTGlzdBJUChdHZXRBbGxMaW5rZWRJbnZv\",\n            \"Y2F0aW9ucxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRohLmludGVyb3AuQ29u\",\n            \"dGV4dFRvSW52b2NhdGlvbnNMaXN0ElIKFkFwcEpvaW5lZENvbnRleHRTdHJl\",\n            \"YW0SFi5nb29nbGUucHJvdG9idWYuRW1wdHkaHi5pbnRlcm9wLkFwcEpvaW5l\",\n            \"ZENvbnRleHRFdmVudDABEmkKFlJlc3RvcmVDb250ZXh0c0xpbmthZ2USJi5p\",\n            \"bnRlcm9wLlJlc3RvcmVDb250ZXh0c0xpbmthZ2VSZXF1ZXN0GicuaW50ZXJv\",\n            \"cC5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2UaIZLbBB1pbnRlcm9w\",\n            \"LkNvbnRleHRMaW5rYWdlU2VydmljZUIpqgImUGxleHVzLkludGVyb3AuQXBw\",\n            \"cy5JbnRlcm5hbC5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.AppMetadataServiceReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.Context), global::Plexus.Interop.Apps.Internal.Generated.Context.Parser, new[]{ \"Id\", \"Own\", \"Kind\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ContextsList), global::Plexus.Interop.Apps.Internal.Generated.ContextsList.Parser, new[]{ \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest), global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest.Parser, new[]{ \"Kind\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate), global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate.Parser, new[]{ \"Status\", \"LoadedAppDescriptors\", \"FailedAppDescriptors\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationRef), global::Plexus.Interop.Apps.Internal.Generated.InvocationRef.Parser, new[]{ \"AppInfo\", \"Target\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationsList), global::Plexus.Interop.Apps.Internal.Generated.InvocationsList.Parser, new[]{ \"Invocations\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations), global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations.Parser, new[]{ \"Context\", \"Invocations\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList), global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList.Parser, new[]{ \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent), global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent.Parser, new[]{ \"Context\", \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest), global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest.Parser, new[]{ \"Apps\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance), global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance.Parser, new[]{ \"AppInstanceId\", \"AppIds\", \"ContextIds\", \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse), global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse.Parser, new[]{ \"CreatedContextsMap\" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, })\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  internal enum ContextLoadingStatus {\n    /// <summary>\n    /// intermediate state, some of apps within context already loaded\n    /// </summary>\n    [pbr::OriginalName(\"IN_PROGRESS\")] InProgress = 0,\n    /// <summary>\n    /// termination state, some of apps failed to start/connect to plexus, no more apps \"in progress\"\n    /// </summary>\n    [pbr::OriginalName(\"FAILED\")] Failed = 1,\n    /// <summary>\n    /// termination state, all apps within context are loaded\n    /// </summary>\n    [pbr::OriginalName(\"FINISHED\")] Finished = 2,\n  }\n\n  #endregion\n\n  #region Messages\n  internal sealed partial class Context : pb::IMessage<Context>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<Context> _parser = new pb::MessageParser<Context>(() => new Context());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<Context> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context(Context other) : this() {\n      id_ = other.id_;\n      own_ = other.own_;\n      kind_ = other.kind_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context Clone() {\n      return new Context(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"own\" field.</summary>\n    public const int OwnFieldNumber = 2;\n    private bool own_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Own {\n      get { return own_; }\n      set {\n        own_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"kind\" field.</summary>\n    public const int KindFieldNumber = 3;\n    private string kind_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Kind {\n      get { return kind_; }\n      set {\n        kind_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as Context);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(Context other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if (Own != other.Own) return false;\n      if (Kind != other.Kind) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      if (Own != false) hash ^= Own.GetHashCode();\n      if (Kind.Length != 0) hash ^= Kind.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (Own != false) {\n        output.WriteRawTag(16);\n        output.WriteBool(Own);\n      }\n      if (Kind.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (Own != false) {\n        output.WriteRawTag(16);\n        output.WriteBool(Own);\n      }\n      if (Kind.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      if (Own != false) {\n        size += 1 + 1;\n      }\n      if (Kind.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(Context other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      if (other.Own != false) {\n        Own = other.Own;\n      }\n      if (other.Kind.Length != 0) {\n        Kind = other.Kind;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 16: {\n            Own = input.ReadBool();\n            break;\n          }\n          case 26: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 16: {\n            Own = input.ReadBool();\n            break;\n          }\n          case 26: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ContextsList : pb::IMessage<ContextsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextsList> _parser = new pb::MessageParser<ContextsList>(() => new ContextsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList(ContextsList other) : this() {\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList Clone() {\n      return new ContextsList(this);\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.Context> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.Context.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextsList other) {\n      if (other == null) {\n        return;\n      }\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class CreateContextRequest : pb::IMessage<CreateContextRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<CreateContextRequest> _parser = new pb::MessageParser<CreateContextRequest>(() => new CreateContextRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<CreateContextRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest(CreateContextRequest other) : this() {\n      kind_ = other.kind_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest Clone() {\n      return new CreateContextRequest(this);\n    }\n\n    /// <summary>Field number for the \"kind\" field.</summary>\n    public const int KindFieldNumber = 1;\n    private string kind_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Kind {\n      get { return kind_; }\n      set {\n        kind_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as CreateContextRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(CreateContextRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Kind != other.Kind) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Kind.Length != 0) hash ^= Kind.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Kind.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Kind.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Kind.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(CreateContextRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Kind.Length != 0) {\n        Kind = other.Kind;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ContextLoadingUpdate : pb::IMessage<ContextLoadingUpdate>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextLoadingUpdate> _parser = new pb::MessageParser<ContextLoadingUpdate>(() => new ContextLoadingUpdate());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextLoadingUpdate> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate(ContextLoadingUpdate other) : this() {\n      status_ = other.status_;\n      loadedAppDescriptors_ = other.loadedAppDescriptors_.Clone();\n      failedAppDescriptors_ = other.failedAppDescriptors_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate Clone() {\n      return new ContextLoadingUpdate(this);\n    }\n\n    /// <summary>Field number for the \"status\" field.</summary>\n    public const int StatusFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus status_ = global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus Status {\n      get { return status_; }\n      set {\n        status_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"loaded_app_descriptors\" field.</summary>\n    public const int LoadedAppDescriptorsFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> _repeated_loadedAppDescriptors_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> loadedAppDescriptors_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor>();\n    /// <summary>\n    /// loaded apps within context at this moment of time\n    /// </summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> LoadedAppDescriptors {\n      get { return loadedAppDescriptors_; }\n    }\n\n    /// <summary>Field number for the \"failed_app_descriptors\" field.</summary>\n    public const int FailedAppDescriptorsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> _repeated_failedAppDescriptors_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> failedAppDescriptors_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor>();\n    /// <summary>\n    /// apps registered in context, but failed to load\n    /// </summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor> FailedAppDescriptors {\n      get { return failedAppDescriptors_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextLoadingUpdate);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextLoadingUpdate other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Status != other.Status) return false;\n      if(!loadedAppDescriptors_.Equals(other.loadedAppDescriptors_)) return false;\n      if(!failedAppDescriptors_.Equals(other.failedAppDescriptors_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Status != global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress) hash ^= Status.GetHashCode();\n      hash ^= loadedAppDescriptors_.GetHashCode();\n      hash ^= failedAppDescriptors_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Status != global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress) {\n        output.WriteRawTag(8);\n        output.WriteEnum((int) Status);\n      }\n      loadedAppDescriptors_.WriteTo(output, _repeated_loadedAppDescriptors_codec);\n      failedAppDescriptors_.WriteTo(output, _repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Status != global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress) {\n        output.WriteRawTag(8);\n        output.WriteEnum((int) Status);\n      }\n      loadedAppDescriptors_.WriteTo(ref output, _repeated_loadedAppDescriptors_codec);\n      failedAppDescriptors_.WriteTo(ref output, _repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Status != global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);\n      }\n      size += loadedAppDescriptors_.CalculateSize(_repeated_loadedAppDescriptors_codec);\n      size += failedAppDescriptors_.CalculateSize(_repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextLoadingUpdate other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Status != global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus.InProgress) {\n        Status = other.Status;\n      }\n      loadedAppDescriptors_.Add(other.loadedAppDescriptors_);\n      failedAppDescriptors_.Add(other.failedAppDescriptors_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 8: {\n            Status = (global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus) input.ReadEnum();\n            break;\n          }\n          case 18: {\n            loadedAppDescriptors_.AddEntriesFrom(input, _repeated_loadedAppDescriptors_codec);\n            break;\n          }\n          case 26: {\n            failedAppDescriptors_.AddEntriesFrom(input, _repeated_failedAppDescriptors_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 8: {\n            Status = (global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingStatus) input.ReadEnum();\n            break;\n          }\n          case 18: {\n            loadedAppDescriptors_.AddEntriesFrom(ref input, _repeated_loadedAppDescriptors_codec);\n            break;\n          }\n          case 26: {\n            failedAppDescriptors_.AddEntriesFrom(ref input, _repeated_failedAppDescriptors_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationRef : pb::IMessage<InvocationRef>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationRef> _parser = new pb::MessageParser<InvocationRef>(() => new InvocationRef());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationRef> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef(InvocationRef other) : this() {\n      appInfo_ = other.appInfo_ != null ? other.appInfo_.Clone() : null;\n      target_ = other.target_ != null ? other.target_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef Clone() {\n      return new InvocationRef(this);\n    }\n\n    /// <summary>Field number for the \"app_info\" field.</summary>\n    public const int AppInfoFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo appInfo_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo AppInfo {\n      get { return appInfo_; }\n      set {\n        appInfo_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"target\" field.</summary>\n    public const int TargetFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor target_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor Target {\n      get { return target_; }\n      set {\n        target_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationRef);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationRef other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInfo, other.AppInfo)) return false;\n      if (!object.Equals(Target, other.Target)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInfo_ != null) hash ^= AppInfo.GetHashCode();\n      if (target_ != null) hash ^= Target.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInfo_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInfo);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInfo_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInfo);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInfo_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInfo);\n      }\n      if (target_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationRef other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInfo_ != null) {\n        if (appInfo_ == null) {\n          AppInfo = new global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo();\n        }\n        AppInfo.MergeFrom(other.AppInfo);\n      }\n      if (other.target_ != null) {\n        if (target_ == null) {\n          Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        Target.MergeFrom(other.Target);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInfo_ == null) {\n              AppInfo = new global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo();\n            }\n            input.ReadMessage(AppInfo);\n            break;\n          }\n          case 18: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInfo_ == null) {\n              AppInfo = new global::Plexus.Interop.Apps.Internal.Generated.AppMetamodelInfo();\n            }\n            input.ReadMessage(AppInfo);\n            break;\n          }\n          case 18: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class InvocationsList : pb::IMessage<InvocationsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationsList> _parser = new pb::MessageParser<InvocationsList>(() => new InvocationsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList(InvocationsList other) : this() {\n      invocations_ = other.invocations_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList Clone() {\n      return new InvocationsList(this);\n    }\n\n    /// <summary>Field number for the \"invocations\" field.</summary>\n    public const int InvocationsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.InvocationRef> _repeated_invocations_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.InvocationRef.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.InvocationRef> invocations_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.InvocationRef>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.InvocationRef> Invocations {\n      get { return invocations_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!invocations_.Equals(other.invocations_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= invocations_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      invocations_.WriteTo(output, _repeated_invocations_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      invocations_.WriteTo(ref output, _repeated_invocations_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += invocations_.CalculateSize(_repeated_invocations_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationsList other) {\n      if (other == null) {\n        return;\n      }\n      invocations_.Add(other.invocations_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            invocations_.AddEntriesFrom(input, _repeated_invocations_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            invocations_.AddEntriesFrom(ref input, _repeated_invocations_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ContextToInvocations : pb::IMessage<ContextToInvocations>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextToInvocations> _parser = new pb::MessageParser<ContextToInvocations>(() => new ContextToInvocations());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextToInvocations> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations(ContextToInvocations other) : this() {\n      context_ = other.context_ != null ? other.context_.Clone() : null;\n      invocations_ = other.invocations_ != null ? other.invocations_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations Clone() {\n      return new ContextToInvocations(this);\n    }\n\n    /// <summary>Field number for the \"context\" field.</summary>\n    public const int ContextFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.Context context_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.Context Context {\n      get { return context_; }\n      set {\n        context_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"invocations\" field.</summary>\n    public const int InvocationsFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.InvocationsList invocations_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.InvocationsList Invocations {\n      get { return invocations_; }\n      set {\n        invocations_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextToInvocations);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextToInvocations other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Context, other.Context)) return false;\n      if (!object.Equals(Invocations, other.Invocations)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (context_ != null) hash ^= Context.GetHashCode();\n      if (invocations_ != null) hash ^= Invocations.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (invocations_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Invocations);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (invocations_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Invocations);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (context_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);\n      }\n      if (invocations_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Invocations);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextToInvocations other) {\n      if (other == null) {\n        return;\n      }\n      if (other.context_ != null) {\n        if (context_ == null) {\n          Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n        }\n        Context.MergeFrom(other.Context);\n      }\n      if (other.invocations_ != null) {\n        if (invocations_ == null) {\n          Invocations = new global::Plexus.Interop.Apps.Internal.Generated.InvocationsList();\n        }\n        Invocations.MergeFrom(other.Invocations);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (invocations_ == null) {\n              Invocations = new global::Plexus.Interop.Apps.Internal.Generated.InvocationsList();\n            }\n            input.ReadMessage(Invocations);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (invocations_ == null) {\n              Invocations = new global::Plexus.Interop.Apps.Internal.Generated.InvocationsList();\n            }\n            input.ReadMessage(Invocations);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class ContextToInvocationsList : pb::IMessage<ContextToInvocationsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextToInvocationsList> _parser = new pb::MessageParser<ContextToInvocationsList>(() => new ContextToInvocationsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextToInvocationsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList(ContextToInvocationsList other) : this() {\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList Clone() {\n      return new ContextToInvocationsList(this);\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocations> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextToInvocationsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextToInvocationsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextToInvocationsList other) {\n      if (other == null) {\n        return;\n      }\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class AppJoinedContextEvent : pb::IMessage<AppJoinedContextEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppJoinedContextEvent> _parser = new pb::MessageParser<AppJoinedContextEvent>(() => new AppJoinedContextEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppJoinedContextEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent(AppJoinedContextEvent other) : this() {\n      context_ = other.context_ != null ? other.context_.Clone() : null;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent Clone() {\n      return new AppJoinedContextEvent(this);\n    }\n\n    /// <summary>Field number for the \"context\" field.</summary>\n    public const int ContextFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.Context context_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.Context Context {\n      get { return context_; }\n      set {\n        context_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppJoinedContextEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppJoinedContextEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Context, other.Context)) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (context_ != null) hash ^= Context.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (context_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppJoinedContextEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.context_ != null) {\n        if (context_ == null) {\n          Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n        }\n        Context.MergeFrom(other.Context);\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Apps.Internal.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class RestoreContextsLinkageRequest : pb::IMessage<RestoreContextsLinkageRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoreContextsLinkageRequest> _parser = new pb::MessageParser<RestoreContextsLinkageRequest>(() => new RestoreContextsLinkageRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoreContextsLinkageRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest(RestoreContextsLinkageRequest other) : this() {\n      apps_ = other.apps_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest Clone() {\n      return new RestoreContextsLinkageRequest(this);\n    }\n\n    /// <summary>Field number for the \"apps\" field.</summary>\n    public const int AppsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance> _repeated_apps_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance> apps_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.RestoringAppInstance> Apps {\n      get { return apps_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoreContextsLinkageRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoreContextsLinkageRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!apps_.Equals(other.apps_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= apps_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      apps_.WriteTo(output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      apps_.WriteTo(ref output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += apps_.CalculateSize(_repeated_apps_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoreContextsLinkageRequest other) {\n      if (other == null) {\n        return;\n      }\n      apps_.Add(other.apps_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(ref input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class RestoringAppInstance : pb::IMessage<RestoringAppInstance>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoringAppInstance> _parser = new pb::MessageParser<RestoringAppInstance>(() => new RestoringAppInstance());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoringAppInstance> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance(RestoringAppInstance other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appIds_ = other.appIds_.Clone();\n      contextIds_ = other.contextIds_.Clone();\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance Clone() {\n      return new RestoringAppInstance(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Apps.Internal.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_ids\" field.</summary>\n    public const int AppIdsFieldNumber = 2;\n    private static readonly pb::FieldCodec<string> _repeated_appIds_codec\n        = pb::FieldCodec.ForString(18);\n    private readonly pbc::RepeatedField<string> appIds_ = new pbc::RepeatedField<string>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> AppIds {\n      get { return appIds_; }\n    }\n\n    /// <summary>Field number for the \"context_ids\" field.</summary>\n    public const int ContextIdsFieldNumber = 3;\n    private static readonly pb::FieldCodec<string> _repeated_contextIds_codec\n        = pb::FieldCodec.ForString(26);\n    private readonly pbc::RepeatedField<string> contextIds_ = new pbc::RepeatedField<string>();\n    [global::System.ObsoleteAttribute]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> ContextIds {\n      get { return contextIds_; }\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 4;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Apps.Internal.Generated.Context> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(34, global::Plexus.Interop.Apps.Internal.Generated.Context.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Apps.Internal.Generated.Context> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoringAppInstance);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoringAppInstance other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if(!appIds_.Equals(other.appIds_)) return false;\n      if(!contextIds_.Equals(other.contextIds_)) return false;\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      hash ^= appIds_.GetHashCode();\n      hash ^= contextIds_.GetHashCode();\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(output, _repeated_appIds_codec);\n      contextIds_.WriteTo(output, _repeated_contextIds_codec);\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(ref output, _repeated_appIds_codec);\n      contextIds_.WriteTo(ref output, _repeated_contextIds_codec);\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      size += appIds_.CalculateSize(_repeated_appIds_codec);\n      size += contextIds_.CalculateSize(_repeated_contextIds_codec);\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoringAppInstance other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      appIds_.Add(other.appIds_);\n      contextIds_.Add(other.contextIds_);\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            contextIds_.AddEntriesFrom(input, _repeated_contextIds_codec);\n            break;\n          }\n          case 34: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Apps.Internal.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(ref input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            contextIds_.AddEntriesFrom(ref input, _repeated_contextIds_codec);\n            break;\n          }\n          case 34: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  internal sealed partial class RestoreContextsLinkageResponse : pb::IMessage<RestoreContextsLinkageResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoreContextsLinkageResponse> _parser = new pb::MessageParser<RestoreContextsLinkageResponse>(() => new RestoreContextsLinkageResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoreContextsLinkageResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.ContextLinkageReflection.Descriptor.MessageTypes[11]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse(RestoreContextsLinkageResponse other) : this() {\n      createdContextsMap_ = other.createdContextsMap_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse Clone() {\n      return new RestoreContextsLinkageResponse(this);\n    }\n\n    /// <summary>Field number for the \"created_contexts_map\" field.</summary>\n    public const int CreatedContextsMapFieldNumber = 1;\n    private static readonly pbc::MapField<string, global::Plexus.Interop.Apps.Internal.Generated.Context>.Codec _map_createdContextsMap_codec\n        = new pbc::MapField<string, global::Plexus.Interop.Apps.Internal.Generated.Context>.Codec(pb::FieldCodec.ForString(10, \"\"), pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Apps.Internal.Generated.Context.Parser), 10);\n    private readonly pbc::MapField<string, global::Plexus.Interop.Apps.Internal.Generated.Context> createdContextsMap_ = new pbc::MapField<string, global::Plexus.Interop.Apps.Internal.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::MapField<string, global::Plexus.Interop.Apps.Internal.Generated.Context> CreatedContextsMap {\n      get { return createdContextsMap_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoreContextsLinkageResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoreContextsLinkageResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!CreatedContextsMap.Equals(other.CreatedContextsMap)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= CreatedContextsMap.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      createdContextsMap_.WriteTo(output, _map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      createdContextsMap_.WriteTo(ref output, _map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += createdContextsMap_.CalculateSize(_map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoreContextsLinkageResponse other) {\n      if (other == null) {\n        return;\n      }\n      createdContextsMap_.Add(other.createdContextsMap_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            createdContextsMap_.AddEntriesFrom(input, _map_createdContextsMap_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            createdContextsMap_.AddEntriesFrom(ref input, _map_createdContextsMap_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/ContextLinkage.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\context_linkage.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class ContextLinkageService {\n\t\t\n\t\tpublic const string Id = \"interop.ContextLinkageService\";\t\t\t\n\t\tpublic const string ContextLoadedStreamMethodId = \"ContextLoadedStream\";\n\t\tpublic const string CreateContextMethodId = \"CreateContext\";\n\t\tpublic const string CreateContext2MethodId = \"CreateContext2\";\n\t\tpublic const string JoinContextMethodId = \"JoinContext\";\n\t\tpublic const string GetContextsMethodId = \"GetContexts\";\n\t\tpublic const string GetLinkedInvocationsMethodId = \"GetLinkedInvocations\";\n\t\tpublic const string GetAllLinkedInvocationsMethodId = \"GetAllLinkedInvocations\";\n\t\tpublic const string AppJoinedContextStreamMethodId = \"AppJoinedContextStream\";\n\t\tpublic const string RestoreContextsLinkageMethodId = \"RestoreContextsLinkage\";\n\t\t\n\t\tpublic static readonly ContextLinkageService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static ContextLinkageService.Descriptor CreateDescriptor() {\n\t\t\treturn new ContextLinkageService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static ContextLinkageService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new ContextLinkageService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IContextLoadedStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> ContextLoadedStream(global::Plexus.Interop.Apps.Internal.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContextProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContext2Proxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext2(global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IJoinContextProxy {\n\t\t\tIUnaryMethodCall<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Apps.Internal.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetContextsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLinkedInvocationsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Apps.Internal.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAllLinkedInvocationsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppJoinedContextStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRestoreContextsLinkageProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IContextLoadedStreamImpl {\n\t\t\tTask ContextLoadedStream(global::Plexus.Interop.Apps.Internal.Generated.Context request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContextImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContext2Impl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext2(global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IJoinContextImpl {\n\t\t\tTask<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetContextsImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLinkedInvocationsImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Apps.Internal.Generated.Context request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAllLinkedInvocationsImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppJoinedContextStreamImpl {\n\t\t\tTask AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IRestoreContextsLinkageImpl {\n\t\t\tTask<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate> ContextLoadedStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContextMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context> CreateContext2Method {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty> JoinContextMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList> GetContextsMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList> GetLinkedInvocationsMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList> GetAllLinkedInvocationsMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent> AppJoinedContextStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkageMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tContextLoadedStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate>(Id, ContextLoadedStreamMethodId);\n\t\t\t\tCreateContextMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context>(Id, CreateContextMethodId);\n\t\t\t\tCreateContext2Method = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context>(Id, CreateContext2MethodId);\n\t\t\t\tJoinContextMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty>(Id, JoinContextMethodId);\n\t\t\t\tGetContextsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList>(Id, GetContextsMethodId);\n\t\t\t\tGetLinkedInvocationsMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList>(Id, GetLinkedInvocationsMethodId);\n\t\t\t\tGetAllLinkedInvocationsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList>(Id, GetAllLinkedInvocationsMethodId);\n\t\t\t\tAppJoinedContextStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent>(Id, AppJoinedContextStreamMethodId);\n\t\t\t\tRestoreContextsLinkageMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse>(Id, RestoreContextsLinkageMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tContextLoadedStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.ContextLoadingUpdate>(Id, alias, ContextLoadedStreamMethodId);\n\t\t\t\tCreateContextMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.Context>(Id, alias, CreateContextMethodId);\n\t\t\t\tCreateContext2Method = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.CreateContextRequest, global::Plexus.Interop.Apps.Internal.Generated.Context>(Id, alias, CreateContext2MethodId);\n\t\t\t\tJoinContextMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty>(Id, alias, JoinContextMethodId);\n\t\t\t\tGetContextsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextsList>(Id, alias, GetContextsMethodId);\n\t\t\t\tGetLinkedInvocationsMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.Context, global::Plexus.Interop.Apps.Internal.Generated.InvocationsList>(Id, alias, GetLinkedInvocationsMethodId);\n\t\t\t\tGetAllLinkedInvocationsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.ContextToInvocationsList>(Id, alias, GetAllLinkedInvocationsMethodId);\n\t\t\t\tAppJoinedContextStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppJoinedContextEvent>(Id, alias, AppJoinedContextStreamMethodId);\n\t\t\t\tRestoreContextsLinkageMethod = Method.Unary<global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Apps.Internal.Generated.RestoreContextsLinkageResponse>(Id, alias, RestoreContextsLinkageMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/InvocationDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/invocation_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/invocation_descriptor.proto</summary>\n  internal static partial class InvocationDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/invocation_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static InvocationDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2ludm9jYXRpb25fZGVzY3JpcHRvci5wcm90bxIHaW50ZXJv\",\n            \"cBonaW50ZXJvcC9hcHBfY29ubmVjdGlvbl9kZXNjcmlwdG9yLnByb3RvGhVp\",\n            \"bnRlcm9wL29wdGlvbnMucHJvdG8i3QEKFEludm9jYXRpb25EZXNjcmlwdG9y\",\n            \"EhIKCnNlcnZpY2VfaWQYASABKAkSGAoQc2VydmljZV9hbGlhc19pZBgCIAEo\",\n            \"CRIRCgltZXRob2RfaWQYAyABKAkSMAoGc291cmNlGAQgASgLMiAuaW50ZXJv\",\n            \"cC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvchIwCgZ0YXJnZXQYBSABKAsyIC5p\",\n            \"bnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlwdG9yOiCS2wQcaW50ZXJvcC5J\",\n            \"bnZvY2F0aW9uRGVzY3JpcHRvckIpqgImUGxleHVzLkludGVyb3AuQXBwcy5J\",\n            \"bnRlcm5hbC5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor), global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptor.Parser, new[]{ \"ServiceId\", \"ServiceAliasId\", \"MethodId\", \"Source\", \"Target\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class InvocationDescriptor : pb::IMessage<InvocationDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationDescriptor> _parser = new pb::MessageParser<InvocationDescriptor>(() => new InvocationDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.InvocationDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor(InvocationDescriptor other) : this() {\n      serviceId_ = other.serviceId_;\n      serviceAliasId_ = other.serviceAliasId_;\n      methodId_ = other.methodId_;\n      source_ = other.source_ != null ? other.source_.Clone() : null;\n      target_ = other.target_ != null ? other.target_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor Clone() {\n      return new InvocationDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"service_alias_id\" field.</summary>\n    public const int ServiceAliasIdFieldNumber = 2;\n    private string serviceAliasId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceAliasId {\n      get { return serviceAliasId_; }\n      set {\n        serviceAliasId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"method_id\" field.</summary>\n    public const int MethodIdFieldNumber = 3;\n    private string methodId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string MethodId {\n      get { return methodId_; }\n      set {\n        methodId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"source\" field.</summary>\n    public const int SourceFieldNumber = 4;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor source_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor Source {\n      get { return source_; }\n      set {\n        source_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"target\" field.</summary>\n    public const int TargetFieldNumber = 5;\n    private global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor target_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor Target {\n      get { return target_; }\n      set {\n        target_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (ServiceAliasId != other.ServiceAliasId) return false;\n      if (MethodId != other.MethodId) return false;\n      if (!object.Equals(Source, other.Source)) return false;\n      if (!object.Equals(Target, other.Target)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (ServiceAliasId.Length != 0) hash ^= ServiceAliasId.GetHashCode();\n      if (MethodId.Length != 0) hash ^= MethodId.GetHashCode();\n      if (source_ != null) hash ^= Source.GetHashCode();\n      if (target_ != null) hash ^= Target.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodId);\n      }\n      if (source_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Source);\n      }\n      if (target_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.ServiceAliasId.Length != 0) {\n        ServiceAliasId = other.ServiceAliasId;\n      }\n      if (other.MethodId.Length != 0) {\n        MethodId = other.MethodId;\n      }\n      if (other.source_ != null) {\n        if (source_ == null) {\n          Source = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        Source.MergeFrom(other.Source);\n      }\n      if (other.target_ != null) {\n        if (target_ == null) {\n          Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n        }\n        Target.MergeFrom(other.Target);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Apps.Internal.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/NativeAppLauncher.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\native_app_launcher.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tinternal partial interface INativeAppLauncherClient: IClient {\n\t}\n\t\n\tinternal sealed partial class NativeAppLauncherClient: ClientBase, INativeAppLauncherClient {\n\t\t\n\t\tpublic const string Id = \"interop.NativeAppLauncher\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(NativeAppLauncherClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic NativeAppLauncherClient(\n\t\t\tNativeAppLauncherClient.IAppLauncherServiceImpl appLauncherService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new NativeAppLauncherClient.ServiceBinder(\n\t\t\tappLauncherService\n\t\t), setup) { }\n\t\t\n\t\tpublic NativeAppLauncherClient(NativeAppLauncherClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tNativeAppLauncherClient.IAppLauncherServiceImpl appLauncherService\n\t\t\t) {\n\t\t\t\t_appLauncherServiceBinder = new NativeAppLauncherClient.AppLauncherServiceBinder(appLauncherService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate AppLauncherServiceBinder _appLauncherServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _appLauncherServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface IAppLauncherServiceImpl:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.ILaunchImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.IAppLaunchedEventStreamImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class AppLauncherServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IAppLauncherServiceImpl _impl;\n\t\t\t\n\t\t\tpublic AppLauncherServiceBinder(IAppLauncherServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse>(global::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.LaunchMethodId, _impl.Launch);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent>(global::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.AppLaunchedEventStreamMethodId, _impl.AppLaunchedEventStream);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class AppLauncherServiceImpl: IAppLauncherServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> _launchHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> _appLaunchedEventStreamHandler;\n\t\t\t\n\t\t\tpublic AppLauncherServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> launchHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> appLaunchedEventStreamHandler\n\t\t\t) {\n\t\t\t\t_launchHandler = launchHandler;\n\t\t\t\t_appLaunchedEventStreamHandler = appLaunchedEventStreamHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest request, MethodCallContext context) {\n\t\t\t\treturn _launchHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _appLaunchedEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class AppLauncherServiceImpl<T>: IAppLauncherServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.ILaunchImpl,\n\t\t\tglobal::Plexus.Interop.Apps.Internal.Generated.AppLauncherService.IAppLaunchedEventStreamImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic AppLauncherServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Apps.Internal.Generated.AppLaunchRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.Launch(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Apps.Internal.Generated.AppLaunchedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.AppLaunchedEventStream(request, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  internal static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIpqgImUGxleHVzLkludGVyb3AuQXBwcy5JbnRlcm5hbC5HZW5lcmF0ZWRi\",\n            \"BnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { OptionsExtensions.MessageId, OptionsExtensions.ServiceId, OptionsExtensions.MethodId }, null));\n    }\n    #endregion\n\n  }\n  /// <summary>Holder for extension identifiers generated from the top level of interop/options.proto</summary>\n  internal static partial class OptionsExtensions {\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string> MessageId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string> ServiceId =\n      new pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string> MethodId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n  }\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Generated/interop/UniqueId.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/unique_id.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Apps.Internal.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/unique_id.proto</summary>\n  internal static partial class UniqueIdReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/unique_id.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static UniqueIdReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChdpbnRlcm9wL3VuaXF1ZV9pZC5wcm90bxIHaW50ZXJvcBoVaW50ZXJvcC9v\",\n            \"cHRpb25zLnByb3RvIjgKCFVuaXF1ZUlkEgoKAmxvGAEgASgGEgoKAmhpGAIg\",\n            \"ASgGOhSS2wQQaW50ZXJvcC5VbmlxdWVJZEIpqgImUGxleHVzLkludGVyb3Au\",\n            \"QXBwcy5JbnRlcm5hbC5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Apps.Internal.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Apps.Internal.Generated.UniqueId), global::Plexus.Interop.Apps.Internal.Generated.UniqueId.Parser, new[]{ \"Lo\", \"Hi\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  /// <summary>\n  /// Stores UUID in little-endian format (i.e. reversed).\n  /// To convert to bytes on little-endian systems (most common case): concat (toBytes(hi), toBytes(lo))\n  /// To convert to bytes on big-endian systems need to additionally reverse \"hi\" and \"lo\" parts: concat( reverse(toBytes(hi)), reverse(toBytes(lo)) )\n  /// </summary>\n  internal sealed partial class UniqueId : pb::IMessage<UniqueId>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<UniqueId> _parser = new pb::MessageParser<UniqueId>(() => new UniqueId());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<UniqueId> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Apps.Internal.Generated.UniqueIdReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId(UniqueId other) : this() {\n      lo_ = other.lo_;\n      hi_ = other.hi_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId Clone() {\n      return new UniqueId(this);\n    }\n\n    /// <summary>Field number for the \"lo\" field.</summary>\n    public const int LoFieldNumber = 1;\n    private ulong lo_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Lo {\n      get { return lo_; }\n      set {\n        lo_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"hi\" field.</summary>\n    public const int HiFieldNumber = 2;\n    private ulong hi_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Hi {\n      get { return hi_; }\n      set {\n        hi_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as UniqueId);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(UniqueId other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Lo != other.Lo) return false;\n      if (Hi != other.Hi) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Lo != 0UL) hash ^= Lo.GetHashCode();\n      if (Hi != 0UL) hash ^= Hi.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Lo != 0UL) {\n        size += 1 + 8;\n      }\n      if (Hi != 0UL) {\n        size += 1 + 8;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(UniqueId other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Lo != 0UL) {\n        Lo = other.Lo;\n      }\n      if (other.Hi != 0UL) {\n        Hi = other.Hi;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/IAppLaunchedEventProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal interface IAppLaunchedEventProvider\n    {\n        IObservable<AppLaunchedEvent> AppLaunchedStream { get; }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/IAppLifecycleManagerClientClientRepository.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal interface IAppLifecycleManagerClientClientRepository\n    {\n        IObservable<AppLifecycleManagerClient> GetClientObservable();\n        Task<AppLifecycleManagerClient> GetClientAsync();\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/IAppRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n\n    internal interface IAppRegistryProvider\n    {\n        AppRegistry Current { get; }\n\n        event Action<AppRegistry> Updated;\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/InteropContext.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.IO;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using Plexus.Interop.Apps.Internal.Services;\n    using Plexus.Interop.Metamodel;\n    using Plexus.Processes;\n    using IContextLinkageManager = Plexus.Interop.Apps.IContextLinkageManager;\n\n    internal class InteropContext : ProcessBase, IInteropContext\n    {\n        public IRegistryProvider RegistryProvider { get; }\n\n        public IAppLifecycleManager AppLifecycleManager => _appLifecycleManager;\n\n        public IInvocationEventProvider InvocationEventProvider => _appLifecycleService;\n        public IContextLinkageManager ContextLinkageManager => _contextLinkageService;\n\n        private readonly NativeAppLauncherClient _nativeAppLauncherClient;\n        private readonly AppLifecycleManager _appLifecycleManager;\n\n        private readonly AppLifecycleServiceImpl _appLifecycleService;\n        private readonly ContextLinkageServiceImpl _contextLinkageService;\n        private AppLaunchedEventSubscriber _appLaunchedEventSubscriber;\n        private readonly  AppMetadataServiceImpl _appMetadataService;\n        private readonly AppRegistrationServiceImpl _appRegistrationService;\n\n        private readonly AppLifecycleManagerClientClientRepository _appLifecycleManagerClientClientRepository;\n\n        public InteropContext(Plexus.UniqueId trustedLauncherId, string metadataDir, IRegistryProvider registryProvider)\n        {\n            RegistryProvider = registryProvider;\n            var appRegistryProvider = new JsonFileAppRegistryProvider(Path.Combine(metadataDir, \"apps.json\"));\n\n            _appLifecycleManagerClientClientRepository = new AppLifecycleManagerClientClientRepository();\n            var appLaunchedEventProvider = new AppLaunchedEventProvider();\n            _appLifecycleManager = new AppLifecycleManager(appRegistryProvider, appLaunchedEventProvider, _appLifecycleManagerClientClientRepository);\n            _appLifecycleManager.RegisterAppInstance(trustedLauncherId);\n            _appLaunchedEventSubscriber = new AppLaunchedEventSubscriber(_appLifecycleManager, registryProvider, appLaunchedEventProvider, _appLifecycleManagerClientClientRepository);\n\n            var nativeLauncherInstanceId = Plexus.UniqueId.Generate();\n            _appLifecycleManager.RegisterAppInstanceConnection(Generated.NativeAppLauncherClient.Id, nativeLauncherInstanceId);\n            _nativeAppLauncherClient = new NativeAppLauncherClient(metadataDir, nativeLauncherInstanceId);\n\n            _appMetadataService = new AppMetadataServiceImpl(appRegistryProvider, registryProvider);\n            _appLifecycleService = new AppLifecycleServiceImpl(_appLifecycleManager);\n            _contextLinkageService = new ContextLinkageServiceImpl(registryProvider, _appLifecycleManager, appLaunchedEventProvider);\n            _appRegistrationService = new AppRegistrationServiceImpl(_appLifecycleManager);\n\n            OnStop(_nativeAppLauncherClient.Stop);\n            OnStop(_appLifecycleManagerClientClientRepository.Stop);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<InteropContext>();\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            var clientsCompletionTask = Task.WhenAll(_appLifecycleManagerClientClientRepository.Start(CreateAppLifecycleManagerClient), StartNativeAppLauncherClient());\n            return Task.FromResult(clientsCompletionTask);\n        }\n\n        private async Task StartNativeAppLauncherClient()\n        {\n            await _nativeAppLauncherClient.StartAsync();\n            await _nativeAppLauncherClient.Completion;\n        }\n\n        private AppLifecycleManagerClient CreateAppLifecycleManagerClient()\n        {\n            var id = Plexus.UniqueId.Generate();\n            _appLifecycleManager.RegisterAppInstanceConnection(AppLifecycleManagerClient.Id, id);\n            return new AppLifecycleManagerClient(\n                _appLifecycleService,\n                _appMetadataService,\n                _contextLinkageService,\n                _appRegistrationService,\n                s => s.WithAppInstanceId(id).WithBrokerWorkingDir(Directory.GetCurrentDirectory()));\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/InteropContextFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using Plexus.Interop.Metamodel;\n\n    public sealed class InteropContextFactory\n    {\n        public static readonly InteropContextFactory Instance = new InteropContextFactory();\n\n        public IInteropContext Create(UniqueId trustedLauncherId, string metadataDir, IRegistryProvider registryProvider)\n        {\n            return new InteropContext(trustedLauncherId, metadataDir, registryProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/JsonFileAppRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System.Linq;\n\n    internal sealed class JsonFileAppRegistryProvider : BaseJsonFileRegistryProvider<AppRegistry>, IAppRegistryProvider\n    {\n        public JsonFileAppRegistryProvider(string jsonFileName) : base(jsonFileName)\n        { }\n\n        public override AppRegistry ParseRegistry(string registryContent)\n        {\n            var dto = AppsDto.FromContent(registryContent);\n            var registry = new AppRegistry(dto.Apps.Select(x => new AppInfo(x.Id, x.DisplayName, x.LauncherId, x.LauncherParams)));\n            return registry;\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/NativeAppLauncherClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using Plexus.Interop.Apps.Internal.Generated;\n    using Plexus.Processes;\n    using System.IO;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n\n    internal sealed class NativeAppLauncherClient : ProcessBase, Generated.NativeAppLauncherClient.IAppLauncherServiceImpl\n    {\n        private readonly SubProcessLauncher _subProcessLauncher;\n        private readonly string _cmdBasePath;\n        private readonly Subject<(AppLaunchRequest request, Plexus.UniqueId id)> _appLaunchedSubject = new Subject<(AppLaunchRequest request, Plexus.UniqueId id)>();\n        private INativeAppLauncherClient _client;\n\n        public Plexus.UniqueId Id { get; }\n\n        public NativeAppLauncherClient(string cmdBasePath, Plexus.UniqueId id)\n        {\n            Id = id;\n            _cmdBasePath = cmdBasePath;\n            _subProcessLauncher = new SubProcessLauncher();\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<NativeAppLauncherClient>();\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            _client = new Generated.NativeAppLauncherClient(\n                this,\n                s => s.WithAppInstanceId(Id).WithBrokerWorkingDir(Directory.GetCurrentDirectory()));\n            await _client.ConnectAsync().ConfigureAwait(false);\n            Log.Debug(\"Connected\");\n            return ProcessAsync();\n        }\n\n        Task<AppLaunchResponse> AppLauncherService.ILaunchImpl.Launch(AppLaunchRequest request, MethodCallContext context)\n        {\n            Log.Debug(\"Launch request received: {0}\", request);\n            var paramsDto = JsonConvert.Deserialize<NativeAppLauncherParamsDto>(request.LaunchParamsJson);\n            var cmd = Path.Combine(_cmdBasePath, paramsDto.Cmd);\n            var id = _subProcessLauncher.Launch(cmd, paramsDto.Args);\n            _appLaunchedSubject.OnNext((request, id));\n            Log.Trace(\"Launched app instance {0} by request: {1}\", id, request);\n            return Task.FromResult(new AppLaunchResponse\n            {\n                AppInstanceId = id.ToProto(),\n            });\n        }\n\n        Task AppLauncherService.IAppLaunchedEventStreamImpl.AppLaunchedEventStream(Empty request, IWritableChannel<AppLaunchedEvent> responseStream, MethodCallContext callContext)\n        {\n            return _appLaunchedSubject.Select(launchEvent => new AppLaunchedEvent\n            {\n                AppInstanceId = launchEvent.id.ToProto(),\n                AppIds = { launchEvent.request.AppId },\n                Referrer = new AppLaunchReferrer\n                {\n                    AppInstanceId = launchEvent.request.Referrer.AppInstanceId,\n                    ConnectionId = launchEvent.request.Referrer.ConnectionId,\n                    AppId = launchEvent.request.Referrer.AppId,\n                }\n            }).PipeAsync(responseStream, callContext.CancellationToken);\n        }\n\n        private async Task ProcessAsync()\n        {\n            await _client.Completion.ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/NativeAppLauncherParamsDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps.Internal\n{\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class NativeAppLauncherParamsDto\n    {\n        [DataMember(Name = \"cmd\")]\n        public string Cmd { get; set; }\n\n        [DataMember(Name = \"args\")]\n        public string Args { get; set; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/ObservableExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Reactive;\n    using System.Reactive.Linq;\n    using System.Reactive.Threading.Tasks;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    public static class ObservableExtensions\n    {\n        public static Task PipeAsync<T>(\n            this IObservable<T> observable,\n            IWritableChannel<T> writableChannel,\n            CancellationToken cancellationToken = default(CancellationToken),\n            TimeSpan sendTimeout = default(TimeSpan))\n        {\n            return observable\n                .SelectMany(arg => WriteAsync(writableChannel, arg, cancellationToken, sendTimeout).ToObservable())\n                .Concat(Observable.Return(Unit.Default))\n                .ToTask(cancellationToken);\n        }\n\n        private static async Task WriteAsync<T>(\n            IWritableChannel<T> channel,\n            T arg,\n            CancellationToken cancellationToken,\n            TimeSpan sendTimeout)\n        {\n            using (var timeoutCancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            {\n                if (sendTimeout > TimeSpan.Zero)\n                {\n                    // Cancel sending after timeout\n                    timeoutCancellation.CancelAfter(sendTimeout);\n                }\n\n                await channel.WriteAsync(arg, timeoutCancellation.Token).ConfigureAwait(false);\n            }\n        }\n\n        public static Task PipeAsync<T>(\n            this IReadableChannel<T> readableChannel,\n            IObserver<T> observer,\n            CancellationToken cancellationToken = default(CancellationToken),\n            bool sendCompete = false,\n            bool sendException = false)\n        {\n            return readableChannel.ConsumeAsync(obj => observer.OnNext(obj), cancellationToken, () =>\n            {\n                if (sendCompete)\n                {\n                    observer.OnCompleted();\n                }\n                return TaskHelper.CompletedTask;\n            }, exception =>\n            {\n                if (sendException)\n                {\n                    observer.OnError(exception);\n                }\n                return TaskHelper.FromException(exception);\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/ProtobufHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using UniqueId = Plexus.UniqueId;\n\n    internal static class ProtobufHelper\n    {\n        public static UniqueId ToUniqueId(this Generated.UniqueId uniqueId)\n        {\n            if (uniqueId is null)\n            {\n                return UniqueId.Empty;\n            }\n            return UniqueId.FromHiLo(uniqueId.Hi, uniqueId.Lo);\n        }\n\n        public static Generated.UniqueId ToProto(this UniqueId id)\n        {\n            return new Generated.UniqueId\n            {\n                Hi = id.Hi,\n                Lo = id.Lo\n            };\n        }\n\n        public static Generated.TransportType ToProto(this TransportType transportType)\n        {\n            switch (transportType)\n            {\n                case TransportType.Pipe: return Generated.TransportType.Pipe;\n                case TransportType.Ws: return Generated.TransportType.Ws;\n                case TransportType.Wss: return Generated.TransportType.Wss;\n                default: return Generated.TransportType.Unknown;\n            }\n        }\n\n        public static Generated.AppConnectionDescriptor ToProto(this AppConnectionDescriptor info)\n        {\n            return new Generated.AppConnectionDescriptor\n            {\n                AppId = info.ApplicationId,\n                AppInstanceId = info.ApplicationInstanceId.ToProto(),\n                ConnectionId = info.ConnectionId.ToProto(),\n                TransportType = info.TransportType.ToProto()\n            };\n        }\n\n        public static Generated.InvocationDescriptor ToProto(this InvocationDescriptor info)\n        {\n            return new Generated.InvocationDescriptor\n            {\n                Source = info.SourceConnection.ToProto(),\n                Target = info.TargetConnection.ToProto(),\n                MethodId = info.MethodId,\n                ServiceId = info.ServiceId,\n                ServiceAliasId = info.ServiceAlias ?? string.Empty\n            };\n        }\n\n        public static Generated.InvocationResult ToProto(this InvocationResult info)\n        {\n            switch (info)\n            {\n                case InvocationResult.Succeeded:\n                    return Generated.InvocationResult.Succeeded;\n                case InvocationResult.Canceled:\n                    return Generated.InvocationResult.Canceled;\n                case InvocationResult.Failed:\n                    return Generated.InvocationResult.Failed;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(info), info, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/AppLifecycleServiceImpl.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using AppConnectionDescriptor = Plexus.AppConnectionDescriptor;\n    using UniqueId = Plexus.UniqueId;\n\n    internal class AppLifecycleServiceImpl : IAppLifecycleService\n    {\n        private ILogger Log { get; } = LogManager.GetLogger<AppLifecycleServiceImpl>();\n\n        private readonly IAppLifecycleManager _appLifecycleManager;\n\n        private readonly Subject<AppLifecycleEvent> _appLifecycleEventBroadcaster\n            = new Subject<AppLifecycleEvent>();\n\n        private readonly Subject<InvocationEvent> _invocationEventBroadcaster\n            = new Subject<InvocationEvent>();\n\n        public AppLifecycleServiceImpl(IAppLifecycleManager appLifecycleManager)\n        {\n            _appLifecycleManager = appLifecycleManager;\n            _appLifecycleManager.ConnectionEventsStream.Subscribe(BroadcastConnectionEvents);\n        }\n\n        public void OnInvocationStarted(InvocationStartedEventDescriptor eventData)\n        {\n            _invocationEventBroadcaster.OnNext(new InvocationEvent\n            {\n                InvocationStarted = new InvocationStartedEvent\n                {\n                    InvocationDescriptor = eventData.InvocationDescriptor.ToProto()\n                }\n            });\n        }\n\n        public void OnInvocationFinished(InvocationFinishedEventDescriptor eventData)\n        {\n            _invocationEventBroadcaster.OnNext(new InvocationEvent\n            {\n                InvocationFinished = new InvocationFinishedEvent\n                {\n                    InvocationDescriptor = eventData.MethodCallDescriptor.ToProto(),\n                    Result = eventData.Result.ToProto(),\n                    DurationMs = eventData.DurationMs\n                }\n            });\n        }\n\n        private void BroadcastConnectionEvents(AppConnectionEvent connectionEvent)\n        {\n            var lifecycleEvent = new AppLifecycleEvent();\n            switch (connectionEvent.Type)\n            {\n                case ConnectionEventType.AppConnected:\n                    lifecycleEvent.Connected = new AppConnectedEvent\n                    {\n                        ConnectionDescriptor = connectionEvent.Connection.ToProto()\n                    };\n                    break;\n                case ConnectionEventType.AppDisconnected:\n                    lifecycleEvent.Disconnected = new AppDisconnectedEvent\n                    {\n                        ConnectionDescriptor = connectionEvent.Connection.ToProto()\n                    };\n                    break;\n                case ConnectionEventType.AppConnectionError:\n                    lifecycleEvent.Error = new AppConnectionErrorEvent\n                    {\n                        ConnectionDescriptor = connectionEvent.Connection.ToProto()\n                    };\n                    break;\n                default:\n                    Log.Error($\"Unknown connection event type {connectionEvent.Type}\");\n                    return;\n            };\n            _appLifecycleEventBroadcaster.OnNext(lifecycleEvent);\n        }\n\n        public async Task<ResolveAppResponse> ResolveApp(ResolveAppRequest request, MethodCallContext context)\n        {\n            Log.Info(\"Resolving app by request {{{0}}} from {{{1}}}\", request, context);\n            var referrerConnectionInfo = new AppConnectionDescriptor(\n                context.ConsumerConnectionId,\n                context.ConsumerApplicationId,\n                context.ConsumerApplicationInstanceId,\n                context.ConsumerTransportType);\n            var resolveMode = Convert(request.AppResolveMode);\n            if (resolveMode == ResolveMode.SingleInstance)\n            {\n                var connection = _appLifecycleManager.GetOnlineConnections().FirstOrDefault(c => c.Info.ApplicationId.Equals(request.AppId));\n                Log.Debug(\"Resolved connection for app {0} with mode {1} to online instance {{{2}}}\", connection, resolveMode, connection);\n                if (connection != null)\n                {\n                    return new ResolveAppResponse\n                    {\n                        AppInstanceId = connection.Info.ApplicationInstanceId.ToProto(),\n                        AppConnectionId = connection.Info.ConnectionId.ToProto(),\n                        IsNewInstanceLaunched = false,\n                    };\n                }\n            }\n\n            var resolvedConnection = await _appLifecycleManager.LaunchAndConnectAsync(\n                request.AppId, resolveMode, referrerConnectionInfo).ConfigureAwait(false);\n            var info = resolvedConnection.AppConnection.Info;\n            Log.Info(\"App connection {{{0}}} resolved by request from {{{1}}}\", resolvedConnection, context);\n            var response = new ResolveAppResponse\n            {\n                AppConnectionId = info.ConnectionId.ToProto(),\n                AppInstanceId = info.ApplicationInstanceId.ToProto(),\n                IsNewInstanceLaunched = resolvedConnection.IsNewInstance\n            };\n            return response;\n        }\n\n        public Task GetLifecycleEventStream(Empty request, IWritableChannel<AppLifecycleEvent> responseStream, MethodCallContext context)\n        {\n            return _appLifecycleEventBroadcaster.ObserveOn(TaskPoolScheduler.Default).PipeAsync(responseStream, context.CancellationToken);\n        }\n\n        public Task GetInvocationEventStream(Empty request, IWritableChannel<InvocationEvent> responseStream, MethodCallContext context)\n        {\n            return _invocationEventBroadcaster.ObserveOn(TaskPoolScheduler.Default).PipeAsync(responseStream, context.CancellationToken);\n        }\n\n        private static ResolveMode Convert(AppLaunchMode launchMode)\n        {\n            switch (launchMode)\n            {\n                case AppLaunchMode.SingleInstance:\n                    return ResolveMode.SingleInstance;\n                case AppLaunchMode.MultiInstance:\n                    return ResolveMode.MultiInstance;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(launchMode), launchMode, null);\n            }\n        }\n\n        public Task<GetConnectionsResponse> GetConnections(GetConnectionsRequest request, MethodCallContext context)\n        {\n            var response = CreateConnectionsResponse(GetOnlineConnections(request));\n            if (response.Connections.Count == 0 && IsSingleConnectionRequest(request))\n            {\n                if (IsSpecificConnectionId(request, out var connectionId))\n                {\n                    throw new InvalidOperationException($\"No connection with {connectionId} is found\");\n                }\n\n                if (IsSpecificAppIdWithInstanceId(request, out var appId, out var appInstanceId))\n                {\n                    throw new InvalidOperationException($\"No connection with for {appInstanceId} application instance id with {appId} app id is found\");\n                }\n            }\n\n            return Task.FromResult(response);\n        }\n\n        public async Task GetConnectionsStream(GetConnectionsRequest request, IWritableChannel<GetConnectionsEvent> responseStream, MethodCallContext context)\n        {\n            await _appLifecycleManager.ConnectionEventsStream\n                .Where(e => IsEventFitRequest(request, e.Connection))\n                .Select(e => CreateGetConnectionsEvent(request, e))\n                .Where(e => e != null)\n                .StartWith(CreateInitialGetConnectionsEvent(request))\n                .PipeAsync(responseStream);\n        }\n\n        private GetConnectionsEvent CreateInitialGetConnectionsEvent(GetConnectionsRequest request)\n        {\n            return new GetConnectionsEvent()\n            {\n                Connections = { GetOnlineConnections(request).Select(c => c.Info.ToProto()) }\n            };\n        }\n\n        private GetConnectionsEvent CreateGetConnectionsEvent(GetConnectionsRequest request, AppConnectionEvent appConnectionEvent)\n        {\n            var response = CreateInitialGetConnectionsEvent(request);\n            switch (appConnectionEvent.Type)\n            {\n                case ConnectionEventType.AppConnected:\n                    response.NewConnection = appConnectionEvent.Connection.ToProto();\n                    return response;\n                case ConnectionEventType.AppDisconnected:\n                    response.ClosedConnection = appConnectionEvent.Connection.ToProto();\n                    return response;\n                default:\n                    return null;\n            }\n        }\n\n        private static bool IsEventFitRequest(GetConnectionsRequest request, AppConnectionDescriptor connection)\n        {\n            var connectionId = request.ConnectionId.ToUniqueId();\n            if (connectionId != UniqueId.Empty)\n            {\n                return connectionId.Equals(connection.ConnectionId);\n            }\n            var appId = request.ApplicationId;\n            var appInstanceId = request.AppInstanceId.ToUniqueId();\n\n            if (appInstanceId != UniqueId.Empty && !connection.ApplicationInstanceId.Equals(appInstanceId))\n            {\n                return false;\n            }\n\n            if (!string.IsNullOrEmpty(appId) && !connection.ApplicationId.Equals(appId))\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n        private static bool IsSingleConnectionRequest(GetConnectionsRequest request)\n        {\n            return IsSpecificConnectionId(request, out _) || IsSpecificAppIdWithInstanceId(request, out _, out _);\n        }\n\n        private static bool IsSpecificConnectionId(GetConnectionsRequest request, out UniqueId connectionId)\n        {\n            connectionId = request.ConnectionId.ToUniqueId();\n            var isSpecificConnectionId = connectionId != UniqueId.Empty;\n            return isSpecificConnectionId;\n        }\n\n        private static bool IsSpecificAppIdWithInstanceId(GetConnectionsRequest request, out string appId, out UniqueId appInstanceId)\n        {\n            appId = request.ApplicationId;\n            appInstanceId = request.AppInstanceId.ToUniqueId();\n            var isSpecificAppIdWithInstanceId = !string.IsNullOrEmpty(appId) && appInstanceId != UniqueId.Empty;\n            return isSpecificAppIdWithInstanceId;\n        }\n\n        private IEnumerable<IAppConnection> GetOnlineConnections(GetConnectionsRequest request)\n        {\n            var connectionId = request.ConnectionId.ToUniqueId();\n            if (connectionId != UniqueId.Empty)\n            {\n                if (_appLifecycleManager.TryGetOnlineConnection(connectionId, out var connectionInfo))\n                {\n                    return new[] { connectionInfo };\n                }\n                return Enumerable.Empty<IAppConnection>();\n            }\n\n            var appId = request.ApplicationId;\n            var appInstanceId = request.AppInstanceId.ToUniqueId();\n\n            if (appInstanceId != UniqueId.Empty)\n            {\n                if (!string.IsNullOrEmpty(appId))\n                {\n                    if (_appLifecycleManager.TryGetOnlineConnection(appInstanceId, appId, out var connection))\n                    {\n                        return new[] { connection };\n                    }\n                }\n                return _appLifecycleManager.GetAppInstanceConnections(appInstanceId);\n            }\n\n            if (!string.IsNullOrEmpty(appId))\n            {\n                return _appLifecycleManager.GetAppConnections(appId);\n            }\n\n            return _appLifecycleManager.GetOnlineConnections();\n        }\n\n        private static GetConnectionsResponse CreateConnectionsResponse(IEnumerable<IAppConnection> connectionDescriptors)\n        {\n            return new GetConnectionsResponse()\n            {\n                Connections = { connectionDescriptors.Select(descriptor => descriptor.Info.ToProto()) }\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/AppMetadataServiceImpl.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using System;\n    using System.Linq;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using Plexus.Interop.Metamodel;\n\n    internal class AppMetadataServiceImpl : IAppMetadataService\n    {\n        private readonly BehaviorSubject<IRegistry> _metamodelSubject;\n        private readonly BehaviorSubject<AppRegistry> _appRegistrySubject;\n\n        public AppMetadataServiceImpl(IAppRegistryProvider appRegistryProvider, IRegistryProvider registryProvider)\n        {\n            _appRegistrySubject = new BehaviorSubject<AppRegistry>(appRegistryProvider.Current);\n            appRegistryProvider.Updated += registry => _appRegistrySubject.OnNext(registry);\n\n            _metamodelSubject = new BehaviorSubject<IRegistry>(registryProvider.Current);\n            registryProvider.Updated += registry => _metamodelSubject.OnNext(registry);\n        }\n\n        public async Task GetAppMetadataChangedEventStream(Empty request, IWritableChannel<AppMetadataChangedEvent> responseStream, MethodCallContext context)\n        {\n            await _appRegistrySubject.Select(ConvertToAppRegistryChangedEvent).PipeAsync(responseStream).ConfigureAwait(false);\n        }\n\n        public async Task GetMetamodelChangedEventStream(Empty request, IWritableChannel<MetamodelChangedEvent> responseStream, MethodCallContext context)\n        {\n            await _metamodelSubject.Select(ConvertToMetamodelChangedEvent).PipeAsync(responseStream).ConfigureAwait(false);\n        }\n\n        private static AppMetadataChangedEvent ConvertToAppRegistryChangedEvent(AppRegistry registry)\n        {\n            return new AppMetadataChangedEvent\n            {\n                Apps = { registry.Apps.Select(appInfo => new AppMetadataInfo\n                {\n                    Id = appInfo.Id,\n                    DisplayName = appInfo.DisplayName,\n                    LauncherId = appInfo.LauncherId,\n                    LauncherParams = { appInfo.LauncherParams.Select(pair => new OptionParameter {Key = pair.Key, Value = pair.Value.ToString() })}\n                })}\n            };\n        }\n\n        private MetamodelChangedEvent ConvertToMetamodelChangedEvent(IRegistry registry)\n        {\n            return new MetamodelChangedEvent\n            {\n                Applications = { registry.Applications.Values.Select(ConvertToAppMetamodelInfo) },\n                Services = { registry.Services.Values.Select(service => new Service\n                {\n                    Id = service.Id,\n                    Methods = { service.Methods.Values.Select(method => new MethodInfo\n                    {\n                        Name = method.Name,\n                        Type = ConvertToMethodType(method.Type),\n                        RequestMessageId = method.InputMessage.Id,\n                        ResponseMessageId = method.OutputMessage.Id,\n                    })}\n                })}\n            };\n        }\n\n        internal static AppMetamodelInfo ConvertToAppMetamodelInfo(IApplication appInfo)\n        {\n            return new AppMetamodelInfo\n            {\n                Id = appInfo.Id,\n                ConsumedServices = { appInfo.ConsumedServices.Select(service => new ConsumedService\n                {\n                    ServiceId = service.Service.Id,\n                    Alias = service.Alias.GetValueOrDefault(string.Empty),\n                    Methods = { service.Methods.Values.Select(method => new ConsumedMethod { Name = method.Method.Name })}\n                }) },\n                ProvidedServices = { appInfo.ProvidedServices.Select(service => new ProvidedService\n                {\n                    ServiceId = service.Service.Id,\n                    Alias = service.Alias.GetValueOrDefault(string.Empty),\n                    Methods = { service.Methods.Values.Select(method => new ProvidedMethod {\n                        Name = method.Method.Name,\n                        LaunchMode = ConvertLaunchMode(method.LaunchMode),\n                        Title = method.Title.GetValueOrDefault(string.Empty),\n                        TimeoutMs = method.TimeoutMs,\n                        Options = { method.Options.Select(option => new OptionParameter { Key = option.Id, Value = option.Value})}\n                    })}\n                }) },\n            };\n        }\n\n        private MethodInfo.Types.MethodType ConvertToMethodType(Metamodel.MethodType methodType)\n        {\n            switch (methodType)\n            {\n                case MethodType.Unary:\n                    return MethodInfo.Types.MethodType.Unary;\n                case MethodType.ServerStreaming:\n                    return MethodInfo.Types.MethodType.ServerStreaming;\n                case MethodType.ClientStreaming:\n                    return MethodInfo.Types.MethodType.ClientStreaming;\n                case MethodType.DuplexStreaming:\n                    return MethodInfo.Types.MethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(methodType), methodType, null);\n            }\n        }\n\n        private static ProvidedMethod.Types.MetamodelLaunchMode ConvertLaunchMode(Maybe<LaunchMode> methodLaunchMode)\n        {\n            switch (methodLaunchMode.GetValueOrDefault(LaunchMode.None))\n            {\n                case LaunchMode.None:\n                    return ProvidedMethod.Types.MetamodelLaunchMode.None;\n                case LaunchMode.SingleInstance:\n                    return ProvidedMethod.Types.MetamodelLaunchMode.SingleInstance;\n                case LaunchMode.MultiInstance:\n                    return ProvidedMethod.Types.MetamodelLaunchMode.MultiInstance;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/AppRegistrationServiceImpl.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using System.Threading.Tasks;\n    using Plexus.Interop;\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal class AppRegistrationServiceImpl : AppLifecycleManagerClient.IAppRegistrationServiceImpl\n    {\n        private readonly IAppLifecycleManager _appLifecycleManager;\n\n        public AppRegistrationServiceImpl(IAppLifecycleManager appLifecycleManager)\n        {\n            _appLifecycleManager = appLifecycleManager;\n        }\n\n        public Task<RegisterInstanceIdResponse> RegisterInstanceId(RegisterInstanceIdRequest request, MethodCallContext context)\n        {\n            RegisterInstanceId(request.AppInstanceId.ToUniqueId());\n            return Task.FromResult(new RegisterInstanceIdResponse());\n        }\n\n        public Task<UniqueId> RequestInstanceId(RequestInstanceIdRequest request, MethodCallContext context)\n        {\n            var appInstanceId = Plexus.UniqueId.Generate();\n            RegisterInstanceId(appInstanceId);\n            return Task.FromResult(appInstanceId.ToProto());\n        }\n\n        private void RegisterInstanceId(Plexus.UniqueId appInstanceId)\n            => _appLifecycleManager.RegisterAppInstance(appInstanceId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/ContextLinkage/AppConnectionsSet.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services.ContextLinkage\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n\n    internal class AppConnectionsSet\n    {\n        private readonly UniqueId _appInstanceId;\n\n        private readonly object _lock = new object();\n\n        private readonly HashSet<string> _loadingApps = new HashSet<string>();\n        private readonly Dictionary<string, AppConnectionDescriptor> _appConnectionMap = new Dictionary<string, AppConnectionDescriptor>();\n\n        private readonly BehaviorSubject<Unit> _updatedSubject = new BehaviorSubject<Unit>(Unit.Default);\n\n        public AppConnectionsSet(UniqueId appInstanceId)\n        {\n            _appInstanceId = appInstanceId;\n            UpdatedEventStream = _updatedSubject.ObserveOn(TaskPoolScheduler.Default);\n        }\n\n        public IObservable<Unit> UpdatedEventStream { get; }\n\n        public void AppLaunched(IEnumerable<string> appIds)\n        {\n            var updated = false;\n            lock (_lock)\n            {\n                foreach (var appId in appIds)\n                {\n                    if (!_appConnectionMap.ContainsKey(appId))\n                    {\n                        updated |= _loadingApps.Add(appId);\n                    }\n                }\n            }\n\n            if (updated)\n            {\n                _updatedSubject.OnNext(Unit.Default);\n            }\n        }\n\n        public void AppConnected(AppConnectionDescriptor appConnection)\n        {\n            var updated = false;\n            lock (_lock)\n            {\n                var appId = appConnection.ApplicationId;\n                if (!_appConnectionMap.TryGetValue(appId, out var existingAppConnection) \n                    || !Equals(appConnection, existingAppConnection))\n                {\n                    _appConnectionMap[appId] = appConnection;\n                    updated = true;\n                }\n                updated |= _loadingApps.Remove(appId);\n            }\n\n            if (updated)\n            {\n                _updatedSubject.OnNext(Unit.Default);\n            }\n        }\n\n        public void AppDisconnected(AppConnectionDescriptor appConnection)\n        {\n            var updated = false;\n            lock (_lock)\n            {\n                var appId = appConnection.ApplicationId;\n                updated |= _appConnectionMap.Remove(appId);\n                updated |= _loadingApps.Remove(appId);\n            }\n\n            if (updated)\n            {\n                _updatedSubject.OnNext(Unit.Default);\n            }\n        }\n\n        public IReadOnlyCollection<AppConnectionDescriptor> GetOnlineConnections()\n        {\n            lock (_lock)\n            {\n                return _appConnectionMap.Values.Where(descriptor => descriptor != null).ToArray();\n            }\n        }\n\n        public bool HasLoadingApps\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    return _loadingApps.Any();\n                }\n            }\n        }\n\n        public IReadOnlyCollection<(UniqueId AppInstanceId, string AppId, Maybe<UniqueId> ConnectionId)> GetConnections(bool online)\n        {\n            lock (_lock)\n            {\n                var connections = online \n                    ? _appConnectionMap.Select(pair => (_appInstanceId, pair.Value.ApplicationId, new Maybe<UniqueId>(pair.Value.ConnectionId))) \n                    : _loadingApps.Select(appId => (_appInstanceId, appId, Maybe<UniqueId>.Nothing));\n                return connections.Distinct().ToArray();\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/ContextLinkage/AppContextBindingEvent.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services.ContextLinkage\n{\n    internal class AppContextBindingEvent\n    {\n        public AppContextBindingEvent(Context context, UniqueId appInstanceId)\n        {\n            Context = context;\n            AppInstanceId = appInstanceId;\n        }\n\n        public Context Context { get; }\n        public UniqueId AppInstanceId { get; }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/ContextLinkage/Context.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services.ContextLinkage\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive;\n    using System.Reactive.Subjects;\n\n    internal class Context\n    {\n        private readonly IAppLifecycleManager _appLifecycleManager;\n\n        public string Id { get; } = Guid.NewGuid().ToString();\n        public string Kind { get; }\n        public UniqueId OwnerAppInstanceId { get; }\n\n        private readonly object _lock = new object();\n\n        private readonly Dictionary<UniqueId, AppConnectionsSet> _appInstanceIdsToConnections = new Dictionary<UniqueId, AppConnectionsSet>();\n\n        private readonly Subject<AppContextBindingEvent> _bindingSubject = new Subject<AppContextBindingEvent>();\n        private readonly BehaviorSubject<Unit> _contextUpdatedSubject = new BehaviorSubject<Unit>(Unit.Default);\n\n        public IObservable<AppContextBindingEvent> AppContextBindings => _bindingSubject;\n        public IObservable<Unit> ContextUpdatedEventStream => _contextUpdatedSubject;\n\n        public Context(IAppLifecycleManager appLifecycleManager, string kind, UniqueId ownerAppInstanceId)\n        {\n            _appLifecycleManager = appLifecycleManager;\n            Kind = string.IsNullOrEmpty(kind)\n                ? Guid.NewGuid().ToString()\n                : kind;\n            OwnerAppInstanceId = ownerAppInstanceId;\n        }\n\n        public void AppLaunched(UniqueId appInstanceId, IEnumerable<string> appIds)\n        {\n            _bindingSubject.OnNext(new AppContextBindingEvent(this, appInstanceId));\n            var appConnectionsSet = GetOrCreateAppConnectionsSet(appInstanceId);\n            appConnectionsSet.AppLaunched(appIds);\n\n            foreach (var appConnection in _appLifecycleManager.GetAppInstanceConnections(appInstanceId))\n            {\n                AppConnected(appConnection.Info);\n            }\n        }\n\n        public void AppConnected(AppConnectionDescriptor appConnection)\n        {\n            _bindingSubject.OnNext(new AppContextBindingEvent(this, appConnection.ApplicationInstanceId));\n            var appConnectionsSet = GetOrCreateAppConnectionsSet(appConnection.ApplicationInstanceId);\n            appConnectionsSet.AppConnected(appConnection);\n        }\n\n        public void AppDisconnected(AppConnectionDescriptor appConnection)\n        {\n            lock (_lock)\n            {\n                if (_appInstanceIdsToConnections.TryGetValue(appConnection.ApplicationInstanceId, out var appConnectionsSet))\n                {\n                    appConnectionsSet.AppDisconnected(appConnection);\n                }\n            }\n        }\n\n        private AppConnectionsSet GetOrCreateAppConnectionsSet(UniqueId appInstanceId)\n        {\n            AppConnectionsSet appConnectionsSet;\n            lock (_lock)\n            {\n                if (!_appInstanceIdsToConnections.TryGetValue(appInstanceId, out appConnectionsSet))\n                {\n                    appConnectionsSet = new AppConnectionsSet(appInstanceId);\n                    appConnectionsSet.UpdatedEventStream.Subscribe(AppConnectionUpdated);\n                    _appInstanceIdsToConnections[appInstanceId] = appConnectionsSet;\n                }\n            }\n\n            return appConnectionsSet;\n        }\n\n        private void AppConnectionUpdated(Unit unit)\n        {\n            _contextUpdatedSubject.OnNext(unit);\n        }\n\n        public IReadOnlyCollection<AppConnectionDescriptor> GetConnectedApps()\n        {\n            lock (_lock)\n            {\n                return _appInstanceIdsToConnections.Values.SelectMany(connections => connections.GetOnlineConnections()).ToArray();\n            }\n        }\n\n        public bool IsLoading\n        {\n            get\n            {\n                lock (_lock)\n                {\n                    return _appInstanceIdsToConnections.Values.Any(connectionsSet => connectionsSet.HasLoadingApps);\n                }\n            }\n        }\n\n        public IReadOnlyCollection<(UniqueId AppInstanceId, string AppId, Maybe<UniqueId> ConnectionId)> GetAppsInContext(bool online)\n        {\n            lock (_lock)\n            {\n                return _appInstanceIdsToConnections.Values.SelectMany(set => set.GetConnections(online)).ToArray();\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/ContextLinkage/ContextsSet.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services.ContextLinkage\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n\n    internal class ContextsSet\n    {\n        private readonly IAppLifecycleManager _appLifecycleManager;\n        private readonly Subject<AppContextBindingEvent> _appContextBindingSubject = new Subject<AppContextBindingEvent>();\n\n        private readonly object _lock = new object();\n\n        private readonly Dictionary<UniqueId, HashSet<Context>> _contextsOfAppInstance = new Dictionary<UniqueId, HashSet<Context>>();\n        private readonly Dictionary<string, Context> _contexts = new Dictionary<string, Context>();\n\n        public IObservable<AppContextBindingEvent> AppContextBindingEvents { get; }\n\n        public ContextsSet(IAppLifecycleManager appLifecycleManager)\n        {\n            _appLifecycleManager = appLifecycleManager;\n            AppContextBindingEvents = _appContextBindingSubject.ObserveOn(TaskPoolScheduler.Default);\n        }\n\n        public Context CreateContext(string kind, UniqueId ownerAppInstanceId)\n        {\n            var context = new Context(_appLifecycleManager, kind, ownerAppInstanceId);\n            _contexts[context.Id] = context;\n            context.AppContextBindings.Subscribe(BindContext);\n            return context;\n        }\n\n        public IReadOnlyCollection<Context> GetContextsOf(UniqueId appInstanceId)\n        {\n            lock (_lock)\n            {\n                if (_contextsOfAppInstance.TryGetValue(appInstanceId, out var contexts))\n                {\n                    return contexts.ToArray();\n                }\n            }\n            return new Context[0];\n        }\n\n        public Context GetContext(string contextId)\n        {\n            lock (_lock)\n            {\n                _contexts.TryGetValue(contextId, out var context);\n                return context;\n            }\n        }\n\n        private void BindContext(AppContextBindingEvent bindingEvent)\n        {\n            var appInstanceId = bindingEvent.AppInstanceId;\n            var context = bindingEvent.Context;\n            lock (_lock)\n            {\n                if (!_contextsOfAppInstance.TryGetValue(appInstanceId, out var contexts))\n                {\n                    contexts = new HashSet<Context>();\n                    _contextsOfAppInstance[appInstanceId] = contexts;\n                }\n\n                contexts.RemoveWhere(x => x.Kind == context.Kind);\n                if (contexts.Add(context))\n                {\n                    _appContextBindingSubject.OnNext(bindingEvent);\n                }\n            }\n        }\n\n        public IReadOnlyCollection<Context> GetAllContexts()\n        {\n            lock (_lock)\n            {\n                return _contexts.Values.ToArray();\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/ContextLinkageServiceImpl.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Diagnostics;\n    using System.Linq;\n    using System.Reactive;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n    using Plexus.Interop.Apps.Internal.Generated;\n    using Plexus.Interop.Apps.Internal.Services.ContextLinkage;\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Protocol;\n    using AppConnectionDescriptor = Plexus.AppConnectionDescriptor;\n    using Context = Plexus.Interop.Apps.Internal.Services.ContextLinkage.Context;\n    using ContextDto = Generated.Context;\n    using UniqueId = Plexus.UniqueId;\n\n    internal class ContextLinkageServiceImpl : AppLifecycleManagerClient.IContextLinkageServiceImpl, IContextLinkageManager\n    {\n        private ILogger Log { get; } = LogManager.GetLogger<ContextLinkageServiceImpl>();\n\n        private readonly IRegistryProvider _appRegistryProvider;\n        private readonly IAppLifecycleManager _appLifecycleManager;\n        private readonly ContextsSet _contextsSet;\n\n        public ContextLinkageServiceImpl(IRegistryProvider appRegistryProvider, IAppLifecycleManager appLifecycleManager, IAppLaunchedEventProvider appLaunchedEventProvider)\n        {\n            _appRegistryProvider = appRegistryProvider;\n            _appLifecycleManager = appLifecycleManager;\n            _contextsSet = new ContextsSet(appLifecycleManager);\n\n            appLaunchedEventProvider.AppLaunchedStream.Subscribe(OnAppLaunched);\n            appLifecycleManager.ConnectionEventsStream.Subscribe(OnAppConnectedOrDisconnected);\n        }\n\n        public Task<ContextDto> CreateContext(Empty request, MethodCallContext callContext)\n            => CreateContext2(new CreateContextRequest(), callContext);\n\n        public Task<ContextDto> CreateContext2(CreateContextRequest request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var newContext = _contextsSet.CreateContext(request.Kind, callContext.ConsumerApplicationInstanceId);\n                foreach (var appConnection in _appLifecycleManager.GetAppInstanceConnections(callContext.ConsumerApplicationInstanceId))\n                {\n                    newContext.AppConnected(appConnection.Info);\n                }\n                return ConvertContextToProto(newContext, callContext.ConsumerApplicationInstanceId);\n            });\n        }\n\n        private void OnAppLaunched(AppLaunchedEvent appLaunchedEvent)\n        {\n            if (appLaunchedEvent.AppIds.Count == 0)\n            {\n                return;\n            }\n\n            var refererAppContexts = _contextsSet.GetContextsOf(appLaunchedEvent.Referrer.AppInstanceId.ToUniqueId());\n\n            if (!refererAppContexts.Any())\n            {\n                return;\n            }\n\n            var appInstanceId = appLaunchedEvent.AppInstanceId.ToUniqueId();\n\n            foreach (var refererContext in refererAppContexts)\n            {\n                refererContext.AppLaunched(appInstanceId, appLaunchedEvent.AppIds);\n            }\n        }\n\n        private void OnAppConnectedOrDisconnected(AppConnectionEvent connectionEvent)\n        {\n            var connection = connectionEvent.Connection;\n            var contextsOfApp = _contextsSet.GetContextsOf(connection.ApplicationInstanceId);\n            foreach (var context in contextsOfApp)\n            {\n                switch (connectionEvent.Type)\n                {\n                    case ConnectionEventType.AppConnected:\n                        context.AppConnected(connection);\n                        break;\n                    case ConnectionEventType.AppDisconnected:\n                        context.AppDisconnected(connection);\n                        break;\n                }\n            }\n        }\n\n        public Task<Empty> JoinContext(ContextDto request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var context = _contextsSet.GetContext(request.Id);\n                if (context == null)\n                {\n                    throw new Exception($\"There is no context with {request.Id} id\");\n                }\n                foreach (var appConnection in _appLifecycleManager.GetAppInstanceConnections(callContext.ConsumerApplicationInstanceId))\n                {\n                    context.AppConnected(appConnection.Info);\n                }\n                return new Empty();\n            });\n        }\n\n        public Task<ContextsList> GetContexts(Empty request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var allContexts = _contextsSet.GetContextsOf(callContext.ConsumerApplicationInstanceId);\n                return new ContextsList\n                {\n                    Contexts = { allContexts.Select(context => ConvertContextToProto(context, callContext.ConsumerApplicationInstanceId)) }\n                };\n            });\n        }\n\n        public Task<InvocationsList> GetLinkedInvocations(ContextDto request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var context = _contextsSet.GetContext(request.Id);\n                if (context == null)\n                {\n                    throw new Exception($\"There is no context with {request.Id} id\");\n                }\n\n                return CreateInvocationsList(context);\n            });\n        }\n\n        public Task<ContextToInvocationsList> GetAllLinkedInvocations(Empty request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var allContexts = _contextsSet.GetAllContexts();\n                return new ContextToInvocationsList\n                {\n                    Contexts = { allContexts.Select(context => new ContextToInvocations\n                    {\n                        Context = ConvertContextToProto(context, callContext.ConsumerApplicationInstanceId),\n                        Invocations = CreateInvocationsList(context),\n                    })}\n                };\n            });\n        }\n\n        public async Task ContextLoadedStream(ContextDto request, IWritableChannel<ContextLoadingUpdate> responseStream, MethodCallContext callContext)\n        {\n            var context = _contextsSet.GetContext(request.Id);\n            if (context == null)\n            {\n                throw new Exception($\"There is no context with {request.Id} id\");\n            }\n\n            await Observable.Return(Unit.Default)\n                .Merge(context.ContextUpdatedEventStream)\n                .ObserveOn(TaskPoolScheduler.Default)\n                .Throttle(TimeSpan.FromMilliseconds(200))\n                .Select(_ => new ContextLoadingUpdate\n                {\n                    LoadedAppDescriptors =\n                    {\n                        context.GetConnectedApps().Select(ConvertToProto)\n                    },\n                    Status = context.IsLoading ? ContextLoadingStatus.InProgress : ContextLoadingStatus.Finished,\n                })\n                .DistinctUntilChanged()\n                .Do(update =>\n                {\n                    Log.Debug(\n                        $\"Sending context linkage update for context {context.Id}: LoadedAppDescriptorsCount={update.LoadedAppDescriptors.Count}\");\n                })\n                .PipeAsync(responseStream, callContext.CancellationToken);\n        }\n\n        private InvocationsList CreateInvocationsList(Context context)\n        {\n            return new InvocationsList\n            {\n                Invocations =\n                {\n                    context.GetConnectedApps().Select(connection => new InvocationRef\n                    {\n                        Target = ConvertToProto(connection),\n                        AppInfo = GetAppInfo(connection.ApplicationId),\n                    })\n                }\n            };\n        }\n\n        private static Generated.AppConnectionDescriptor ConvertToProto(AppConnectionDescriptor connection)\n        {\n            return new Generated.AppConnectionDescriptor\n            {\n                AppInstanceId = connection.ApplicationInstanceId.ToProto(),\n                AppId = connection.ApplicationId,\n                ConnectionId = connection.ConnectionId.ToProto(),\n            };\n        }\n\n        private AppMetamodelInfo GetAppInfo(string appId)\n        {\n            var appInfo = _appRegistryProvider.Current.Applications[appId];\n            return AppMetadataServiceImpl.ConvertToAppMetamodelInfo(appInfo);\n        }\n\n        public bool IsContextShouldBeConsidered(IContextLinkageOptions contextLinkageOptions, IAppConnection sourceConnection)\n        {\n            return contextLinkageOptions != null\n                   && contextLinkageOptions.Mode != ContextLinkageDiscoveryMode.None\n                   && GetApplicationContexts(contextLinkageOptions, sourceConnection).Any();\n        }\n\n        public IReadOnlyCollection<(UniqueId AppInstanceId, string AppId, Maybe<UniqueId> ConnectionId)> GetAppsInContexts(IContextLinkageOptions contextLinkageOptions, IAppConnection sourceConnection, bool online)\n        {\n            return GetApplicationContexts(contextLinkageOptions, sourceConnection)\n                .Select(id => _contextsSet.GetContext(id))\n                .Where(context => context != null)\n                .SelectMany(context => context.GetAppsInContext(online))\n                .Distinct().ToArray();\n        }\n\n        private IReadOnlyCollection<string> GetApplicationContexts(IContextLinkageOptions contextLinkageOptions, IAppConnection sourceConnection)\n        {\n            switch (contextLinkageOptions.Mode)\n            {\n                case ContextLinkageDiscoveryMode.CurrentContext:\n                    return _contextsSet.GetContextsOf(sourceConnection.Info.ApplicationInstanceId)\n                        .Select(context => context.Id).ToArray();\n                case ContextLinkageDiscoveryMode.SpecificContext when contextLinkageOptions.SpecificContext.HasValue:\n                    return new[] { contextLinkageOptions.SpecificContext.Value };\n                default:\n                    return new string[0];\n            }\n        }\n\n        public Task AppJoinedContextStream(Empty request, IWritableChannel<AppJoinedContextEvent> responseStream, MethodCallContext callContext)\n        {\n            return _contextsSet.AppContextBindingEvents\n                .Select(ev => new AppJoinedContextEvent\n                {\n                    AppInstanceId = ev.AppInstanceId.ToProto(),\n                    Context = ConvertContextToProto(ev.Context, ev.AppInstanceId)\n                })\n                .PipeAsync(responseStream, callContext.CancellationToken);\n        }\n\n        public Task<RestoreContextsLinkageResponse> RestoreContextsLinkage(RestoreContextsLinkageRequest request, MethodCallContext callContext)\n        {\n            return Task.Factory.StartNew(() =>\n            {\n                var newCreatedContexts = new Dictionary<string, Context>();\n                var contextsOwners = request.Apps\n                    .SelectMany(app => app.Contexts\n                        .Where(ctx => ctx.Own)\n                        .Select(ctx => new\n                        {\n                            app.AppInstanceId,\n                            ContextId = ctx.Id\n                        }))\n                    .GroupBy(x => x.ContextId)\n                    .ToDictionary(xs => xs.Key, xs => xs.First().AppInstanceId.ToUniqueId());\n\n                foreach (var restoringAppInstance in request.Apps)\n                {\n                    var contexts = restoringAppInstance.Contexts.Count > 0\n                        ? restoringAppInstance.Contexts\n                        : restoringAppInstance.ContextIds.Select(id => new ContextDto { Id = id });\n\n                    foreach (var context in contexts)\n                    {\n                        if (!newCreatedContexts.TryGetValue(context.Id, out var newContext))\n                        {\n                            if (!contextsOwners.TryGetValue(context.Id, out var ownerAppInstanceId))\n                                ownerAppInstanceId = default;\n\n                            newContext = _contextsSet.CreateContext(context.Kind, ownerAppInstanceId);\n                            newCreatedContexts[context.Id] = newContext;\n                        }\n                        newContext.AppLaunched(restoringAppInstance.AppInstanceId.ToUniqueId(), restoringAppInstance.AppIds);\n                    }\n                }\n\n                var response = new RestoreContextsLinkageResponse();\n                foreach (var pair in newCreatedContexts)\n                {\n                    response.CreatedContextsMap[pair.Key] = ConvertContextToProto(pair.Value, callContext.ConsumerApplicationInstanceId);\n                }\n                return response;\n            });\n        }\n\n        private static ContextDto ConvertContextToProto(Context context, UniqueId appInstanceId) => new ContextDto\n        {\n            Id = context.Id,\n            Own = context.OwnerAppInstanceId == appInstanceId,\n            Kind = context.Kind\n        };\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/IAppLifecycleService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal interface IAppLifecycleService : IInvocationEventProvider, AppLifecycleManagerClient.IAppLifecycleServiceImpl\n    {\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/Services/IAppMetadataService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps.Internal.Services\n{\n    using Plexus.Interop.Apps.Internal.Generated;\n\n    internal interface IAppMetadataService : AppLifecycleManagerClient.IAppMetadataServiceImpl\n    { \n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Internal/SubProcessLauncher.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps.Internal\n{\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n\n    internal sealed class SubProcessLauncher\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<SubProcessLauncher>();\n\n        private readonly string _curPid = Process.GetCurrentProcess().Id.ToString();\n\n        public UniqueId Launch(string cmd, string args, string workingDir = null)\n        {\n            Log.Debug(\"Launching process: {0} {1}\", cmd, args);\n            cmd = Path.GetFullPath(cmd);\n            workingDir = workingDir ?? Path.GetDirectoryName(cmd);            \n            var process = new Process\n            {\n                StartInfo = new ProcessStartInfo(cmd)\n                {\n                    WorkingDirectory = workingDir,\n                    Arguments = args,\n                    RedirectStandardOutput = false,\n                    RedirectStandardInput = false,                    \n                    RedirectStandardError = false,                    \n                    CreateNoWindow = true,\n                    UseShellExecute = false,\n                }\n            };\n\n            var appInstanceId = UniqueId.Generate();\n\n#if NETSTANDARD2_0\n            process.StartInfo.Environment[EnvironmentHelper.ParentProcessIdVarName] = _curPid;\n            process.StartInfo.Environment[EnvironmentHelper.BrokerWorkingDirVarName] = Directory.GetCurrentDirectory();\n            process.StartInfo.Environment[EnvironmentHelper.AppInstanceIdVarName] = appInstanceId.ToString();\n#else\n            process.StartInfo.EnvironmentVariables[EnvironmentHelper.ParentProcessIdVarName] = _curPid;\n            process.StartInfo.EnvironmentVariables[EnvironmentHelper.BrokerWorkingDirVarName] = Directory.GetCurrentDirectory();\n            process.StartInfo.EnvironmentVariables[EnvironmentHelper.AppInstanceIdVarName] = appInstanceId.ToString();\n#endif\n\n            if (!process.Start())\n            {\n                throw new InvalidOperationException($\"Process {cmd} failed to start\");\n            }\n\n            return appInstanceId;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager/Plexus.Interop.Apps.Manager.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Apps</RootNamespace>    \n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Apps.Manager.Contracts\\Plexus.Interop.Apps.Manager.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Contracts\\Plexus.Interop.Metamodel.Contracts.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Reactive\">\n      <Version>3.1.1</Version>\n    </PackageReference>\n    <PackageReference Include=\"System.Reactive.PlatformServices\" Version=\"3.1.1\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/AppConnectionEvent.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    public class AppConnectionEvent\n    {\n        public AppConnectionEvent(AppConnectionDescriptor connection, ConnectionEventType type)\n        {\n            Connection = connection;\n            Type = type;\n        }\n\n        public AppConnectionDescriptor Connection { get; }\n\n        public ConnectionEventType Type { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/ConnectionEventType.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    public enum ConnectionEventType\n    {\n        AppConnected = 0,\n        AppDisconnected = 1,\n        AppConnectionError = 2,\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IAppConnectedEventProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    using System;\n\n    public interface IAppConnectedEventProvider\n    {\n        IObservable<AppConnectionEvent> ConnectionEventsStream { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IAppConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Threading.Tasks;\n\n    public interface IAppConnection\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n\n        AppConnectionDescriptor Info { get; }\n\n        ValueTask<ITransportChannel> CreateChannelAsync();\n\n        IReadableChannel<ITransportChannel> IncomingChannels { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IAppLifecycleManager.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Transport;\n\n    public interface IAppLifecycleManager : IAppConnectedEventProvider\n    {\n        IAppConnection AcceptConnection(ITransportConnection connection, AppConnectionDescriptor connectionInfo);\n\n        bool TryRemoveConnection(IAppConnection connection);\n\n        void ReportConnectionError(AppConnectionDescriptor connectionInfo);\n\n        bool TryGetOnlineConnection(UniqueId connectionId, out IAppConnection connection);\n\n        bool TryGetOnlineConnection(UniqueId appInstanceId, string app, out IAppConnection connection);\n\n        IReadOnlyCollection<IAppConnection> GetOnlineConnections();\n        \n        IEnumerable<string> FilterCanBeLaunched(IEnumerable<string> appIds);\n\n        bool CanBeLaunched(string appId);\n\n        Task<ResolvedConnection> LaunchAndConnectAsync(string appId, ResolveMode mode, AppConnectionDescriptor referrerConnectionInfo);\n\n        IReadOnlyCollection<IAppConnection> GetAppInstanceConnections(UniqueId appInstanceId);\n\n        IReadOnlyCollection<IAppConnection> GetAppConnections(string appId);\n\n        bool TryGetConnectionInProgress(UniqueId appInstanceId, string appId, out Task<IAppConnection> appConnection);\n        void RegisterAppInstanceConnection(string appId, UniqueId appInstanceId);\n\n        void RegisterAppInstance(UniqueId appInstanceId);\n        bool IsAppInstanceRegistered(UniqueId appInstanceId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IContextLinkageManager.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    using System.Collections.Generic;\n    using Plexus.Interop.Protocol;\n\n    public interface IContextLinkageManager\n    {\n        bool IsContextShouldBeConsidered(IContextLinkageOptions contextLinkageOptions, IAppConnection sourceConnection);\n\n        IReadOnlyCollection<(UniqueId AppInstanceId, string AppId, Maybe<UniqueId> ConnectionId)> GetAppsInContexts(IContextLinkageOptions contextLinkageOptions, IAppConnection sourceConnection, bool online);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IInteropContext.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    using System.Threading.Tasks;\n    using Plexus.Interop.Metamodel;\n\n    public interface IInteropContext\n    {\n        Task StartAsync();\n        Task StopAsync();\n        IRegistryProvider RegistryProvider { get; }\n        IAppLifecycleManager AppLifecycleManager { get; }\n        IInvocationEventProvider InvocationEventProvider { get; }\n        IContextLinkageManager ContextLinkageManager { get; }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/IInvocationEventProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    public interface IInvocationEventProvider\n    {\n        void OnInvocationStarted(InvocationStartedEventDescriptor eventData);\n\n        void OnInvocationFinished(InvocationFinishedEventDescriptor eventData);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/InvocationDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    public sealed class InvocationDescriptor\n    {\n        public InvocationDescriptor(\n            AppConnectionDescriptor sourceConnection, \n            AppConnectionDescriptor targetConnection, \n            string serviceId, \n            string serviceAlias, \n            string methodId)\n        {\n            SourceConnection = sourceConnection;\n            TargetConnection = targetConnection;\n            ServiceId = serviceId;\n            ServiceAlias = serviceAlias;\n            MethodId = methodId;\n        }\n\n        public AppConnectionDescriptor SourceConnection { get; }\n        public AppConnectionDescriptor TargetConnection { get; }\n        public string ServiceId { get; }\n        public string ServiceAlias { get; }\n        public string MethodId { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(SourceConnection)}: {SourceConnection}, {nameof(TargetConnection)}: {TargetConnection}, {nameof(ServiceId)}: {ServiceId}, {nameof(ServiceAlias)}: {ServiceAlias}, {nameof(MethodId)}: {MethodId}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/InvocationFinishedEventDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    public sealed class InvocationFinishedEventDescriptor\n    {\n        public InvocationFinishedEventDescriptor(\n            InvocationDescriptor methodCallDescriptor, \n            InvocationResult result, \n            long durationMs)\n        {\n            MethodCallDescriptor = methodCallDescriptor;\n            Result = result;\n            DurationMs = durationMs;\n        }\n\n        public InvocationDescriptor MethodCallDescriptor { get; }\n        public InvocationResult Result { get; }\n        public long DurationMs { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(MethodCallDescriptor)}: {MethodCallDescriptor}, {nameof(Result)}: {Result}, {nameof(DurationMs)}: {DurationMs}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/InvocationResult.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    public enum InvocationResult\n    {\n        Succeeded,\n        Canceled,\n        Failed\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/InvocationStartedEventDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Apps\n{\n    public sealed class InvocationStartedEventDescriptor\n    {\n        public InvocationStartedEventDescriptor(InvocationDescriptor invocationDescriptor)\n        {\n            InvocationDescriptor = invocationDescriptor;\n        }\n\n        public InvocationDescriptor InvocationDescriptor { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(InvocationDescriptor)}: {{{InvocationDescriptor}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/Plexus.Interop.Apps.Manager.Contracts.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\" ToolsVersion=\"15.0\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Interop.Apps.Manager.Contracts</AssemblyName>\n    <RootNamespace>Plexus.Interop.Apps</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Contracts\\Plexus.Interop.Metamodel.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Contracts\\Plexus.Interop.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/ResolveMode.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    public enum ResolveMode\n    {\n        SingleInstance,\n        MultiInstance\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Apps.Manager.Contracts/ResolvedConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Apps\n{\n    public struct ResolvedConnection\n    {\n        public ResolvedConnection(IAppConnection appConnection, bool isNewInstance)\n        {\n            AppConnection = appConnection;\n            IsNewInstance = isNewInstance;\n        }\n\n        public IAppConnection AppConnection { get; }\n\n        public bool IsNewInstance { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/BrokerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using Plexus.Interop.Metamodel;\n\n    public sealed class BrokerFactory\n    {\n        public static BrokerFactory Instance = new BrokerFactory();\n\n        public IBroker Create(BrokerOptions options, IRegistryProvider registryProvider = null)\n        {\n            return new Internal.Broker(options, registryProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/BrokerIsAlreadyRunningException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n\n    [Serializable]\n    public class BrokerIsAlreadyRunningException : Exception\n    {\n        public BrokerIsAlreadyRunningException(string workingDir)\n            : base($\"Another broker instance is already running in directory {workingDir}\")\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/BrokerOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    public sealed class BrokerOptions\n    {\n        public string MetadataDir { get; }\n        public uint Port { get; }\n        public uint WssPort { get; }\n\n        public BrokerOptions(\n            string metadataDir,\n            uint port,\n            uint wssPort)\n        {\n            MetadataDir = metadataDir;\n            Port = port;\n            WssPort = wssPort;\n        }\n\n        public override string ToString() => string.Join(\", \",\n            $\"{nameof(MetadataDir)}: {MetadataDir}\",\n            $\"{nameof(Port)}: {Port}\",\n            $\"{nameof(WssPort)}: {WssPort}\");\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/IBroker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n\n    public interface IBroker\n    {\n        Task Completion { get; }\n\n        Task StartAsync();\n        void Stop();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/Internal/Broker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal\n{\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Broker;\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Metamodel.Json;\n    using Plexus.Interop.Protocol.Protobuf;\n    using Plexus.Interop.Transport;\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Transmission.Pipes;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server;\n    using Plexus.Processes;\n    using System.Collections.Generic;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Linq;\n    using System.Reflection;\n    using System.Security.Cryptography.X509Certificates;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps.Internal;\n    using ILogger = Plexus.ILogger;\n    using LogManager = Plexus.LogManager;\n    using System;\n\n    internal sealed class Broker : ProcessBase, IBroker\n    {\n        private static readonly ProtobufTransportProtocolSerializationProvider DefaultTransportSerializationProvider\n            = new ProtobufTransportProtocolSerializationProvider();\n\n        private static readonly ProtobufProtocolSerializerFactory DefaultProtocolSerializationProvider\n            = new ProtobufProtocolSerializerFactory();\n\n        private readonly BrokerFeatures _features;\n        private readonly string _workingDir;\n        private readonly ServerConnectionListener _connectionListener;\n        private readonly IBrokerProcessor _brokerProcessor;\n        private readonly IReadOnlyCollection<ITransportServer> _transportServers;\n        private readonly IInteropContext _interopContext;\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<Broker>();\n\n        public Broker(BrokerOptions options, IRegistryProvider registryProvider = null)\n        {\n            _features = EnvironmentHelper.GetBrokerFeatures();\n            Log.Info($\"Broker features: {_features}\");\n            var trustedLauncherId = EnvironmentHelper.GetLauncherAppInstanceId();\n            Log.Info($\"App launcher application instance id: {trustedLauncherId}\");\n            if (_features.HasFlag(BrokerFeatures.CheckAppInstanceId) && trustedLauncherId == null)\n                throw new BrokerException($\"{EnvironmentHelper.LauncherId} must be defined if {BrokerFeatures.CheckAppInstanceId} set.\");\n            _workingDir = Directory.GetCurrentDirectory();\n            var binDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);\n            var studioDir = Path.Combine(binDir, \"studio\");\n            Log.Info(\"Studio dir: {0}\", studioDir);\n            var metadataDir = Path.GetFullPath(options.MetadataDir ?? Path.Combine(_workingDir, \"metadata\"));\n            Log.Info(\"Metadata dir: {0}\", metadataDir);\n            var metadataFile = Path.Combine(metadataDir, \"interop.json\");\n            IReadOnlyDictionary<string, string> staticFileMapping = new Dictionary<string, string>\n            {\n                {\"/metadata/interop\", metadataFile},\n                {\"/studio\", studioDir}\n            };\n            var webSocketTransmissionServerOptions = new WebSocketTransmissionServerOptions(_workingDir, options.Port, staticFileMapping);\n            var transportServers = new List<ITransportServer>\n            {\n                TransportServerFactory.Instance.Create(\n                    TransportType.Pipe,\n                    PipeTransmissionServerFactory.Instance.Create(_workingDir),\n                    DefaultTransportSerializationProvider),\n                TransportServerFactory.Instance.Create(\n                    TransportType.Ws,\n                    WebSocketTransmissionServerFactory.Instance.Create(webSocketTransmissionServerOptions),\n                    DefaultTransportSerializationProvider),\n            };\n            if (_features.HasFlag(BrokerFeatures.UseWSS))\n            {\n                var certificate = GetCertificate();\n                if (certificate != null)\n                {\n                    var wssTransmissionServerOptions = new WebSocketTransmissionServerOptions(_workingDir, options.WssPort, staticFileMapping);\n                    var sslProtocols = EnvironmentHelper.GetSslProtocols();\n                    Log.Info($\"{EnvironmentHelper.SslProtocols}={sslProtocols}\");\n                    transportServers.Add(TransportServerFactory.Instance.Create(\n                        TransportType.Wss,\n                        WebSocketTransmissionServerFactory.Instance.CreateSecure(wssTransmissionServerOptions, certificate, sslProtocols),\n                        DefaultTransportSerializationProvider));\n                }\n            }\n            _transportServers = transportServers;\n            _connectionListener = new ServerConnectionListener(_transportServers);\n            registryProvider = registryProvider ?? new JsonRegistryProvider(Path.Combine(metadataDir, \"interop.json\"));\n            _interopContext = InteropContextFactory.Instance.Create(trustedLauncherId ?? default, metadataDir, registryProvider);\n            _brokerProcessor = BrokerProcessorFactory.Instance.Create(\n                _connectionListener.In,\n                DefaultProtocolSerializationProvider,\n                _interopContext,\n                _features);\n            OnStop(_connectionListener.Stop);\n        }\n\n        private X509Certificate2 GetCertificate()\n        {\n            try\n            {\n                var certificatePath = EnvironmentHelper.GetCertificatePath();\n                if (string.IsNullOrEmpty(certificatePath))\n                    throw new BrokerException($\"{EnvironmentHelper.CertificatePath} must be defined if {BrokerFeatures.UseWSS} set.\");\n\n                var certificatePassword = EnvironmentHelper.GetCertificatePassword();\n                if (string.IsNullOrEmpty(certificatePassword))\n                {\n                    Log.Info($\"{EnvironmentHelper.CertificatePassword} is empty, try open certificate without password.\");\n                    return new X509Certificate2(certificatePath);\n                }\n                var flags = EnvironmentHelper.GetCertificateKeyStorageFlags();\n                Log.Info($\"{EnvironmentHelper.CertificateKeyStorageFlags}={flags}\");\n                return new X509Certificate2(certificatePath, certificatePassword, flags);\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Exception occured while creating certificate\");\n                return null;\n            }\n        }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Info(\"Starting broker in directory {0}\", _workingDir);\n            await Task\n                .WhenAll(\n                    _connectionListener.StartAsync(),\n                    _brokerProcessor.StartAsync(),\n                    _interopContext.StartAsync())\n                .ConfigureAwait(false);\n            Log.Info(\"Broker started in directory {0}\", _workingDir);\n            return ProcessAsync();\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _brokerProcessor.Completion.ConfigureAwait(false);\n            }\n            finally\n            {\n                await _interopContext.StopAsync().IgnoreExceptions().ConfigureAwait(false);\n                await Task.WhenAll(_transportServers.Select(x => x.StopAsync())).ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/Internal/ServerConnectionListener.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Transport;\n    using Plexus.Processes;\n\n    internal sealed class ServerConnectionListener : ProcessBase\n    {\n        private readonly IReadOnlyCollection<ITransportServer> _servers;\n        private readonly IChannel<ITransportConnection> _buffer = new BufferedChannel<ITransportConnection>(3);\n\n        public ServerConnectionListener(IEnumerable<ITransportServer> servers)\n        {\n            _servers = servers.ToList();\n        }\n\n        public IReadableChannel<ITransportConnection> In => _buffer.In;\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<ServerConnectionListener>();\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            var startTasks = _servers.Select(StartServerAsync).ToArray();\n            await Task.WhenAll(startTasks).IgnoreExceptions().ConfigureAwait(false);\n            var servers = startTasks.Where(t => t.Status == TaskStatus.RanToCompletion).Select(t => t.GetResult());\n            OnStop(() => _buffer.Out.TryComplete());\n            return ProcessAsync(servers);\n        }\n\n        private async Task<ITransportServer> StartServerAsync(ITransportServer server)\n        {\n            try\n            {\n                OnStop(server.Stop);\n                await server.StartAsync().ConfigureAwait(false);\n                return server;\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Server failed to start: {{{0}}}\", server);\n                throw;\n            }\n        }\n\n        private async Task ProcessAsync(IEnumerable<ITransportServer> servers)\n        {\n            await Task.WhenAll(servers.Select(ProcessAsync)).IgnoreExceptions().ConfigureAwait(false);\n            Log.Debug(\"All servers stopped\");\n            _buffer.Out.TryComplete();\n        }\n\n        private async Task ProcessAsync(ITransportServer server)\n        {\n            try\n            {\n                await server.In.ConsumeAsync(ProcessAsync).ConfigureAwait(false);\n                Log.Debug(\"Server completed: {{{0}}}\", server);\n            }\n            catch (OperationCanceledException) when (CancellationToken.IsCancellationRequested)\n            {\n                Log.Debug(\"Server stopped: {{{0}}}\", server);\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Exception on server listening: {{{0}}}\", server);\n            }            \n        }\n\n        private async Task ProcessAsync(ITransportConnection connection)\n        {\n            try\n            {\n                await _buffer.Out.WriteAsync(connection).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                connection.TryTerminate(ex);\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker/Plexus.Interop.Broker.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Apps.Manager\\Plexus.Interop.Apps.Manager.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Broker.Core\\Plexus.Interop.Broker.Core.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Json\\Plexus.Interop.Metamodel.Json.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Protobuf\\Plexus.Interop.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck.csproj\" Condition=\"'$(TargetFramework)' == 'net45'\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server\\Plexus.Interop.Transport.Transmission.WebSockets.Server.csproj\" Condition=\"'$(TargetFramework)' == 'netstandard2.0'\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport\\Plexus.Interop.Transport.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/BrokerException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus.Interop.Broker\n{\n    public sealed class BrokerException : Exception\n    {\n        public BrokerException(string message, Exception innerException = null) : base(message, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/BrokerProcessorFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Broker.Internal;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n\n    public sealed class BrokerProcessorFactory\n    {\n        public static BrokerProcessorFactory Instance = new BrokerProcessorFactory();\n\n        public IBrokerProcessor Create(\n            IReadableChannel<ITransportConnection> incomingConnections, \n            IProtocolSerializerFactory protocolSerializerFactory,\n            IInteropContext interopContext,\n            BrokerFeatures features)\n        {\n            return new BrokerProcessor(\n                incomingConnections,\n                protocolSerializerFactory,\n                interopContext,\n                features);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Generate.cmd",
    "content": "plexus gen-json-meta -b ..\\..\\..\\dsl\\interop-lang\\src\\main\\resources -o Internal -v\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/IBrokerProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker\n{\n    using System.Threading.Tasks;\n\n    public interface IBrokerProcessor\n    {\n        Task Completion { get; }\n\n        Task StartAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/AppConnectionProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n\n    internal sealed class AppConnectionProcessor : IAppConnectionProcessor\n    {\n        private readonly ILogger _log;\n\n        private readonly IAppConnection _connection;\n        private readonly IClientRequestHandler _clientRequestHandler;\n        private readonly Dictionary<ITransportChannel, Task> _handleChannelTasks = new Dictionary<ITransportChannel, Task>();\n\n        public AppConnectionProcessor(IAppConnection connection, IClientRequestHandler clientRequestHandler)\n        {\n            _connection = connection;\n            Id = _connection.Id;\n            _log = LogManager.GetLogger<AppConnectionProcessor>(Id.ToString());\n            _clientRequestHandler = clientRequestHandler;\n        }\n\n        public UniqueId Id { get; }\n\n        public async Task ProcessAsync(Action connectionCompletedAction)\n        {\n            _log.Debug(\"Listening for incoming channels: {0}\", _connection);\n            var listenChannelTask = _connection.IncomingChannels.ConsumeAsync((Action<ITransportChannel>)HandleChannel).IgnoreExceptions();\n\n            await listenChannelTask.ConfigureAwait(false);\n            _log.Debug($\"Listening for incoming channels completed: {_connection}\");\n\n            connectionCompletedAction();\n\n            await _connection.Completion.ConfigureAwait(false);\n            _log.Debug($\"Connection completed: {_connection}\");\n\n            Task completion;\n            lock (_handleChannelTasks)\n            {\n                completion = Task.WhenAll(_handleChannelTasks.Values);\n                _log.Debug($\"Waiting to completion of {_handleChannelTasks.Count} running channels ({string.Join(\", \", _handleChannelTasks.Keys.Select(channel => channel.Id))}) tasks of {_connection}\");\n            }\n            await completion.ConfigureAwait(false);\n            _log.Debug($\"Completed processing running tasks of connection {_connection}\");\n        }\n\n        private void HandleChannel(ITransportChannel channel)\n        {\n            _log.Debug(\"Processing new channel {0} from connection {1}\", channel.Id, _connection);\n            var task = TaskRunner.RunInBackground(HandleChannelAsync, channel);\n            lock (_handleChannelTasks)\n            {\n                _handleChannelTasks.Add(channel, task);\n            }\n            task.ContinueWithSynchronously((Action<Task, object>)OnTaskCompleted, channel);\n        }\n\n        private async Task HandleChannelAsync(object state)\n        {\n            ITransportChannel channel = null;\n            try\n            {\n                channel = (ITransportChannel)state;\n                await _clientRequestHandler.HandleChannelAsync(_connection, channel).ConfigureAwait(false);\n                _log.Debug(\"Channel {0} completed\", channel.Id);\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, \"Exception on handling channel {0}\", channel?.Id);\n            }\n        }\n\n        private void OnTaskCompleted(Task task, object state)\n        {\n            var channel = (ITransportChannel)state;\n            _log.Debug($\"Completed processing of channel {channel.Id} from connection {_connection} in state {task.Status}\");\n            lock (_handleChannelTasks)\n            {\n                _handleChannelTasks.Remove(channel);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/AuthenticationHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol.Connect;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Protocol;\n\n    internal sealed class AuthenticationHandler : IAuthenticationHandler\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<AuthenticationHandler>();\n\n        private readonly IAppLifecycleManager _connectionTracker;        \n        private readonly IConnectProtocolMessageFactory _messageFactory;\n        private readonly IConnectProtocolSerializer _serializer;\n        private readonly IRegistryService _registryService;\n        private readonly BrokerFeatures _features;\n\n        public AuthenticationHandler(\n            IAppLifecycleManager connectionTracker,\n            IProtocolImplementation protocol,\n            IRegistryService registryService,\n            BrokerFeatures features)\n        {\n            _messageFactory = protocol.MessageFactory;\n            _serializer = protocol.Serializer;\n            _connectionTracker = connectionTracker;\n            _registryService = registryService;\n            _features = features;\n        }\n\n        public async Task<AppConnectionDescriptor> AuthenticateAsync(ITransportConnection connection)\n        {\n            Log.Trace(\"Accepting new connection {0}\", connection.Id);\n            var channel = await connection.IncomingChannels.ReadAsync().ConfigureAwait(false);\n            var frame = await channel.In.ReadAsync().ConfigureAwait(false);\n            using (var payload = frame.Payload)\n            using (var connectRequest = _serializer.DeserializeConnectRequest(payload))\n            {\n                if (!_registryService.IsApplicationDefined(connectRequest.ApplicationId))\n                {\n                    throw new BrokerException($\"Connection rejected because application id is unknown to broker: {connectRequest.ApplicationId}\");\n                }\n                if (!_connectionTracker.IsAppInstanceRegistered(connectRequest.ApplicationInstanceId))\n                {\n                    Log.Debug(\"Connection with unknown application instance id: \"\n                        + $\"ApplicationInstanceId={connectRequest.ApplicationInstanceId}, ApplicationId={connectRequest.ApplicationId}\");\n                    _connectionTracker.ReportConnectionError(new AppConnectionDescriptor(\n                        UniqueId.Empty,\n                        connectRequest.ApplicationId,\n                        connectRequest.ApplicationInstanceId,\n                        connection.TransportType));\n\n                    if (_features.HasFlag(BrokerFeatures.CheckAppInstanceId))\n                    {\n                        throw new BrokerException(\"Connection rejected because application instance id is unknown to broker: \"\n                            + $\"ApplicationInstanceId={connectRequest.ApplicationInstanceId}, ApplicationId={connectRequest.ApplicationId}\");\n                    }\n                }\n                using (var connectResponse = _messageFactory.CreateConnectResponse(connection.Id))\n                {\n                    var serializedResponse = _serializer.Serialize(connectResponse);\n                    try\n                    {\n                        Log.Trace(\"Sending connect response ({0} bytes): {1}\", connectResponse, serializedResponse.Count);\n                        await channel.Out.WriteAsync(new TransportMessageFrame(serializedResponse)).ConfigureAwait(false);\n                    }\n                    catch\n                    {\n                        serializedResponse.Dispose();\n                        throw;\n                    }\n                    channel.Out.TryComplete();\n                    await channel.Completion.ConfigureAwait(false);\n                    return new AppConnectionDescriptor(\n                        connectResponse.ConnectionId,\n                        connectRequest.ApplicationId,\n                        connectRequest.ApplicationInstanceId,\n                        connection.TransportType);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/BrokerProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Broker.Internal\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using Plexus.Processes;\n\n    internal sealed class BrokerProcessor : ProcessBase, IBrokerProcessor\n    {        \n        private static readonly IProtocolMessageFactory DefaultProtocolMessageFactory = ProtocolMessagePool.Instance;\n\n        private readonly ConcurrentDictionary<UniqueId, ITransportConnection> _activeConnections\n            = new ConcurrentDictionary<UniqueId, ITransportConnection>();\n\n        private readonly IReadableChannel<ITransportConnection> _incomingConnections;\n        private readonly IAppLifecycleManager _appLifecycleManager;\n        private readonly AuthenticationHandler _authenticationHandler;\n        private readonly ClientRequestHandler _clientRequestHandler;\n\n        public BrokerProcessor(\n            IReadableChannel<ITransportConnection> incomingConnections,\n            IProtocolSerializerFactory serializerFactory,\n            IInteropContext interopContext,\n            BrokerFeatures features)\n        {\n            _incomingConnections = incomingConnections;\n            var registryService = new RegistryService(interopContext.RegistryProvider);\n            var protocol = new ProtocolImplementation(DefaultProtocolMessageFactory, serializerFactory);\n            _appLifecycleManager = interopContext.AppLifecycleManager;\n            _authenticationHandler = new AuthenticationHandler(interopContext.AppLifecycleManager, protocol, registryService, features);\n            _clientRequestHandler = new ClientRequestHandler(interopContext.AppLifecycleManager, protocol, registryService, interopContext.InvocationEventProvider, interopContext.ContextLinkageManager);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<BrokerProcessor>();\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            return Task.FromResult(ProcessAsync());\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                while (true)\n                {\n                    var transportConnectionResult = await _incomingConnections.TryReadAsync().ConfigureAwait(false);\n                    if (transportConnectionResult.HasValue)\n                    {\n                        var transportConnection = transportConnectionResult.Value;\n                        _activeConnections.TryAdd(transportConnection.Id, transportConnection);\n                        TaskRunner\n                            .RunInBackground(ProcessConnectionAsync, transportConnection)\n                            .ContinueWithSynchronously((Action<Task, object>)OnConnectionProcessed, transportConnection)\n                            .IgnoreAwait(Log);\n                    }\n                    else\n                    {\n                        Log.Trace(\"Transport connection listening completed\");\n                        break;\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                var activeConnections = _activeConnections.Values.ToArray();\n                _activeConnections.Clear();\n                foreach (var activeConnection in activeConnections)\n                {\n                    activeConnection.TryTerminate(ex);\n                }\n                throw;\n            }\n            finally\n            {\n                var activeConnections = _activeConnections.Values.ToArray();\n                _activeConnections.Clear();\n                if (activeConnections.Length > 0)\n                {\n                    Log.Info(\"Terminating {0} active connections\", activeConnections.Length);\n                    foreach (var activeConnection in activeConnections)\n                    {\n                        Log.Trace(\"Terminating connection {0}\", activeConnection);\n                        activeConnection.TryTerminate();\n                    }\n                    await Task.WhenAll(activeConnections.Select(x => x.Completion.IgnoreExceptions())).ConfigureAwait(false);\n                    Log.Info(\"Terminated {0} active connections\", activeConnections.Length);\n                }\n            }\n        }\n\n        private async Task ProcessConnectionAsync(object state)\n        {\n            var transportConnection = (ITransportConnection) state;\n            Log.Debug(\"Accepting new incoming connection {0}\", transportConnection.Id);\n            var appConnectionDescriptor = await _authenticationHandler.AuthenticateAsync(transportConnection).ConfigureAwait(false);\n\n            Log.Debug(\"New connection authenticated: {0}\", appConnectionDescriptor);\n            var clientConnection = _appLifecycleManager.AcceptConnection(transportConnection, appConnectionDescriptor);\n            try\n            {\n                Log.Info(\"New connection accepted: {0}\", clientConnection);\n                var clientConnectionProcessor = new AppConnectionProcessor(clientConnection, _clientRequestHandler);\n                await clientConnectionProcessor.ProcessAsync(() => _appLifecycleManager.TryRemoveConnection(clientConnection)).ConfigureAwait(false);\n            }\n            finally\n            {\n                _appLifecycleManager.TryRemoveConnection(clientConnection);\n            }\n        }\n\n        private void OnConnectionProcessed(Task completion, object state)\n        {\n            var connection = (ITransportConnection)state;\n            if (completion.IsCanceled)\n            {\n                Log.Info(\"Connection {0} canceled\", connection.Id);\n                connection.TryTerminate();\n            }\n            else if (completion.IsFaulted)\n            {\n                Log.Warn(completion.Exception.ExtractInner(), \"Connection {0} failed\", connection.Id);\n                connection.TryTerminate(completion.Exception.ExtractInner());\n            }\n            else\n            {\n                Log.Info(\"Connection {0} completed\", connection.Id);\n                connection.TryComplete();\n            }            \n            _activeConnections.TryRemove(connection.Id, out _);\n            connection.IncomingChannels.ConsumeAsync(_ => { }).IgnoreExceptions().IgnoreAwait(Log);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/BrokerRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Metamodel.Json;\n    using System;\n    using System.Reflection;\n\n    internal sealed class BrokerRegistryProvider : IRegistryProvider, IDisposable\n    {\n        private readonly IRegistryProvider _baseRegistryProvider;\n        private readonly IRegistry _embeddedRegistry;\n\n        public BrokerRegistryProvider(IRegistryProvider baseRegistryProvider)\n        {\n            _baseRegistryProvider = baseRegistryProvider;\n            var type = typeof(BrokerRegistryProvider);\n            _embeddedRegistry = JsonRegistry.LoadRegistry(type.GetTypeInfo().Assembly.GetManifestResourceStream(type.Namespace + \".interop.json\"));\n            Current = _embeddedRegistry.MergeWith(baseRegistryProvider.Current);\n            _baseRegistryProvider.Updated += OnUpdated;\n        }\n\n        public IRegistry Current { get; private set; }\n\n        public event Action<IRegistry> Updated = registry => { };\n\n        private void OnUpdated(IRegistry registry)\n        {\n            Current = _embeddedRegistry.MergeWith(registry);\n            Updated(Current);\n        }\n\n        public void Dispose()\n        {\n            _baseRegistryProvider.Updated -= OnUpdated;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/ClientRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n\n    internal sealed class ClientRequestHandler : IClientRequestHandler\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<ClientRequestHandler>();\n\n        private readonly IProtocolSerializer _protocolSerializer;\n        private readonly ClientToBrokerRequestHandler<Task, (IAppConnection, ITransportChannel)> _clientToBrokerRequestHandler;\n        private readonly IDiscoveryRequestHandler _discoveryRequestHandler;\n        private readonly IInvocationRequestHandler _invocationRequestHandler;\n\n        public ClientRequestHandler(\n            IAppLifecycleManager appLifecycleManager,\n            IProtocolImplementation protocol,\n            IRegistryService registryService,\n            IInvocationEventProvider invocationEventProvider,\n            IContextLinkageManager contextLinkageManager)\n        {\n            _protocolSerializer = protocol.Serializer;\n            _discoveryRequestHandler = new DiscoveryRequestHandler(appLifecycleManager, protocol, registryService, contextLinkageManager);\n            _invocationRequestHandler = new InvocationRequestHandler(appLifecycleManager, protocol, registryService, invocationEventProvider, contextLinkageManager);\n            _clientToBrokerRequestHandler =\n                new ClientToBrokerRequestHandler<Task, (IAppConnection, ITransportChannel)>(\n                    HandleInvocationAsync,\n                    HandleDiscoveryAsync,\n                    HandleDiscoveryAsync);\n        }\n\n        public async Task HandleChannelAsync(IAppConnection connection, ITransportChannel channel)\n        {\n            try\n            {\n                Log.Debug(\"Starting processing new request {0} from {1}\", channel, connection);\n                var frame = await channel.In.ReadAsync().ConfigureAwait(false);\n                var request = _protocolSerializer.DeserializeClientToBrokerRequest(frame.Payload);\n                await request.Handle(_clientToBrokerRequestHandler, (connection, channel)).ConfigureAwait(false);\n                channel.Out.TryComplete();\n            }\n            catch (Exception ex)\n            {\n                channel.Out.TryTerminate(ex);\n            }\n            finally\n            {\n                await channel.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private async Task HandleDiscoveryAsync(\n            IServiceDiscoveryRequest request,\n            (IAppConnection SourceConnection, ITransportChannel SourceChannel) args)\n        {\n            var (sourceConnection, sourceChannel) = args;\n            await _discoveryRequestHandler.HandleAsync(request, sourceConnection, sourceChannel).ConfigureAwait(false);\n        }\n\n        private async Task HandleDiscoveryAsync(IMethodDiscoveryRequest request, (IAppConnection, ITransportChannel) args)\n        {\n            var (sourceConnection, sourceChannel) = args;\n            await _discoveryRequestHandler.HandleAsync(request, sourceConnection, sourceChannel).ConfigureAwait(false);\n        }\n\n        private async Task HandleInvocationAsync(\n            IInvocationStart request,\n            (IAppConnection SourceConnection, ITransportChannel SourceChannel) args)\n        {\n            var (sourceConnection, sourceChannel) = args;\n            await _invocationRequestHandler.HandleAsync(request, sourceConnection, sourceChannel).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/DiscoveryRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using MethodType = Plexus.Interop.Protocol.Discovery.MethodType;\n\n    internal sealed class DiscoveryRequestHandler : IDiscoveryRequestHandler\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<DiscoveryRequestHandler>();\n\n        private readonly IProtocolImplementation _protocol;\n        private readonly IRegistryService _registryService;\n        private readonly IContextLinkageManager _contextLinkageManager;\n        private readonly IAppLifecycleManager _appLifecycleManager;\n\n        public DiscoveryRequestHandler(\n            IAppLifecycleManager appLifecycleManager,\n            IProtocolImplementation protocol,\n            IRegistryService registryService,\n            IContextLinkageManager contextLinkageManager)\n        {\n            _appLifecycleManager = appLifecycleManager;\n            _protocol = protocol;\n            _registryService = registryService;\n            _contextLinkageManager = contextLinkageManager;\n        }\n\n        public async Task HandleAsync(\n            IServiceDiscoveryRequest request,\n            IAppConnection sourceConnection,\n            ITransportChannel sourceChannel)\n        {\n            IReadOnlyCollection<(IConsumedMethod Consumed, IProvidedMethod Provided)> methodMatches;\n            if (request.ConsumedService.HasValue)\n            {\n                methodMatches = _registryService.GetMethodMatches(\n                    sourceConnection.Info.ApplicationId,\n                    request.ConsumedService.Value);\n            }\n            else\n            {\n                methodMatches = _registryService.GetMethodMatches(sourceConnection.Info.ApplicationId);\n            }\n            IEnumerable<IGrouping<(IConsumedService ConsumedService, IProvidedService ProvidedService, Maybe<UniqueId> ConnectionId, Maybe<UniqueId> ApplicationInstanceId), IProvidedMethod>> groupedMethods;\n\n            var online = request.DiscoveryMode == DiscoveryMode.Online;\n            if (_contextLinkageManager.IsContextShouldBeConsidered(request.ContextLinkageOptions, sourceConnection))\n            {\n                groupedMethods = _contextLinkageManager.GetAppsInContexts(request.ContextLinkageOptions, sourceConnection, online)\n                    .Join(methodMatches, x => x.AppId, y => y.Provided.ProvidedService.Service.Id,\n                        (x, y) => (y.Consumed, y.Provided, x.AppInstanceId, x.ConnectionId))\n                    .GroupBy(x => (x.Consumed.ConsumedService, x.Provided.ProvidedService, x.ConnectionId, new Maybe<UniqueId>(x.AppInstanceId)), x => x.Provided);\n            }\n            else\n            {\n                if (online)\n                {\n                    var onlineConnections = _appLifecycleManager.GetOnlineConnections();\n                    groupedMethods = methodMatches\n                        .Join(onlineConnections, x => x.Provided.ProvidedService.Application.Id,\n                            y => y.Info.ApplicationId,\n                            (x, y) => (Match: x, ConnectionId: y.Id, y.Info.ApplicationInstanceId))\n                        .GroupBy(\n                            x => (\n                                x.Match.Consumed.ConsumedService,\n                                x.Match.Provided.ProvidedService,\n                                new Maybe<UniqueId>(x.ConnectionId),\n                                new Maybe<UniqueId>(x.ApplicationInstanceId)),\n                            x => x.Match.Provided);\n                }\n                else\n                {\n                    var providerApps = methodMatches.Select(x => x.Provided.ProvidedService.Application.Id).Distinct()\n                        .ToArray();\n                    var availableProviderApps = FilterAvailableApps(providerApps);\n                    groupedMethods = methodMatches\n                        .Join(\n                            availableProviderApps, \n                            x => x.Provided.ProvidedService.Application.Id, \n                            y => y,\n                            (x, y) => x)\n                        .GroupBy(\n                            x => (\n                                x.Consumed.ConsumedService,\n                                x.Provided.ProvidedService,\n                                ConnectionId: Maybe<UniqueId>.Nothing,\n                                ApplicationInstanceId: Maybe<UniqueId>.Nothing),\n                            x => x.Provided);\n                }\n            }\n\n            var discoveredServices =\n                from s in groupedMethods\n                let consumedService = s.Key.ConsumedService\n                let providedService = s.Key.ProvidedService\n                let connectionId = s.Key.ConnectionId\n                let applicationInstanceId = s.Key.ApplicationInstanceId\n                select _protocol.MessageFactory.CreateDiscoveredService(\n                    _protocol.MessageFactory.CreateConsumedServiceReference(\n                        consumedService.Service.Id,\n                        consumedService.Alias),\n                    _protocol.MessageFactory.CreateProvidedServiceReference(\n                        providedService.Service.Id,\n                        providedService.Alias,\n                        providedService.Application.Id,\n                        connectionId,\n                        applicationInstanceId),\n                    s.Key.ProvidedService.Title,\n                    s.Select(m =>\n                            _protocol.MessageFactory.CreateDiscoveredServiceMethod(\n                                m.Method.Name,\n                                m.Title,\n                                m.Method.InputMessage.Id,\n                                m.Method.OutputMessage.Id,\n                                Convert(m.Method.Type),\n                                m.Options.Select(o => _protocol.MessageFactory.CreateOption(o.Id, o.Value)).ToList()))\n                        .ToList());\n            using (var response = _protocol.MessageFactory.CreateServiceDiscoveryResponse(discoveredServices.ToList()))\n            {\n                Log.Info(\"Completed service discovery request {{{0}}} from {{{1}}}: {2}\", request, sourceConnection, response);\n                var serializedResponse = _protocol.Serializer.Serialize(response);\n                try\n                {\n                    await sourceChannel.Out\n                        .WriteAsync(new TransportMessageFrame(serializedResponse))\n                        .ConfigureAwait(false);\n                }\n                catch\n                {\n                    serializedResponse.Dispose();\n                    throw;\n                }\n            }\n        }\n\n        public async Task HandleAsync(\n            IMethodDiscoveryRequest request,\n            IAppConnection sourceConnection,\n            ITransportChannel sourceChannel)\n        {\n            Log.Info(\"Handling method discovery request {{{0}}} from {{{1}}}\", request, sourceConnection);\n            var appId = sourceConnection.Info.ApplicationId;\n            IEnumerable<IProvidedMethod> matchingProvidedMethods =\n                request.ConsumedMethod.HasValue\n                    ? _registryService.GetMatchingProvidedMethods(appId, request.ConsumedMethod.Value)\n                    : _registryService.GetMatchingProvidedMethods(appId);\n            if (request.InputMessageId.HasValue)\n            {\n                matchingProvidedMethods = matchingProvidedMethods\n                    .Where(x => string.Equals(x.Method.InputMessage.Id, request.InputMessageId.Value));\n            }\n            if (request.OutputMessageId.HasValue)\n            {\n                matchingProvidedMethods = matchingProvidedMethods\n                    .Where(x => string.Equals(x.Method.OutputMessage.Id, request.OutputMessageId.Value));\n            }\n            IEnumerable<IDiscoveredMethod> discoveredMethods;\n\n            bool online = request.DiscoveryMode == DiscoveryMode.Online;\n            if (_contextLinkageManager.IsContextShouldBeConsidered(request.ContextLinkageOptions, sourceConnection))\n            {\n                discoveredMethods = _contextLinkageManager.GetAppsInContexts(request.ContextLinkageOptions, sourceConnection, online)\n                    .Join(matchingProvidedMethods, x => x.AppId, y => y.ProvidedService.Application.Id,\n                        (connection, method) => (method, connection))\n                    .Select(pm => Convert(pm.method, pm.connection.ConnectionId,\n                        new Maybe<UniqueId>(pm.connection.AppInstanceId)));\n            }\n            else\n            {\n                if (online)\n                {\n                    var onlineConnections = _appLifecycleManager.GetOnlineConnections();\n                    discoveredMethods = matchingProvidedMethods\n                        .Join(\n                            onlineConnections,\n                            x => x.ProvidedService.Application.Id,\n                            y => y.Info.ApplicationId,\n                            (method, connection) => (method, connection))\n                        .Select(pm => Convert(pm.method, pm.connection.Id, pm.connection.Info.ApplicationInstanceId));\n                }\n                else\n                {\n                    var providedMethods = matchingProvidedMethods.ToArray();\n                    var providerApps = providedMethods.Select(x => x.ProvidedService.Application.Id).Distinct().ToArray();\n                    var availableProviderApps = FilterAvailableApps(providerApps);\n                    discoveredMethods = providedMethods\n                        .Join(availableProviderApps, x => x.ProvidedService.Application.Id, y => y, (x, y) => x)\n                        .Select(pm => Convert(pm, Maybe<UniqueId>.Nothing, Maybe<UniqueId>.Nothing));\n                }\n            }\n            \n            using (var response = _protocol.MessageFactory.CreateMethodDiscoveryResponse(discoveredMethods.ToList()))\n            {\n                Log.Info(\"Completed method discovery request {{{0}}} from {{{1}}}: {2}\", request, sourceConnection, response);\n                var serializedResponse = _protocol.Serializer.Serialize(response);\n                try\n                {\n                    await sourceChannel.Out\n                        .WriteAsync(new TransportMessageFrame(serializedResponse))\n                        .ConfigureAwait(false);\n                }\n                catch\n                {\n                    serializedResponse.Dispose();\n                    throw;\n                }\n            }\n        }\n\n        private IDiscoveredMethod Convert(IProvidedMethod pm, Maybe<UniqueId> connectionId, Maybe<UniqueId> appInstanceId)\n        {\n            return _protocol.MessageFactory.CreateDiscoveredMethod(\n                _protocol.MessageFactory.CreateProvidedMethodReference(\n                    _protocol.MessageFactory.CreateProvidedServiceReference(\n                        pm.ProvidedService.Service.Id,\n                        pm.ProvidedService.Alias,\n                        pm.ProvidedService.Application.Id,\n                        connectionId,\n                        appInstanceId),\n                    pm.Method.Name),\n                pm.Title,\n                pm.Method.InputMessage.Id,\n                pm.Method.OutputMessage.Id,\n                Convert(pm.Method.Type),\n                pm.Options.Select(x => _protocol.MessageFactory.CreateOption(x.Id, x.Value)).ToList()\n            );\n        }\n\n        private static MethodType Convert(Metamodel.MethodType methodType)\n        {\n            switch (methodType)\n            {\n                case Metamodel.MethodType.Unary:\n                    return MethodType.Unary;\n                case Metamodel.MethodType.ServerStreaming:\n                    return MethodType.ServerStreaming;\n                case Metamodel.MethodType.ClientStreaming:\n                    return MethodType.ClientStreaming;\n                case Metamodel.MethodType.DuplexStreaming:\n                    return MethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(methodType), methodType, null);\n            }\n        }\n\n        private IEnumerable<string> FilterAvailableApps(string[] providerApps)\n        {\n            var launchableProviderApps = _appLifecycleManager.FilterCanBeLaunched(providerApps);\n            var onlineApps = _appLifecycleManager.GetOnlineConnections().Select(x => x.Info.ApplicationId).Distinct();\n            var onlineProviderApps = providerApps.Intersect(onlineApps);\n            var availableProviderApps = launchableProviderApps.Union(onlineProviderApps);\n            return availableProviderApps;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IAppConnectionProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker.Internal\n{\n    using System;\n    using System.Threading.Tasks;\n\n    internal interface IAppConnectionProcessor\n    {\n        UniqueId Id { get; }\n\n        Task ProcessAsync(Action connectionCompletedAction);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IAuthenticationHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using System.Threading.Tasks;\n    using Plexus.Interop.Transport;\n\n    internal interface IAuthenticationHandler\n    {\n        Task<AppConnectionDescriptor> AuthenticateAsync(ITransportConnection connection);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IClientRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n\n    internal interface IClientRequestHandler\n    {\n        Task HandleChannelAsync(IAppConnection connection, ITransportChannel channel);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IDiscoveryRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n\n    internal interface IDiscoveryRequestHandler\n    {\n        Task HandleAsync(\n            IServiceDiscoveryRequest request, \n            IAppConnection sourceConnection, \n            ITransportChannel sourceChannel);\n\n        Task HandleAsync(\n            IMethodDiscoveryRequest request, \n            IAppConnection sourceConnection, \n            ITransportChannel sourceChannel);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IInvocationRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Apps;\n\n    internal interface IInvocationRequestHandler\n    {\n        Task HandleAsync(IInvocationStart request, IAppConnection sourceConnection, ITransportChannel sourceChannel);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/IRegistryService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Protocol;\n    using System.Collections.Generic;\n\n    internal interface IRegistryService\n    {\n        IApplication GetApplication(string appId);\n\n        IConsumedService GetConsumedService(string appId, IConsumedServiceReference reference);\n\n        IConsumedMethod GetConsumedMethod(string appId, IConsumedMethodReference reference);\n\n        IProvidedService GetProvidedService(IProvidedServiceReference reference);\n\n        IProvidedMethod GetProvidedMethod(IProvidedMethodReference reference);\n\n        IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(IConsumedMethod consumedMethod);\n\n        IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(string appId, IConsumedMethodReference reference);        \n\n        IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(IApplication application);\n\n        IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(string appId);\n\n        bool IsApplicationDefined(string appId);\n\n        IReadOnlyCollection<(IConsumedMethod Consumed, IProvidedMethod Provided)> GetMethodMatches(\n            string appId,\n            IConsumedServiceReference consumedServiceReference);\n\n        IReadOnlyCollection<(IConsumedMethod Consumed, IProvidedMethod Provided)> GetMethodMatches(string appId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/InvocationRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Apps;\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Diagnostics;\n    using System.Linq;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class InvocationRequestHandler : IInvocationRequestHandler\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<InvocationRequestHandler>();\n        \n        private readonly Stopwatch _stopwatch = new Stopwatch();\n        private readonly IAppLifecycleManager _appLifecycleManager;\n        private readonly IRegistryService _registryService;\n        private readonly IInvocationEventProvider _invocationEventProvider;\n        private readonly IContextLinkageManager _contextLinkageManager;\n        private readonly IProtocolMessageFactory _protocolMessageFactory;\n        private readonly IProtocolSerializer _protocolSerializer;\n        private readonly InvocationTargetHandler<IInvocationStartRequested, IAppConnection> _createRequestHandler;\n        private readonly InvocationTargetHandler<ValueTask<IAppConnection>, IAppConnection, ITransportChannel, IContextLinkageOptions> _resolveTargetConnectionHandler;\n\n        private readonly object _resolveConnectionSync = new object();\n\n        public InvocationRequestHandler(\n            IAppLifecycleManager appLifecycleManager,\n            IProtocolImplementation protocol,\n            IRegistryService registryService,\n            IInvocationEventProvider invocationEventProvider,\n            IContextLinkageManager contextLinkageManager)\n        {\n            _appLifecycleManager = appLifecycleManager;            \n            _protocolMessageFactory = protocol.MessageFactory;\n            _protocolSerializer = protocol.Serializer;\n            _registryService = registryService;\n            _invocationEventProvider = invocationEventProvider;\n            _contextLinkageManager = contextLinkageManager;\n            _createRequestHandler = new InvocationTargetHandler<IInvocationStartRequested, IAppConnection>(CreateInvocationTarget, CreateInvocationTarget);\n            _resolveTargetConnectionHandler = new InvocationTargetHandler<ValueTask<IAppConnection>, IAppConnection, ITransportChannel, IContextLinkageOptions>(ResolveTargetConnectionAsync, ResolveTargetConnectionAsync);\n            _stopwatch.Start();\n        }\n        \n        public async Task HandleAsync(IInvocationStart request, IAppConnection sourceConnection, ITransportChannel sourceChannel)\n        {\n            IAppConnection targetConnection = null;\n            ITransportChannel targetChannel = null;\n            InvocationDescriptor callDescriptor = null;\n            var startMs = _stopwatch.ElapsedMilliseconds;\n            try\n            {\n                Log.Info(\"Handling invocation {0} from {{{1}}}: {{{2}}}\", sourceChannel.Id, sourceConnection, request);\n\n                targetConnection = await request.Target.Handle(_resolveTargetConnectionHandler, sourceConnection, sourceChannel, request.ContextLinkageOptions).ConfigureAwait(false);\n                Log.Debug($\"Resolved target connection {targetConnection} for invocation {sourceChannel.Id} from {{{sourceConnection}}}: {{{request}}}\");\n\n                targetChannel = await targetConnection.CreateChannelAsync().ConfigureAwait(false);\n                Log.Debug(\"Created channel {0} for invocation {1} from {{{2}}} to {{{3}}}: {{{4}}}\", targetChannel.Id, sourceChannel.Id, sourceConnection, targetConnection, request);\n\n                using (var invocationStarting = _protocolMessageFactory.CreateInvocationStarting())\n                {\n                    var serialized = _protocolSerializer.Serialize(invocationStarting);\n                    try\n                    {\n                        await sourceChannel.Out.WriteAsync(new TransportMessageFrame(serialized)).ConfigureAwait(false);\n                        Log.Debug($\"Sent starting event for invocation {sourceChannel.Id}\");\n                    }\n                    catch\n                    {\n                        serialized.Dispose();\n                        throw;\n                    }\n                }                \n                using (var invocationRequested = request.Target.Handle(_createRequestHandler, sourceConnection))\n                {\n                    startMs = _stopwatch.ElapsedMilliseconds;\n                    callDescriptor = new InvocationDescriptor(\n                        sourceConnection.Info, \n                        targetConnection.Info, \n                        invocationRequested.ServiceId, \n                        invocationRequested.ServiceAlias.GetValueOrDefault(), \n                        invocationRequested.MethodId);\n                    _invocationEventProvider.OnInvocationStarted(new InvocationStartedEventDescriptor(callDescriptor));\n                    var serialized = _protocolSerializer.Serialize(invocationRequested);\n                    try\n                    {\n                        await targetChannel.Out.WriteAsync(new TransportMessageFrame(serialized)).ConfigureAwait(false);\n                        Log.Debug($\"Sent requested event for invocation {targetChannel.Id} to {targetConnection} (for invocation {sourceChannel.Id})\");\n                    }\n                    catch\n                    {\n                        serialized.Dispose();\n                        throw;\n                    }\n                }\n\n                var fromSourceToTarget = TaskRunner.RunInBackground(() => PropagateAsync(sourceChannel, targetChannel));\n                var fromTargetToSource = TaskRunner.RunInBackground(() => PropagateAsync(targetChannel, sourceChannel));\n\n                await Task.WhenAll(fromSourceToTarget, fromTargetToSource).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                sourceChannel.Out.TryTerminate(ex);\n                targetChannel?.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                try\n                {\n                    await Task\n                        .WhenAll(\n                            targetChannel?.In.ConsumeAsync((Action<TransportMessageFrame>)DisposeFrame).IgnoreExceptions() ?? TaskConstants.Completed,\n                            sourceChannel.In.ConsumeAsync((Action<TransportMessageFrame>)DisposeFrame).IgnoreExceptions(),\n                            targetChannel?.Completion ?? TaskConstants.Completed,\n                            sourceChannel.Completion)\n                        .ConfigureAwait(false);\n                    Log.Info(\"Completed invocation {0} from {{{1}}} to {{{2}}}: {{{3}}}\", sourceChannel.Id, sourceConnection, targetConnection, request);\n                    OnActionFinished(callDescriptor, InvocationResult.Succeeded, startMs);\n                }\n                catch (OperationCanceledException)\n                {\n                    Log.Info(\"Canceled invocation {0} from {{{1}}} to {{{2}}}: {{{3}}}\", sourceChannel.Id, sourceConnection, targetConnection, request);\n                    OnActionFinished(callDescriptor, InvocationResult.Canceled, startMs);\n                    throw;\n                }\n                catch (Exception ex)\n                {\n                    Log.Warn(\"Failed invocation {0} from {{{1}}} to {{{2}}}: {{{3}}}. Error: {4}\", sourceChannel.Id, sourceConnection, targetConnection, request, ex.FormatTypeAndMessage());\n                    OnActionFinished(callDescriptor, InvocationResult.Failed, startMs);\n                    throw;\n                }\n            }\n        }\n\n        private void OnActionFinished(InvocationDescriptor callDescriptor, InvocationResult callResult, long startMs)\n        {\n            if (callDescriptor == null)\n            {\n                return;\n            }\n            _invocationEventProvider.OnInvocationFinished(\n                new InvocationFinishedEventDescriptor(\n                    callDescriptor,\n                    callResult,\n                    _stopwatch.ElapsedMilliseconds - startMs));\n        }\n\n        private async ValueTask<IAppConnection> ResolveTargetConnectionAsync(\n            IProvidedMethodReference methodReference, \n            IAppConnection source, \n            ITransportChannel sourceChannel,\n            IContextLinkageOptions contextLinkageOptions)\n        {\n            if (methodReference.ProvidedService.ConnectionId.HasValue)\n            {\n                var connectionId = methodReference.ProvidedService.ConnectionId.Value;\n                if (!_appLifecycleManager.TryGetOnlineConnection(connectionId, out var connection))\n                {\n                    throw new InvalidOperationException($\"The requested connection {connectionId} is not online\");\n                }\n                return connection;\n            }\n\n            var appId = methodReference.ProvidedService.ApplicationId;\n\n            if (methodReference.ProvidedService.ApplicationInstanceId.HasValue)\n            {\n                var appInstanceId = methodReference.ProvidedService.ApplicationInstanceId.Value;\n                if (appId.HasValue && _appLifecycleManager.TryGetConnectionInProgress(appInstanceId, appId.Value, out var connectionInProgress))\n                {\n                    return await connectionInProgress;\n                }\n                var connections = _appLifecycleManager.GetAppInstanceConnections(appInstanceId).ToList();\n                if (connections.Count == 0)\n                {\n                    throw new InvalidOperationException($\"App instance {appInstanceId} is doesn't have online connections\");\n                }\n\n                if (appId.HasValue)\n                {\n                    var connection = connections.FirstOrDefault(c => c.Info.ApplicationId.Equals(appId.Value));\n                    if (connection == null)\n                    {\n                        throw new InvalidOperationException($\"App instance {appInstanceId} is doesn't have connection with {appId.Value} application id\");\n                    }\n                    return connection;\n                }\n\n                if (connections.Count == 1)\n                {\n                    return connections.Single();\n                }\n\n                throw new InvalidOperationException($\"App instance {appInstanceId} has several connections, you need to specify ApplicationId to make call to specific connection\");\n            }\n\n            if (!appId.HasValue)\n            {\n                throw new InvalidOperationException($\"AppId is required to resolve target connection for {methodReference} provided method reference\");\n            }\n            var appIdValue = appId.Value;\n\n            var method = _registryService.GetProvidedMethod(methodReference);\n            var launchMode = GetLaunchMode(method);\n\n            Task<ResolvedConnection> resolveTask;\n            lock (_resolveConnectionSync)\n            {\n                if (launchMode != LaunchMode.MultiInstance)\n                {\n                    var onlineConnections = _appLifecycleManager\n                        .GetOnlineConnections()\n                        .Where(x => x.Info.ApplicationId.Equals(appIdValue) &&\n                                    !x.Id.Equals(source.Id)).ToArray();\n\n                    if (_contextLinkageManager.IsContextShouldBeConsidered(contextLinkageOptions, source))\n                    {\n                        onlineConnections = _contextLinkageManager\n                            .GetAppsInContexts(contextLinkageOptions, source, true)\n                            .Join(onlineConnections, x => x.ConnectionId.Value, y => y.Id, (x, y) => y)\n                            .ToArray();\n                    }\n\n                    if (onlineConnections.Any())\n                    {\n                        return onlineConnections.First();\n                    }\n                }\n\n                if (launchMode == LaunchMode.None || !_appLifecycleManager.CanBeLaunched(appIdValue))\n                {\n                    throw new InvalidOperationException(\n                        $\"The requested app {appIdValue} is not online and cannot be launched\");\n                }\n\n                var resolveMode = ConvertToResolveMode(launchMode);\n\n                resolveTask = _appLifecycleManager.LaunchAndConnectAsync(appIdValue, resolveMode, source.Info);\n            }\n            var resolvedConnection = await resolveTask.ConfigureAwait(false);\n            return resolvedConnection.AppConnection;\n        }\n\n        private async ValueTask<IAppConnection> ResolveTargetConnectionAsync(\n            IConsumedMethodReference method, \n            IAppConnection source,\n            ITransportChannel sourceChannel,\n            IContextLinkageOptions contextLinkageOptions)\n        {\n            Log.Debug(\"Resolving target connection for call {{{0}}} from {{{1}}} for {2} invocation\", method, source, sourceChannel.Id);\n            string appId;\n            ResolveMode resolveMode;\n            var targetMethods = _registryService.GetMatchingProvidedMethods(source.Info.ApplicationId, method);\n            var onlineProvidedMethods =\n                _appLifecycleManager\n                    .GetOnlineConnections()\n                    .Where(x => !x.Id.Equals(source.Id))\n                    .Join(\n                        targetMethods.Where(x => GetLaunchMode(x) != LaunchMode.MultiInstance),\n                        x => x.Info.ApplicationId, y => y.ProvidedService.Application.Id,\n                        (x, y) => (Method: y, AppConnection: x))\n                    .ToArray();\n\n            if (_contextLinkageManager.IsContextShouldBeConsidered(contextLinkageOptions, source))\n            {\n                onlineProvidedMethods = _contextLinkageManager.GetAppsInContexts(contextLinkageOptions, source, true)\n                    .Join(onlineProvidedMethods, x => x.ConnectionId.Value, y => y.AppConnection.Id, (x, y) => y).ToArray();\n            }\n\n            if (onlineProvidedMethods.Any())\n            {\n                var connection = onlineProvidedMethods.First().AppConnection;\n                Log.Debug(\"Resolved target connection for call {{{0}}} from {{{1}}} to online connection {{{2}}} for {3} invocation\", method, source, connection, sourceChannel.Id);\n                return connection;\n            }\n\n            lock (_resolveConnectionSync)\n            {\n                Log.Debug(\"Resolving target connection for call {{{0}}} (invocation {2}) from {{{1}}} to offline connection\", method, source, sourceChannel.Id);\n                var appIds = _appLifecycleManager.FilterCanBeLaunched(\n                    targetMethods.Select(x => x.ProvidedService.Application.Id).Distinct());\n                targetMethods = targetMethods.Join(appIds, x => x.ProvidedService.Application.Id, y => y, (x, y) => x).ToArray();\n\n                var singleInstanceMethods = targetMethods.Where(x => GetLaunchMode(x) == LaunchMode.SingleInstance).ToArray();\n\n                var onlineConnections = new HashSet<string>(_appLifecycleManager.GetOnlineConnections().Select(connection => connection.Info.ApplicationId));\n\n                var candidate = singleInstanceMethods.FirstOrDefault(x => !x.ProvidedService.Application.Id.Equals(source.Info.ApplicationId) && !onlineConnections.Contains(x.ProvidedService.Application.Id));\n                resolveMode = ResolveMode.SingleInstance;\n\n                if (candidate == null)\n                {\n                    candidate = singleInstanceMethods.FirstOrDefault(x => !onlineConnections.Contains(x.ProvidedService.Application.Id));\n                    resolveMode = ResolveMode.SingleInstance;\n                }\n\n                if (candidate == null)\n                {\n                    candidate = targetMethods.FirstOrDefault(x => GetLaunchMode(x) == LaunchMode.MultiInstance);\n                    resolveMode = ResolveMode.MultiInstance;\n                }\n\n                if (candidate == null)\n                {\n                    candidate = targetMethods.FirstOrDefault(x => GetLaunchMode(x) != LaunchMode.None);\n                    resolveMode = ResolveMode.MultiInstance;\n                }\n\n                if (candidate == null)\n                {\n                    throw new InvalidOperationException($\"Cannot resolve target for invocation {{{method}}} from {{{source}}} for {sourceChannel.Id} invocation\");\n                }\n                Log.Debug(\"Resolved target connection for call {{{0}}} from {{{1}}} to provided method {{{2}}} for {3} invocation\", method, source, candidate, sourceChannel.Id);\n                appId = candidate.ProvidedService.Application.Id;\n            }\n\n            var launchAppTask = _appLifecycleManager.LaunchAndConnectAsync(appId, resolveMode, source.Info);\n\n            var completedTask = await Task.WhenAny(launchAppTask, source.IncomingChannels.Completion).ConfigureAwait(false);\n\n            if (completedTask == launchAppTask)\n            {\n                var resolvedConnection = await launchAppTask.ConfigureAwait(false);\n                return resolvedConnection.AppConnection;\n            }\n\n            throw new TaskCanceledException($\"Launch of application {appId} canceled because source connection {source.Info} is completed\");\n        }\n\n        private static ResolveMode ConvertToResolveMode(LaunchMode launchMode)\n        {\n            switch (launchMode)\n            {\n                case LaunchMode.SingleInstance:\n                    return ResolveMode.SingleInstance;\n                case LaunchMode.MultiInstance:\n                    return ResolveMode.MultiInstance;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(launchMode), launchMode, null);\n            }\n        }\n\n        private static LaunchMode GetLaunchMode(IProvidedMethod method)\n        {\n            return method.LaunchMode.HasValue\n                ? method.LaunchMode.Value\n                : method.ProvidedService.LaunchMode.HasValue\n                    ? method.ProvidedService.LaunchMode.Value\n                    : method.ProvidedService.Application.LaunchMode.HasValue\n                        ? method.ProvidedService.Application.LaunchMode.Value\n                        : LaunchMode.SingleInstance;\n        }\n\n        private IInvocationStartRequested CreateInvocationTarget(IProvidedMethodReference reference, IAppConnection sourceConnection)\n        {\n            return _protocolMessageFactory.CreateInvocationStartRequested(\n                reference.ProvidedService.ServiceId,\n                reference.MethodId,\n                reference.ProvidedService.ServiceAlias,\n                sourceConnection.Info.ApplicationId,\n                sourceConnection.Info.ApplicationInstanceId,\n                sourceConnection.Id);\n        }\n\n        private IInvocationStartRequested CreateInvocationTarget(IConsumedMethodReference reference, IAppConnection sourceConnection)\n        {\n            return _protocolMessageFactory.CreateInvocationStartRequested(\n                reference.ConsumedService.ServiceId,\n                reference.MethodId,\n                reference.ConsumedService.ServiceAlias,\n                sourceConnection.Info.ApplicationId,\n                sourceConnection.Info.ApplicationInstanceId,\n                sourceConnection.Id);\n        }\n\n        private static void DisposeFrame(TransportMessageFrame frame)\n        {\n            frame.Dispose();\n        }\n\n        private static async Task PropagateAsync(ITransportChannel source, ITransportChannel target, CancellationToken cancellationToken = default)\n        {\n            int propagatedMessageCount = 0;\n            var targetId = target.Id;\n            var sourceId = source.Id;\n            bool exceptionLogged = false;\n            try\n            {\n                while (true)\n                {\n                    Log.Trace($\"Waiting for TransportMessageFrame from {sourceId} to propagate to {targetId}\");\n\n                    Maybe<TransportMessageFrame> result;\n                    try\n                    {\n                        result = await source.In.TryReadAsync(cancellationToken).ConfigureAwait(false);\n                    }\n                    catch (Exception ex)\n                    {\n                        Log.Warn(ex, $\"Caught exception during attempt to read TransportMessageFrame from source channel {sourceId} to propagate it to {targetId} channel. Total {propagatedMessageCount} messages propagated\");\n                        exceptionLogged = true;\n                        throw;\n                    }\n\n                    if (!result.HasValue)\n                    {\n                        Log.Trace($\"Received empty TransportMessageFrame from {sourceId}. Will complete {targetId} channel\");\n                        break;\n                    }\n\n                    var messageFrame = result.Value;\n\n                    Log.Trace($\"Received TransportMessageFrame {messageFrame} from {sourceId}. Will try to propagate it to {targetId} channel\");\n                    try\n                    {\n                        await target.Out.WriteAsync(messageFrame, cancellationToken).ConfigureAwait(false);\n                    }\n                    catch (Exception ex)\n                    {\n                        Log.Warn(ex, $\"Caught exception during attempt to write TransportMessageFrame to target channel {targetId} to propagate it from {sourceId} channel. Total {propagatedMessageCount} messages propagated\");\n                        exceptionLogged = true;\n                        throw;\n                    }\n\n                    propagatedMessageCount++;\n\n                    Log.Trace($\"TransportMessageFrame {messageFrame} successfully propagated to {targetId} (received from {sourceId})\");\n                }\n\n                target.Out.TryComplete();\n                Log.Trace($\"Successfully completed TransportMessageFrame propagation from {sourceId} to {targetId}. Total {propagatedMessageCount} messages propagated\");\n            }\n            catch (Exception ex)\n            {\n                if (!exceptionLogged)\n                {\n                    Log.Warn(ex, $\"Caught exception during attempt to propagate TransportMessageFrame from {sourceId} to {targetId}. Total {propagatedMessageCount} messages propagated\");\n                }\n                target.Out.TryTerminate(ex);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/RegistryService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Broker.Internal\n{\n    using Plexus.Interop.Metamodel;\n    using Plexus.Interop.Protocol;\n    using System;\n    using System.Collections.Concurrent;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading;\n    using Plexus.Interop.Transport.Protocol;\n\n    internal sealed class RegistryService : IRegistryService, IDisposable\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<RegistryService>();\n\n        private readonly ReaderWriterLockSlim _registryLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);\n\n        private readonly ConcurrentDictionary<IApplication, IReadOnlyCollection<IProvidedMethod>> _matchingProvidedMethodsCache\n            = new ConcurrentDictionary<IApplication, IReadOnlyCollection<IProvidedMethod>>();\n\n        private readonly ConcurrentDictionary<IApplication, IReadOnlyCollection<IConsumedMethod>> _matchingConsumedMethodsCache\n            = new ConcurrentDictionary<IApplication, IReadOnlyCollection<IConsumedMethod>>();\n\n        private IRegistry _registry;\n        private readonly BrokerRegistryProvider _registryProvider;\n\n        public RegistryService(IRegistryProvider registryProvider)\n        {\n            _registryProvider = new BrokerRegistryProvider(registryProvider);\n            _registryProvider.Updated += OnUpdated;\n            if (_registry == null)\n            {\n                OnUpdated(_registryProvider.Current);\n            }\n        }\n\n        private void OnUpdated(IRegistry registry)\n        {\n            _registryLock.EnterWriteLock();\n            try\n            {\n                Log.Info(\"Metadata changed. Reloading.\");\n                _registry = registry;\n                _matchingProvidedMethodsCache.Clear();\n            }\n            finally\n            {\n                _registryLock.ExitWriteLock();\n            }\n        }\n\n        internal IRegistry Registry => _registryProvider.Current;\n\n        public IApplication GetApplication(string appId)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                if (_registry.Applications.TryGetValue(appId, out var application))\n                {\n                    return application;\n                }\n                throw new MetadataViolationException($\"Application {appId} do not exist in metadata. Available applications: {string.Join(\", \", _registry.Applications.Keys)}\");\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IConsumedService GetConsumedService(string appId, IConsumedServiceReference reference)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                var application = GetApplication(appId);\n                var consumedService = application.ConsumedServices\n                    .FirstOrDefault(service => Equals(service.Service.Id, reference.ServiceId) && Equals(service.Alias, reference.ServiceAlias));\n                if (consumedService != null)\n                {\n                    return consumedService;\n                }\n                throw new MetadataViolationException($\"Service {reference.ServiceId} with alias {reference.ServiceAlias} do not exist or is not consumed by {appId} application. Available services: {string.Join(\", \", application.ConsumedServices.Select(service => service.Service.Id))}\");\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IConsumedMethod GetConsumedMethod(string appId, IConsumedMethodReference reference)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                var methodId = reference.MethodId;\n                var service = GetConsumedService(appId, reference.ConsumedService);\n                if (service.Methods.TryGetValue(methodId, out var consumedMethod))\n                {\n                    return consumedMethod;\n                }\n                throw new MetadataViolationException($\"Method {methodId} do not exist in service {service.Service.Id} or is not consumed by {appId} application. Available methods: {string.Join(\", \", service.Methods.Keys)}\");\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IProvidedService GetProvidedService(IProvidedServiceReference reference)\n        {\n            _registryLock.EnterReadLock();\n            if (!reference.ApplicationId.HasValue)\n            {\n                throw new InvalidOperationException($\"Can't find provided services of unspecified application id ({reference})\");\n            }\n            try\n            {\n                return _registry.Applications[reference.ApplicationId.Value].ProvidedServices\n                    .FirstOrDefault(x =>\n                        Equals(x.Alias, reference.ServiceAlias) && Equals(x.Service.Id, reference.ServiceId));\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IProvidedMethod GetProvidedMethod(IProvidedMethodReference reference)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                return GetProvidedService(reference.ProvidedService).Methods[reference.MethodId];\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(IConsumedMethod consumedMethod)\n        {            \n            _registryLock.EnterReadLock();\n            try\n            {\n                return GetMethodMatchesByConsumedService(consumedMethod.ConsumedService)\n                    .Where(x => Equals(x.Method, consumedMethod.Method))\n                    .ToList();\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(string appId, IConsumedMethodReference reference)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                return GetMatchingProvidedMethods(GetConsumedMethod(appId, reference));\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(IApplication application)\n        {\n            IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethodsInternal(IApplication a)\n            {\n                Log.Debug(\"Retrieving the methods visible for {0}\", application.Id);\n                var all = _registry.Applications.Values.SelectMany(x => x.ProvidedServices);\n                var matched = application.ConsumedServices\n                    .Join(all, x => x.Service, y => y.Service, (consumed, provided) => (consumed, provided))\n                    .Where(x =>\n                        x.provided.To.IsMatch(x.consumed.Application.Id) &&\n                        x.consumed.From.IsMatch(x.provided.Application.Id))\n                    .SelectMany(x =>\n                        x.consumed.Methods.Values\n                            .Join(x.provided.Methods.Values, c => c.Method, p => p.Method, (c, p) => p))\n                    .Distinct()\n                    .ToList();\n                Log.Debug(\"Retrieved {0} methods visible for {1}\", matched.Count, application.Id);\n                return matched;\n            }\n\n            _registryLock.EnterReadLock();\n            try\n            {\n                return _matchingProvidedMethodsCache.GetOrAdd(application, GetMatchingProvidedMethodsInternal);\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IReadOnlyCollection<IProvidedMethod> GetMatchingProvidedMethods(string appId)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                return GetMatchingProvidedMethods(GetApplication(appId));\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public bool IsApplicationDefined(string appId)\n        {\n            return _registry.Applications.ContainsKey(appId);\n        }\n\n        public IReadOnlyCollection<IConsumedMethod> GetMatchingConsumedMethods(IApplication application)\n        {\n            IReadOnlyCollection<IConsumedMethod> GetMatchingConsumedMethodsInternal(IApplication a)\n            {\n                var all = _registry.Applications.Values.SelectMany(x => x.ConsumedServices);\n                var matched = a.ProvidedServices\n                    .Join(all, x => x.Service, y => y.Service, (provided, consumed) => (provided, consumed))\n                    .Where(x =>\n                        x.consumed.From.IsMatch(x.provided.Application.Id) &&\n                        x.provided.To.IsMatch(x.consumed.Application.Id))\n                    .SelectMany(x =>\n                        x.consumed.Methods.Values\n                            .Join(x.provided.Methods.Values, c => c.Method, p => p.Method, (c, p) => c))\n                    .Distinct();\n                return matched.ToList();\n            }\n\n            _registryLock.EnterReadLock();\n            try\n            {\n                return _matchingConsumedMethodsCache.GetOrAdd(application, GetMatchingConsumedMethodsInternal);\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public IReadOnlyCollection<(IConsumedMethod Consumed, IProvidedMethod Provided)> GetMethodMatches(string appId, IConsumedServiceReference consumedServiceReference)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                var consumedService = GetConsumedService(appId, consumedServiceReference);\n                return GetMethodMatchesByConsumedService(consumedService)\n                    .Join(consumedService.Methods.Values, x => x.Method, y => y.Method, (x, y) => (y, x))\n                    .Distinct()\n                    .ToList();\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        private IEnumerable<IProvidedMethod> GetMethodMatchesByConsumedService(IConsumedService consumedService)\n            => GetMatchingProvidedMethods(consumedService.Application)\n                .Where(providedMethod => consumedService.From.IsMatch(providedMethod.ProvidedService.Application.Id));\n\n        public IReadOnlyCollection<(IConsumedMethod Consumed, IProvidedMethod Provided)> GetMethodMatches(string appId)\n        {\n            _registryLock.EnterReadLock();\n            try\n            {\n                var app = GetApplication(appId);\n                var consumedMethods = app.ConsumedServices.SelectMany(x => x.Methods.Values);\n                return GetMatchingProvidedMethods(appId)\n                    .Join(consumedMethods, x => x.Method, y => y.Method, (x, y) => (y, x))\n                    .Distinct()\n                    .ToList();\n            }\n            finally\n            {\n                _registryLock.ExitReadLock();\n            }\n        }\n\n        public void Dispose()\n        {\n            _registryProvider.Updated -= OnUpdated;\n            _registryProvider.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Internal/interop.json",
    "content": "{\n\t\"messages\": {\n\t  \"nested\": {\n\t    \"google\": {\n\t      \"nested\": {\n\t        \"protobuf\": {\n\t          \"options\": {\n\t            \"go_package\": \"github.com/golang/protobuf/ptypes/empty\",\n\t            \"java_package\": \"com.google.protobuf\",\n\t            \"java_outer_classname\": \"EmptyProto\",\n\t            \"csharp_namespace\": \"Google.Protobuf.WellKnownTypes\",\n\t            \"objc_class_prefix\": \"GPB\",\n\t            \"optimize_for\": \"SPEED\",\n\t            \"java_multiple_files\": true,\n\t            \"cc_enable_arenas\": true\n\t          },\n\t          \"nested\": {\n\t            \"FileDescriptorSet\": {\n\t              \"fields\": {\n\t                \"file\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FileDescriptorProto\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"FileDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"package\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"dependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"publicDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"weakDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 11,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"messageType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 5\n\t                },\n\t                \"service\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ServiceDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 7\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FileOptions\",\n\t                  \"id\": 8\n\t                },\n\t                \"sourceCodeInfo\": {\n\t                  \"type\": \"SourceCodeInfo\",\n\t                  \"id\": 9\n\t                },\n\t                \"syntax\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 12\n\t                }\n\t              }\n\t            },\n\t            \"DescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"field\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"nestedType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 3\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"extensionRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ExtensionRange\",\n\t                  \"id\": 5\n\t                },\n\t                \"oneofDecl\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"OneofDescriptorProto\",\n\t                  \"id\": 8\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MessageOptions\",\n\t                  \"id\": 7\n\t                },\n\t                \"reservedRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ReservedRange\",\n\t                  \"id\": 9\n\t                },\n\t                \"reservedName\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"ExtensionRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"options\": {\n\t                      \"type\": \"ExtensionRangeOptions\",\n\t                      \"id\": 3\n\t                    }\n\t                  }\n\t                },\n\t                \"ReservedRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"ExtensionRangeOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 3\n\t                },\n\t                \"label\": {\n\t                  \"type\": \"Label\",\n\t                  \"id\": 4\n\t                },\n\t                \"type\": {\n\t                  \"type\": \"Type\",\n\t                  \"id\": 5\n\t                },\n\t                \"typeName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 6\n\t                },\n\t                \"extendee\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"defaultValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 7\n\t                },\n\t                \"oneofIndex\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 9\n\t                },\n\t                \"jsonName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FieldOptions\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Type\": {\n\t                  \"values\": {\n\t                    \"TYPE_DOUBLE\": 1,\n\t                    \"TYPE_FLOAT\": 2,\n\t                    \"TYPE_INT64\": 3,\n\t                    \"TYPE_UINT64\": 4,\n\t                    \"TYPE_INT32\": 5,\n\t                    \"TYPE_FIXED64\": 6,\n\t                    \"TYPE_FIXED32\": 7,\n\t                    \"TYPE_BOOL\": 8,\n\t                    \"TYPE_STRING\": 9,\n\t                    \"TYPE_GROUP\": 10,\n\t                    \"TYPE_MESSAGE\": 11,\n\t                    \"TYPE_BYTES\": 12,\n\t                    \"TYPE_UINT32\": 13,\n\t                    \"TYPE_ENUM\": 14,\n\t                    \"TYPE_SFIXED32\": 15,\n\t                    \"TYPE_SFIXED64\": 16,\n\t                    \"TYPE_SINT32\": 17,\n\t                    \"TYPE_SINT64\": 18\n\t                  }\n\t                },\n\t                \"Label\": {\n\t                  \"values\": {\n\t                    \"LABEL_OPTIONAL\": 1,\n\t                    \"LABEL_REQUIRED\": 2,\n\t                    \"LABEL_REPEATED\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"OneofOptions\",\n\t                  \"id\": 2\n\t                }\n\t              }\n\t            },\n\t            \"EnumDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"value\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumValueDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"EnumValueDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumValueOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"ServiceDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"method\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"MethodDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"ServiceOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"MethodDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"inputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"outputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MethodOptions\",\n\t                  \"id\": 4\n\t                },\n\t                \"clientStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"serverStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"FileOptions\": {\n\t              \"fields\": {\n\t                \"javaPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"javaOuterClassname\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                },\n\t                \"javaMultipleFiles\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenerateEqualsAndHash\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 20,\n\t                  \"options\": {\n\t                    \"deprecated\": true\n\t                  }\n\t                },\n\t                \"javaStringCheckUtf8\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 27,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"optimizeFor\": {\n\t                  \"type\": \"OptimizeMode\",\n\t                  \"id\": 9,\n\t                  \"options\": {\n\t                    \"default\": \"SPEED\"\n\t                  }\n\t                },\n\t                \"goPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 11\n\t                },\n\t                \"ccGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 16,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 17,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"pyGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 18,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"phpGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 19,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 23,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"ccEnableArenas\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 31,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"objcClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 36\n\t                },\n\t                \"csharpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 37\n\t                },\n\t                \"swiftPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 39\n\t                },\n\t                \"phpClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 40\n\t                },\n\t                \"phpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 41\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  38,\n\t                  38\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"OptimizeMode\": {\n\t                  \"values\": {\n\t                    \"SPEED\": 1,\n\t                    \"CODE_SIZE\": 2,\n\t                    \"LITE_RUNTIME\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"MessageOptions\": {\n\t              \"fields\": {\n\t                \"messageSetWireFormat\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"noStandardDescriptorAccessor\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"mapEntry\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 7\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  8,\n\t                  8\n\t                ],\n\t                [\n\t                  9,\n\t                  9\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldOptions\": {\n\t              \"fields\": {\n\t                \"ctype\": {\n\t                  \"type\": \"CType\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": \"STRING\"\n\t                  }\n\t                },\n\t                \"packed\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"jstype\": {\n\t                  \"type\": \"JSType\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": \"JS_NORMAL\"\n\t                  }\n\t                },\n\t                \"lazy\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"weak\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  4,\n\t                  4\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"CType\": {\n\t                  \"values\": {\n\t                    \"STRING\": 0,\n\t                    \"CORD\": 1,\n\t                    \"STRING_PIECE\": 2\n\t                  }\n\t                },\n\t                \"JSType\": {\n\t                  \"values\": {\n\t                    \"JS_NORMAL\": 0,\n\t                    \"JS_STRING\": 1,\n\t                    \"JS_NUMBER\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumOptions\": {\n\t              \"fields\": {\n\t                \"allowAlias\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  5,\n\t                  5\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumValueOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"ServiceOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"MethodOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"idempotencyLevel\": {\n\t                  \"type\": \"IdempotencyLevel\",\n\t                  \"id\": 34,\n\t                  \"options\": {\n\t                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"IdempotencyLevel\": {\n\t                  \"values\": {\n\t                    \"IDEMPOTENCY_UNKNOWN\": 0,\n\t                    \"NO_SIDE_EFFECTS\": 1,\n\t                    \"IDEMPOTENT\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"UninterpretedOption\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"NamePart\",\n\t                  \"id\": 2\n\t                },\n\t                \"identifierValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"positiveIntValue\": {\n\t                  \"type\": \"uint64\",\n\t                  \"id\": 4\n\t                },\n\t                \"negativeIntValue\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 5\n\t                },\n\t                \"doubleValue\": {\n\t                  \"type\": \"double\",\n\t                  \"id\": 6\n\t                },\n\t                \"stringValue\": {\n\t                  \"type\": \"bytes\",\n\t                  \"id\": 7\n\t                },\n\t                \"aggregateValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"NamePart\": {\n\t                  \"fields\": {\n\t                    \"namePart\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"isExtension\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"bool\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"SourceCodeInfo\": {\n\t              \"fields\": {\n\t                \"location\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Location\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Location\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"span\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"leadingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"trailingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"leadingDetachedComments\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 6\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GeneratedCodeInfo\": {\n\t              \"fields\": {\n\t                \"annotation\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Annotation\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Annotation\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"sourceFile\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"begin\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 4\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"Empty\": {\n\t              \"fields\": {}\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"interop\": {\n\t      \"options\": {\n\t        \"csharp_namespace\": \"plexus\"\n\t      },\n\t      \"nested\": {\n\t        \"AppConnectionDescriptor\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectionDescriptor\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            },\n\t            \"transportType\": {\n\t              \"type\": \"TransportType\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"TransportType\": {\n\t          \"values\": {\n\t            \"Unknown\": 0,\n\t            \"Pipe\": 1,\n\t            \"Ws\": 2,\n\t            \"Wss\": 3\n\t          }\n\t        },\n\t        \"AppLaunchMode\": {\n\t          \"values\": {\n\t            \"SINGLE_INSTANCE\": 0,\n\t            \"MULTI_INSTANCE\": 1\n\t          }\n\t        },\n\t        \"AppLauncherService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLauncherService\"\n\t          },\n\t          \"methods\": {\n\t            \"Launch\": {\n\t              \"requestType\": \"AppLaunchRequest\",\n\t              \"responseType\": \"AppLaunchResponse\"\n\t            },\n\t            \"AppLaunchedEventStream\": {\n\t              \"requestType\": \".google.protobuf.Empty\",\n\t              \"responseType\": \"AppLaunchedEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchParamsJson\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"suggestedAppInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 4\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchReferrer\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchReferrer\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLifecycleService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLifecycleService\"\n\t          },\n\t          \"methods\": {\n\t            \"ResolveApp\": {\n\t              \"requestType\": \"ResolveAppRequest\",\n\t              \"responseType\": \"ResolveAppResponse\"\n\t            },\n\t            \"GetLifecycleEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppLifecycleEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetInvocationEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"InvocationEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetConnections\": {\n\t              \"requestType\": \"GetConnectionsRequest\",\n\t              \"responseType\": \"GetConnectionsResponse\"\n\t            },\n\t            \"GetConnectionsStream\": {\n\t              \"requestType\": \"GetConnectionsRequest\",\n\t              \"responseType\": \"GetConnectionsEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"ResolveAppRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ResolveAppRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appResolveMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ResolveAppResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ResolveAppResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appConnectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"isNewInstanceLaunched\": {\n\t              \"type\": \"bool\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLifecycleEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLifecycleEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"connected\",\n\t                \"disconnected\",\n\t                \"error\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"connected\": {\n\t              \"type\": \"AppConnectedEvent\",\n\t              \"id\": 1\n\t            },\n\t            \"disconnected\": {\n\t              \"type\": \"AppDisconnectedEvent\",\n\t              \"id\": 2\n\t            },\n\t            \"error\": {\n\t              \"type\": \"AppConnectionErrorEvent\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"invocationStarted\",\n\t                \"invocationFinished\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"invocationStarted\": {\n\t              \"type\": \"InvocationStartedEvent\",\n\t              \"id\": 1\n\t            },\n\t            \"invocationFinished\": {\n\t              \"type\": \"InvocationFinishedEvent\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppConnectedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppDisconnectedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppDisconnectedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppConnectionErrorEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectionErrorEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"InvocationStartedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationStartedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"invocationDescriptor\": {\n\t              \"type\": \"InvocationDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"InvocationFinishedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationFinishedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"invocationDescriptor\": {\n\t              \"type\": \"InvocationDescriptor\",\n\t              \"id\": 1\n\t            },\n\t            \"result\": {\n\t              \"type\": \"InvocationResult\",\n\t              \"id\": 2\n\t            },\n\t            \"durationMs\": {\n\t              \"type\": \"int64\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationResult\": {\n\t          \"values\": {\n\t            \"Succeeded\": 0,\n\t            \"Canceled\": 1,\n\t            \"Failed\": 2\n\t          }\n\t        },\n\t        \"GetConnectionsRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"applicationId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"GetConnectionsResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"connections\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"GetConnectionsEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"newConnection\",\n\t                \"closedConnection\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"connections\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            },\n\t            \"newConnection\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            },\n\t            \"closedConnection\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppMetadataService\"\n\t          },\n\t          \"methods\": {\n\t            \"GetAppMetadataChangedEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppMetadataChangedEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetMetamodelChangedEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"MetamodelChangedEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataChangedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetadataChangedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"apps\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppMetadataInfo\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetadataInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"displayName\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launcherId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"launcherParams\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"MetamodelChangedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.MetamodelChangedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"applications\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \".interop.AppMetamodelInfo\",\n\t              \"id\": 1\n\t            },\n\t            \"services\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Service\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppMetamodelInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetamodelInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"consumedServices\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ConsumedService\",\n\t              \"id\": 2\n\t            },\n\t            \"providedServices\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ProvidedService\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ProvidedService\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ProvidedService\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"alias\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ProvidedMethod\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedService\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ConsumedService\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"alias\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ConsumedMethod\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedMethod\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ConsumedMethod\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ProvidedMethod\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ProvidedMethod\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"MetamodelLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"int32\",\n\t              \"id\": 4\n\t            },\n\t            \"options\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 5\n\t            }\n\t          },\n\t          \"nested\": {\n\t            \"MetamodelLaunchMode\": {\n\t              \"values\": {\n\t                \"None\": 0,\n\t                \"SingleInstance\": 1,\n\t                \"MultiInstance\": 2\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"Service\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.Service\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"MethodInfo\",\n\t              \"id\": 2\n\t            },\n\t            \"options\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"MethodInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.MethodInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"requestMessageId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"responseMessageId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 4\n\t            },\n\t            \"type\": {\n\t              \"type\": \"MethodType\",\n\t              \"id\": 5\n\t            }\n\t          },\n\t          \"nested\": {\n\t            \"MethodType\": {\n\t              \"values\": {\n\t                \"Unary\": 0,\n\t                \"ServerStreaming\": 1,\n\t                \"ClientStreaming\": 2,\n\t                \"DuplexStreaming\": 3\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"OptionParameter\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.OptionParameter\"\n\t          },\n\t          \"fields\": {\n\t            \"key\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"value\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppRegistrationService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppRegistrationService\"\n\t          },\n\t          \"methods\": {\n\t            \"RequestInstanceId\": {\n\t              \"requestType\": \"RequestInstanceIdRequest\",\n\t              \"responseType\": \"UniqueId\"\n\t            },\n\t            \"RegisterInstanceId\": {\n\t              \"requestType\": \"RegisterInstanceIdRequest\",\n\t              \"responseType\": \"RegisterInstanceIdResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"RequestInstanceIdRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RequestInstanceIdRequest\"\n\t          },\n\t          \"fields\": {}\n\t        },\n\t        \"RegisterInstanceIdRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RegisterInstanceIdRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"RegisterInstanceIdResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RegisterInstanceIdResponse\"\n\t          },\n\t          \"fields\": {}\n\t        },\n\t        \"Context\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.Context\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"own\": {\n\t              \"type\": \"bool\",\n\t              \"id\": 2\n\t            },\n\t            \"kind\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ContextsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextsList\"\n\t          },\n\t          \"fields\": {\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"CreateContextRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.CreateContextRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"kind\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextLoadingStatus\": {\n\t          \"values\": {\n\t            \"IN_PROGRESS\": 0,\n\t            \"FAILED\": 1,\n\t            \"FINISHED\": 2\n\t          }\n\t        },\n\t        \"ContextLoadingUpdate\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextLoadingUpdate\"\n\t          },\n\t          \"fields\": {\n\t            \"status\": {\n\t              \"type\": \"ContextLoadingStatus\",\n\t              \"id\": 1\n\t            },\n\t            \"loadedAppDescriptors\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            },\n\t            \"failedAppDescriptors\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationRef\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationRef\"\n\t          },\n\t          \"fields\": {\n\t            \"appInfo\": {\n\t              \"type\": \"interop.AppMetamodelInfo\",\n\t              \"id\": 1\n\t            },\n\t            \"target\": {\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"InvocationsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationsList\"\n\t          },\n\t          \"fields\": {\n\t            \"invocations\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"InvocationRef\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextToInvocations\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextToInvocations\"\n\t          },\n\t          \"fields\": {\n\t            \"context\": {\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            },\n\t            \"invocations\": {\n\t              \"type\": \"InvocationsList\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ContextToInvocationsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextToInvocationsList\"\n\t          },\n\t          \"fields\": {\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ContextToInvocations\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppJoinedContextEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppJoinedContextEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"context\": {\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"RestoreContextsLinkageRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoreContextsLinkageRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"apps\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"RestoringAppInstance\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"RestoringAppInstance\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoringAppInstance\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"contextIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 3,\n\t              \"options\": {\n\t                \"deprecated\": true\n\t              }\n\t            },\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Context\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"RestoreContextsLinkageResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoreContextsLinkageResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"createdContextsMap\": {\n\t              \"keyType\": \"string\",\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextLinkageService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.ContextLinkageService\"\n\t          },\n\t          \"methods\": {\n\t            \"ContextLoadedStream\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"ContextLoadingUpdate\",\n\t              \"responseStream\": true\n\t            },\n\t            \"CreateContext\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"Context\",\n\t              \"options\": {\n\t                \"deprecated\": true\n\t              },\n\t              \"parsedOptions\": [\n\t                {\n\t                  \"deprecated\": true\n\t                }\n\t              ]\n\t            },\n\t            \"CreateContext2\": {\n\t              \"requestType\": \"CreateContextRequest\",\n\t              \"responseType\": \"Context\"\n\t            },\n\t            \"JoinContext\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"google.protobuf.Empty\"\n\t            },\n\t            \"GetContexts\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"ContextsList\"\n\t            },\n\t            \"GetLinkedInvocations\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"InvocationsList\"\n\t            },\n\t            \"GetAllLinkedInvocations\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"ContextToInvocationsList\"\n\t            },\n\t            \"AppJoinedContextStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppJoinedContextEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"RestoreContextsLinkage\": {\n\t              \"requestType\": \"RestoreContextsLinkageRequest\",\n\t              \"responseType\": \"RestoreContextsLinkageResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"ApplicationOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedServiceOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedServiceOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedMethodOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"uint32\",\n\t              \"id\": 3\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedMethodOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ApplicationLaunchOnCallMode\": {\n\t          \"options\": {\n\t            \"allow_alias\": true\n\t          },\n\t          \"values\": {\n\t            \"IF_NOT_LAUNCHED\": 0,\n\t            \"DEFAULT\": 0,\n\t            \"ALWAYS\": 1,\n\t            \"ENABLED\": 1,\n\t            \"NEVER\": 2,\n\t            \"DISABLED\": 2\n\t          }\n\t        },\n\t        \"InvocationDescriptor\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationDescriptor\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"serviceAliasId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methodId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"source\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 4\n\t            },\n\t            \"target\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"messageId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MessageOptions\"\n\t        },\n\t        \"serviceId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.ServiceOptions\"\n\t        },\n\t        \"methodId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MethodOptions\"\n\t        },\n\t        \"testing\": {\n\t          \"options\": {\n\t            \"csharp_namespace\": \"plexus\"\n\t          },\n\t          \"nested\": {\n\t            \"stringOption\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1500,\n\t              \"extend\": \".interop.ProvidedMethodOptions\"\n\t            },\n\t            \"enumOption\": {\n\t              \"type\": \"EchoRequest.SubEnum\",\n\t              \"id\": 1501,\n\t              \"extend\": \".interop.ProvidedMethodOptions\"\n\t            },\n\t            \"EchoService\": {\n\t              \"options\": {\n\t                \"(.interop.service_id)\": \"interop.testing.EchoService\"\n\t              },\n\t              \"methods\": {\n\t                \"Unary\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"responseType\": \"EchoRequest\"\n\t                },\n\t                \"ServerStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"responseType\": \"EchoRequest\",\n\t                  \"responseStream\": true\n\t                },\n\t                \"ClientStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"EchoRequest\"\n\t                },\n\t                \"DuplexStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"EchoRequest\",\n\t                  \"responseStream\": true\n\t                }\n\t              }\n\t            },\n\t            \"EchoRequest\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.EchoRequest\"\n\t              },\n\t              \"fields\": {\n\t                \"stringField\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"int64Field\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 2\n\t                },\n\t                \"uint32Field\": {\n\t                  \"type\": \"uint32\",\n\t                  \"id\": 3\n\t                },\n\t                \"repeatedDoubleField\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"double\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumField\": {\n\t                  \"type\": \"SubEnum\",\n\t                  \"id\": 5\n\t                },\n\t                \"subMessageField\": {\n\t                  \"type\": \"SubMessage\",\n\t                  \"id\": 6\n\t                },\n\t                \"repeatedSubMessageField\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"SubMessage\",\n\t                  \"id\": 7\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"SubMessage\": {\n\t                  \"options\": {\n\t                    \"(.interop.message_id)\": \"interop.testing.EchoRequest.SubMessage\"\n\t                  },\n\t                  \"fields\": {\n\t                    \"bytesField\": {\n\t                      \"type\": \"bytes\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"stringField\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                },\n\t                \"SubEnum\": {\n\t                  \"values\": {\n\t                    \"VALUE_ONE\": 0,\n\t                    \"VALUE_TWO\": 1\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GreetingService\": {\n\t              \"options\": {\n\t                \"(.interop.service_id)\": \"interop.testing.GreetingService\"\n\t              },\n\t              \"methods\": {\n\t                \"Hello\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"responseType\": \"GreetingResponse\"\n\t                }\n\t              }\n\t            },\n\t            \"GreetingRequest\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.GreetingRequest\"\n\t              },\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"GreetingResponse\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.GreetingResponse\"\n\t              },\n\t              \"fields\": {\n\t                \"greeting\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"UniqueId\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.UniqueId\"\n\t          },\n\t          \"fields\": {\n\t            \"lo\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 1\n\t            },\n\t            \"hi\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        }\n\t      }\n\t    }\n\t  }\n\t}\n\t,\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"AppLaunchedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLauncherService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLifecycleService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ResolveApp\",\n\t\t\t\t\t\"request\": \"interop.ResolveAppRequest\",\n\t\t\t\t\t\"response\": \"interop.ResolveAppResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetLifecycleEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppLifecycleEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetInvocationEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.InvocationEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetConnections\",\n\t\t\t\t\t\"request\": \"interop.GetConnectionsRequest\",\n\t\t\t\t\t\"response\": \"interop.GetConnectionsResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetConnectionsStream\",\n\t\t\t\t\t\"request\": \"interop.GetConnectionsRequest\",\n\t\t\t\t\t\"response\": \"interop.GetConnectionsEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLifecycleService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppMetadataService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetAppMetadataChangedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppMetadataChangedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetMetamodelChangedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.MetamodelChangedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppMetadataService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.ContextLinkageService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ContextLoadedStream\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"interop.ContextLoadingUpdate\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"CreateContext\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.Context\",\n\t\t\t\t\t\"type\": \"Unary\",\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"google.protobuf.MethodOptions.deprecated\",\n\t\t\t\t\t\t\t\"value\": \"true\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"CreateContext2\",\n\t\t\t\t\t\"request\": \"interop.CreateContextRequest\",\n\t\t\t\t\t\"response\": \"interop.Context\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"JoinContext\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetContexts\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.ContextsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetLinkedInvocations\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"interop.InvocationsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.ContextToInvocationsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"AppJoinedContextStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppJoinedContextEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RestoreContextsLinkage\",\n\t\t\t\t\t\"request\": \"interop.RestoreContextsLinkageRequest\",\n\t\t\t\t\t\"response\": \"interop.RestoreContextsLinkageResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.ContextLinkageService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppRegistrationService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RequestInstanceId\",\n\t\t\t\t\t\"request\": \"interop.RequestInstanceIdRequest\",\n\t\t\t\t\t\"response\": \"interop.UniqueId\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RegisterInstanceId\",\n\t\t\t\t\t\"request\": \"interop.RegisterInstanceIdRequest\",\n\t\t\t\t\t\"response\": \"interop.RegisterInstanceIdResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppRegistrationService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.testing.EchoService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.GreetingService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Hello\",\n\t\t\t\t\t\"request\": \"interop.testing.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.GreetingResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.testing.GreetingService\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLifecycleManager\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ResolveApp\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLifecycleEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetInvocationEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnections\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnectionsStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppMetadataService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAppMetadataChangedEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetMetamodelChangedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext2\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppJoinedContextStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RestoreContextsLinkage\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppRegistrationService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RequestInstanceId\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RegisterInstanceId\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.CommandLineTool\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ResolveApp\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.NativeAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"plexus.interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoClient\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnections\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnectionsStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext2\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoServer\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Unary Method\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.testing.string_option\",\n\t\t\t\t\t\t\t\t\t\"value\": \"some string\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.testing.enum_option\",\n\t\t\t\t\t\t\t\t\t\"value\": \"VALUE_TWO\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Server Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Client Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Duplex Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Sample Echo Service\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.launch_on_call\",\n\t\t\t\t\t\t\t\t\t\"value\": \"ALWAYS\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"alias\": \"AlwaysLaunchGreetingService\",\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.launch_on_call\",\n\t\t\t\t\t\t\t\t\t\"value\": \"NEVER\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"alias\": \"NeverLaunchGreetingService\",\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.TestAppLauncher\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLifecycleEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetInvocationEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppRegistrationService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RequestInstanceId\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RegisterInstanceId\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Plexus.Interop.Broker.Core.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Broker</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Include=\"Internal\\interop.json\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Apps.Manager.Contracts\\Plexus.Interop.Apps.Manager.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Contracts\\Plexus.Interop.Metamodel.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Json\\Plexus.Interop.Metamodel.Json.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol\\Plexus.Interop.Protocol.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Contracts\\Plexus.Interop.Transport.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"appRegistry.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core/Properties/AsseblyInfo.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System.Runtime.CompilerServices;\n\n[assembly:InternalsVisibleTo(\"Plexus.Interop.Broker.Core.Tests\")]"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core.Tests/Plexus.Interop.Broker.Core.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Broker.Core</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Broker.Core\\Plexus.Interop.Broker.Core.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Testing\\Plexus.Interop.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"RegistryServiceTests.interop.json\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core.Tests/RegistryServiceTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Broker.Core\n{\n    using System.Linq;\n    using Plexus.Interop.Broker.Internal;\n    using Plexus.Interop.Metamodel.Json;\n    using Shouldly;\n    using Xunit;\n\n    public sealed class RegistryServiceTests : TestsSuite\n    {\n        private readonly RegistryService _sut;\n\n        public RegistryServiceTests()\n        {\n            _sut = new RegistryService(new JsonRegistryProvider(\"RegistryServiceTests.interop.json\"));\n        }\n\n        [Fact]\n        public void CanResolveEmbeddedMethods()\n        {\n            var methods = _sut.GetMatchingProvidedMethods(\"plexus.tests.App1\");\n            methods.Count.ShouldBe(1);\n            var method = methods.First();\n            method.ProvidedService.Application.Id.ShouldBe(\"interop.AppLifecycleManager\");\n            method.ProvidedService.Service.Id.ShouldBe(\"interop.AppLifecycleService\");\n            method.Method.Name.ShouldBe(\"GetLifecycleEventStream\");\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Broker.Core.Tests/RegistryServiceTests.interop.json",
    "content": "﻿{\n  \"services\": [\n    {\n      \"id\": \"interop.AppLauncherService\",\n      \"methods\": [\n        {\n          \"name\": \"Launch\",\n          \"request\": \"interop.AppLaunchRequest\",\n          \"response\": \"interop.AppLaunchResponse\",\n          \"type\": \"Unary\"\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.AppLifecycleService\",\n      \"methods\": [\n        {\n          \"name\": \"ResolveApp\",\n          \"request\": \"interop.ResolveAppRequest\",\n          \"response\": \"interop.ResolveAppResponse\",\n          \"type\": \"Unary\"\n        },\n        {\n          \"name\": \"GetLifecycleEventStream\",\n          \"request\": \"google.protobuf.Empty\",\n          \"response\": \"interop.AppLifecycleEvent\",\n          \"type\": \"ServerStreaming\"\n        }\n      ]\n    }\n  ],    \n  \"applications\": [\n    {\n      \"id\": \"plexus.tests.App1\",\n      \"consumes\": [\n        {\n          \"service\": \"interop.AppLifecycleService\",\n          \"methods\": [\n            {\n              \"name\": \"GetLifecycleEventStream\"\n            }\n          ],\n          \"from\": [\n            \"interop.*\"\n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"plexus.tests.Launcher1\",\n      \"provides\": [\n        {\n          \"service\": \"interop.AppLauncherService\",\n          \"methods\": [\n            {\n              \"name\": \"Launch\"\n            }\n          ],\n          \"to\": [\n            \"interop.AppLifecycleManager\"\n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.AppLifecycleManager\",\n      \"consumes\": [\n        {\n          \"service\": \"interop.AppLauncherService\",\n          \"methods\": [\n            {\n              \"name\": \"Launch\"\n            }\n          ]\n        }\n      ],\n      \"provides\": [\n        {\n          \"service\": \"interop.AppLifecycleService\",\n          \"methods\": [\n            {\n              \"name\": \"ResolveApp\"\n            },\n            {\n              \"name\": \"GetLifecycleEventStream\"\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client/ClientBase.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n\n    public abstract class ClientBase : IClient\n    {\n        private readonly IClient _client;\n\n        protected ClientBase(ClientOptions options)\n        {\n            _client = ClientFactory.Instance.Create(options);\n        }\n\n        public IClientCallInvoker CallInvoker => _client.CallInvoker;\n\n        public IClientDiscoveryInvoker DiscoveryInvoker => _client.DiscoveryInvoker;\n\n        public string ApplicationId => _client.ApplicationId;\n\n        public UniqueId ApplicationInstanceId => _client.ApplicationInstanceId;\n\n        public UniqueId ConnectionId => _client.ConnectionId;\n\n        public Task Completion => _client.Completion;\n\n        public void Dispose()\n        {\n            _client.Dispose();\n        }\n\n        public Task ConnectAsync()\n        {\n            return _client.ConnectAsync();\n        }\n\n        public void Disconnect()\n        {\n            _client.Disconnect();\n        }\n\n        public Task DisconnectAsync()\n        {\n            return _client.DisconnectAsync();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client/ClientOptionsBuilderExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Protobuf;\n    using Plexus.Interop.Transport;\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Transmission.Pipes;\n\n    public static class ClientOptionsBuilderExtensions\n    {\n        public static ClientOptionsBuilder WithDefaultConfiguration(this ClientOptionsBuilder builder)\n        {\n            return builder\n                .WithMarshaller(\n                    new ProtobufMarshallerProvider())\n                .WithProtocol(\n                    new ProtocolImplementation(\n                        ProtocolMessagePool.Instance,\n                        new ProtobufProtocolSerializerFactory()))\n                .WithTransport(\n                    TransportClientFactory.Instance.Create(\n                        TransportType.Pipe,\n                        PipeTransmissionClientFactory.Instance.Create(),\n                        new ProtobufTransportProtocolSerializationProvider()));\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client/Plexus.Interop.Client.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>    \n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Client.Core\\Plexus.Interop.Client.Core.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client.Marshalling.Protobuf\\Plexus.Interop.Client.Marshalling.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Protobuf\\Plexus.Interop.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol\\Plexus.Interop.Protocol.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport\\Plexus.Interop.Transport.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ClientDiscoveryInvokerExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n\n    public static class ClientDiscoveryInvokerExtensions\n    {\n        public static Task<IReadOnlyCollection<DiscoveredMethod<TRequest, Nothing>>> DiscoverAsync<TRequest>(\n            this IClientDiscoveryInvoker invoker)\n        {\n            return invoker.DiscoverAsync(MethodDiscoveryQuery.Create<TRequest, Nothing>());\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredMethod<TRequest, Nothing>>> DiscoverOnlineAsync<TRequest>(\n            this IClientDiscoveryInvoker invoker)\n        {\n            return invoker.DiscoverAsync(MethodDiscoveryQuery.Create<TRequest, Nothing>());\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker)\n        {\n            return invoker.DiscoverAsync(MethodDiscoveryQuery.Create<TRequest, TResponse>());\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker)\n        {\n            return invoker.DiscoverOnlineAsync(MethodDiscoveryQuery.Create<TRequest, TResponse>());\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredUnaryMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, UnaryMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredUnaryMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredUnaryMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, UnaryMethod<TRequest, TResponse> method)\n        {\n            return DiscoverAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredOnlineUnaryMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, UnaryMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverOnlineAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredOnlineUnaryMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredOnlineUnaryMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, UnaryMethod<TRequest, TResponse> method)\n        {\n            return DiscoverOnlineAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredOnlineUnaryMethod<TRequest, TResponse>>> DiscoverInCurrentContextAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, UnaryMethod<TRequest, TResponse> method)\n        {\n            return (await invoker.DiscoverInCurrentContextAsync(MethodDiscoveryQuery.Create(method)))\n                .Select(x => new DiscoveredOnlineUnaryMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredServerStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ServerStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredServerStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredServerStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ServerStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredOnlineServerStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ServerStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverOnlineAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredOnlineServerStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredOnlineServerStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ServerStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverOnlineAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredClientStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ClientStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredClientStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredClientStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ClientStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredOnlineClientStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ClientStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverOnlineAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredOnlineClientStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredOnlineClientStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, ClientStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverOnlineAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredDuplexStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, DuplexStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredDuplexStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredDuplexStreamingMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, DuplexStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n\n        public static async Task<IReadOnlyCollection<DiscoveredOnlineDuplexStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, DuplexStreamingMethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResult = await invoker\n                .DiscoverOnlineAsync(query)\n                .ConfigureAwait(false);\n            return discoveryResult.Select(x => new DiscoveredOnlineDuplexStreamingMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public static Task<IReadOnlyCollection<DiscoveredOnlineDuplexStreamingMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(\n            this IClientDiscoveryInvoker invoker, DuplexStreamingMethod<TRequest, TResponse> method)\n        {\n            return DiscoverOnlineAsync(invoker, MethodDiscoveryQuery.Create(method));\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ClientFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n    using Plexus.Interop.Internal;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n\n    public sealed class ClientFactory : IClientFactory\n    {\n        public static readonly IClientFactory Instance = new ClientFactory();\n\n        public IClient Create(ClientOptions options)\n        {\n            return new Client(options);\n        }\n\n        public IClient Create(\n            string appId, \n            ITransportClient transport, \n            IProtocolImplementation protocol,\n            IMarshallerProvider marshaller, \n            Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = default)\n        {\n            var builder = new ClientOptionsBuilder()\n                .WithApplicationId(appId)\n                .WithMarshaller(marshaller)\n                .WithProtocol(protocol)\n                .WithTransport(transport);\n            if (setup != default)\n            {\n                builder = setup(builder);\n            }\n            return new Client(builder.Build());\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ClientOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop\n{\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using System.Collections.Generic;\n    using System.Linq;\n\n    public sealed class ClientOptions\n    {\n        internal ClientOptions(\n            string brokerWorkingDir,\n            string applicationId,\n            UniqueId applicationInstanceId,\n            ITransportClient transport,\n            IProtocolImplementation protocol,\n            IMarshallerProvider marshaller,\n            IEnumerable<ProvidedServiceDefinition> services)\n        {\n            BrokerWorkingDir = brokerWorkingDir;\n            ApplicationId = applicationId;\n            ApplicationInstanceId = applicationInstanceId;\n            Transport = transport;\n            Marshaller = marshaller;\n            Protocol = protocol;\n            Services = new List<ProvidedServiceDefinition>(services);\n            ServicesDictionary = Services.ToDictionary(x => x.Id, x => x);\n        }\n\n        public string BrokerWorkingDir { get; }\n\n        public string ApplicationId { get; }\n\n        public UniqueId ApplicationInstanceId { get; }\n\n        public ITransportClient Transport { get; }\n\n        public IProtocolImplementation Protocol { get; }\n\n        public IMarshallerProvider Marshaller { get; }\n\n        public IReadOnlyCollection<ProvidedServiceDefinition> Services { get; }\n\n        internal IReadOnlyDictionary<string, ProvidedServiceDefinition> ServicesDictionary { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(BrokerWorkingDir)}: {BrokerWorkingDir}, {nameof(ApplicationId)}: {ApplicationId}, {nameof(ApplicationInstanceId)}: {ApplicationInstanceId}, {nameof(Transport)}: {Transport}, {nameof(Protocol)}: {Protocol}, {nameof(Marshaller)}: {Marshaller}, {nameof(Services)}: {Services.FormatEnumerableObjects()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ClientOptionsBuilder.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n\n    public sealed class ClientOptionsBuilder\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<ClientOptionsBuilder>();\n\n        private readonly List<(string Name, Maybe<string> Alias, Func<ProvidedServiceDefinition.Builder, ProvidedServiceDefinition.Builder> Setup)> _serviceFactories\n            = new List<(string, Maybe<string>, Func<ProvidedServiceDefinition.Builder, ProvidedServiceDefinition.Builder>)>();\n\n        public string BrokerWorkingDir { get; private set; }\n\n        public string ApplicationId { get; private set; }\n\n        public UniqueId ApplicationInstanceId { get; private set; }\n\n        public ITransportClient Transport { get; private set; }\n\n        public IProtocolImplementation Protocol { get; private set; }\n\n        public IMarshallerProvider Marshaller { get; private set; }\n\n        public ClientOptionsBuilder WithBrokerWorkingDir(string brokerWorkingDir)\n        {\n            BrokerWorkingDir = brokerWorkingDir;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithApplicationId(string applicationId)\n        {\n            ApplicationId = applicationId;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithAppInstanceId(UniqueId instanceId)\n        {\n            ApplicationInstanceId = instanceId;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithTransport(ITransportClient transport)\n        {\n            Transport = transport;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithProtocol(IProtocolImplementation protocol)\n        {\n            Protocol = protocol;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithMarshaller(IMarshallerProvider marshallerProvider)\n        {\n            Marshaller = marshallerProvider;\n            return this;\n        }\n\n        public ClientOptionsBuilder WithProvidedService(string name, Func<ProvidedServiceDefinition.Builder, ProvidedServiceDefinition.Builder> setup)\n        {\n            _serviceFactories.Add((name, default, setup));\n            return this;\n        }\n\n        public ClientOptionsBuilder WithProvidedService(string name, string alias, Func<ProvidedServiceDefinition.Builder, ProvidedServiceDefinition.Builder> setup)\n        {\n            _serviceFactories.Add((name, alias, setup));\n            return this;\n        }\n\n        public ClientOptions Build()\n        {\n            if (BrokerWorkingDir == null)\n            {\n                BrokerWorkingDir = EnvironmentHelper.GetBrokerWorkingDir();\n                if (BrokerWorkingDir == null)\n                {\n                    throw new ArgumentException($\"Broker working directory must be specified either explicitly or through environment variable {EnvironmentHelper.BrokerWorkingDirVarName}\");\n                }\n            }\n            if (string.IsNullOrEmpty(ApplicationId))\n            {\n                throw new ArgumentException(\"Application ID must be specified\");\n            }\n            if (Transport == null)\n            {\n                throw new ArgumentException(\"Transport implementation must be specified\");\n            }\n            if (Protocol == null)\n            {\n                throw new ArgumentException(\"Protocol implementation must be specified\");\n            }\n            if (Marshaller == null)\n            {\n                throw new ArgumentException(\"Marshaller implementation must be specified\");\n            }\n            if (ApplicationInstanceId == default)\n            {\n                try\n                {\n                    var instanceIdVar = EnvironmentHelper.GetAppInstanceId();\n                    ApplicationInstanceId = instanceIdVar == null\n                        ? UniqueId.Generate()\n                        : UniqueId.FromString(instanceIdVar);\n                }\n                catch (Exception exception)\n                {\n                    Log.Warn(exception, \"Exception while reading app instance id from environment variable {0}. Generating new unique id as fallback...\", EnvironmentHelper.AppInstanceIdVarName);\n                    ApplicationInstanceId = UniqueId.Generate();\n                }\n            }\n            var incomingInvocationFactory = new IncomingInvocationFactory(Protocol, Marshaller);\n            return new ClientOptions(\n                BrokerWorkingDir,\n                ApplicationId,\n                ApplicationInstanceId,\n                Transport,\n                Protocol,\n                Marshaller,\n                GetServiceDefinitions());\n            IEnumerable<ProvidedServiceDefinition> GetServiceDefinitions()\n            {\n                foreach (var serviceFactory in _serviceFactories)\n                {\n                    var builder = new ProvidedServiceDefinition.Builder(serviceFactory.Name, serviceFactory.Alias, incomingInvocationFactory);\n                    yield return serviceFactory.Setup(builder).Build();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ContextLinkageOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using Plexus.Interop.Protocol;\n\n    public sealed class ContextLinkageOptions\n    {\n        public ContextLinkageOptions(string specifiedContextId)\n        {\n            SpecifiedContextId = new Maybe<string>(specifiedContextId);\n            Mode = ContextLinkageDiscoveryMode.SpecificContext;\n        }\n\n        private ContextLinkageOptions(ContextLinkageDiscoveryMode mode)\n        {\n            Mode = mode;\n            SpecifiedContextId = Maybe<string>.Nothing;\n        }\n\n        public static ContextLinkageOptions WithCurrentContext() => new ContextLinkageOptions(ContextLinkageDiscoveryMode.CurrentContext);\n\n        public ContextLinkageDiscoveryMode Mode { get; }\n\n        public Maybe<string> SpecifiedContextId { get; }\n    }\n\n    public static class ContextLinkageConvertor\n    {\n        public static IContextLinkageOptions Convert(this ContextLinkageOptions options, IProtocolMessageFactory messageFactory)\n        {\n            if (options == null)\n            {\n                return messageFactory.CreateContextLinkageOptions(ContextLinkageDiscoveryMode.None, Maybe<string>.Nothing);\n            }\n\n            return messageFactory.CreateContextLinkageOptions(options.Mode,\n                options.SpecifiedContextId);\n        }\n\n        public static IContextLinkageOptions Convert(this Maybe<ContextLinkageOptions> options, IProtocolMessageFactory messageFactory)\n        {\n            if (!options.HasValue)\n            {\n                return CreateDefaultContextLinkageOptions(messageFactory);\n            }\n\n            return options.Value.Convert(messageFactory);\n        }\n\n        private static IContextLinkageOptions CreateDefaultContextLinkageOptions(IProtocolMessageFactory messageFactory)\n        {\n            return messageFactory.CreateContextLinkageOptions(ContextLinkageDiscoveryMode.None, Maybe<string>.Nothing);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/DiscoveredMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System.Collections.Generic;\n\n    public class DiscoveredMethod : IMethod\n    {\n        internal DiscoveredMethod(\n            ProvidedMethodReference providedMethod,\n            Maybe<string> title,\n            string inputMessageId,\n            string outputMessageId,\n            MethodType type,\n            IReadOnlyCollection<Option> options)\n            : this(\n                providedMethod,\n                title,\n                inputMessageId,\n                outputMessageId,\n                type,\n                new MethodCallDescriptor(providedMethod),\n                options)\n        {\n        }\n\n        internal DiscoveredMethod(\n            ProvidedMethodReference providedMethod,\n            Maybe<string> title,\n            string inputMessageId,\n            string outputMessageId,\n            MethodType type,\n            MethodCallDescriptor callDescriptor,\n            IReadOnlyCollection<Option> options)\n        {\n            ProvidedMethod = providedMethod;\n            Title = title;\n            InputMessageId = inputMessageId;\n            OutputMessageId = outputMessageId;\n            Type = type;\n            CallDescriptor = callDescriptor;\n            Options = options;\n        }\n\n        internal DiscoveredMethod(DiscoveredMethod method) : this(\n            method.ProvidedMethod, \n            method.Title, \n            method.InputMessageId, \n            method.OutputMessageId,             \n            method.Type,\n            method.CallDescriptor,\n            method.Options)\n        {\n        }\n\n        public ProvidedMethodReference ProvidedMethod { get; }\n\n        public Maybe<string> Title { get; }\n\n        public string InputMessageId { get; }\n\n        public string OutputMessageId { get; }\n\n        public MethodType Type { get; }\n\n        public MethodCallDescriptor CallDescriptor { get; }\n\n        public IReadOnlyCollection<Option> Options { get; }\n\n        public override string ToString()\n        {\n            return $\"Type: {GetType().FormatName()}, {nameof(ProvidedMethod)}: {{{ProvidedMethod}}}, {nameof(Title)}: {Title}, {nameof(InputMessageId)}: {InputMessageId}, {nameof(OutputMessageId)}: {OutputMessageId}, {nameof(Options)}: {Options.FormatEnumerableObjects()}\";\n        }\n    }\n\n    public class DiscoveredOnlineMethod : DiscoveredMethod\n    {\n        internal DiscoveredOnlineMethod(\n            ProvidedMethodReference providedMethod,\n            Maybe<string> title,\n            string inputMessageId,\n            string outputMessageId,\n            MethodType type,\n            IReadOnlyCollection<Option> options)\n            : base(\n                providedMethod,\n                title,\n                inputMessageId,\n                outputMessageId,\n                type,\n                options)\n        {\n            ProviderConnectionId = providedMethod.ProvidedService.ConnectionId.Value;\n        }\n\n        internal DiscoveredOnlineMethod(DiscoveredMethod method) : this(\n            method.ProvidedMethod,\n            method.Title,\n            method.InputMessageId,\n            method.OutputMessageId,\n            method.Type,\n            method.Options)\n        {\n        }\n\n        public UniqueId ProviderConnectionId { get; }\n\n        public override string ToString()\n        {\n            return $\"{base.ToString()}, {nameof(ProviderConnectionId)}: {ProviderConnectionId}\";\n        }\n    }\n\n    public class DiscoveredMethod<TRequest, TResponse> : DiscoveredMethod, IMethod<TRequest, TResponse>\n    {\n        internal DiscoveredMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public class DiscoveredOnlineMethod<TRequest, TResponse> : DiscoveredOnlineMethod, IMethod<TRequest, TResponse>\n    {\n        internal DiscoveredOnlineMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredUnaryMethod<TRequest, TResponse> : DiscoveredMethod<TRequest, TResponse>, IUnaryMethod<TRequest, TResponse>\n    {\n        internal DiscoveredUnaryMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredServerStreamingMethod<TRequest, TResponse> : DiscoveredMethod<TRequest, TResponse>, IServerStreamingMethod<TRequest, TResponse>\n    {\n        internal DiscoveredServerStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredClientStreamingMethod<TRequest, TResponse> : DiscoveredMethod<TRequest, TResponse>, IClientStreamingMethod<TRequest, TResponse>\n    {\n        internal DiscoveredClientStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredDuplexStreamingMethod<TRequest, TResponse> : DiscoveredMethod<TRequest, TResponse>, IDuplexStreamingMethod<TRequest, TResponse>\n    {\n        internal DiscoveredDuplexStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredOnlineUnaryMethod<TRequest, TResponse> : DiscoveredOnlineMethod<TRequest, TResponse>, IUnaryMethod<TRequest, TResponse>\n    {\n        internal DiscoveredOnlineUnaryMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredOnlineServerStreamingMethod<TRequest, TResponse> : DiscoveredOnlineMethod<TRequest, TResponse>, IServerStreamingMethod<TRequest, TResponse>\n    {\n        internal DiscoveredOnlineServerStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredOnlineClientStreamingMethod<TRequest, TResponse> : DiscoveredOnlineMethod<TRequest, TResponse>, IClientStreamingMethod<TRequest, TResponse>\n    {\n        internal DiscoveredOnlineClientStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n\n    public sealed class DiscoveredOnlineDuplexStreamingMethod<TRequest, TResponse> : DiscoveredOnlineMethod<TRequest, TResponse>\n    {\n        internal DiscoveredOnlineDuplexStreamingMethod(DiscoveredMethod method) : base(method)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/DiscoveredService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Collections.Generic;\n    using System.Linq;\n\n    public sealed class DiscoveredService\n    {\n        internal DiscoveredService(\n            ProvidedServiceReference providedService,\n            Maybe<string> title, \n            IEnumerable<DiscoveredMethod> methods)\n        {\n            ProvidedService = providedService;\n            Title = title;\n            Methods = new List<DiscoveredMethod>(methods);\n        }\n\n        public ProvidedServiceReference ProvidedService { get; }\n\n        public Maybe<string> Title { get; set; }\n\n        public IReadOnlyCollection<DiscoveredMethod> Methods { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ProvidedService)}: {{{ProvidedService}}}, {nameof(Title)}: {Title}, {nameof(Methods)}: {Methods.FormatEnumerableObjects()}\";\n        }\n    }\n\n    public sealed class DiscoveredOnlineService\n    {\n        internal DiscoveredOnlineService(\n            ProvidedServiceReference providedService,\n            Maybe<string> title, \n            IEnumerable<DiscoveredOnlineMethod> methods)\n        {\n            ProvidedService = providedService;\n            Title = title;\n            Methods = new List<DiscoveredOnlineMethod>(methods);\n            ProviderConnectionId = providedService.ConnectionId.Value;\n        }\n\n        internal DiscoveredOnlineService(DiscoveredService service)\n            : this(\n                service.ProvidedService,\n                service.Title,\n                service.Methods.Select(x => new DiscoveredOnlineMethod(x)))\n        {\n        }\n\n        public ProvidedServiceReference ProvidedService { get; }\n\n        public Maybe<string> Title { get; set; }\n\n        public IReadOnlyCollection<DiscoveredOnlineMethod> Methods { get; }\n\n        public UniqueId ProviderConnectionId { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ProvidedService)}: {{{ProvidedService}}}, {nameof(Title)}: {Title}, {nameof(ProviderConnectionId)}: {ProviderConnectionId}, {nameof(Methods)}: {Methods.FormatEnumerableObjects()},\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n    using System.Threading.Tasks;\n\n    public interface IClient : IDisposable\n    {\n        IClientCallInvoker CallInvoker { get; }\n\n        IClientDiscoveryInvoker DiscoveryInvoker { get; }\n\n        string ApplicationId { get; }\n\n        UniqueId ApplicationInstanceId { get; }\n\n        UniqueId ConnectionId { get; }\n\n        Task Completion { get; }        \n\n        Task ConnectAsync();\n\n        void Disconnect();\n\n        Task DisconnectAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IClientCallInvoker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public interface IClientCallInvoker\n    {        \n        /// <summary>\n        /// Invokes a simple remote call asynchronously.\n        /// </summary>\n        IUnaryMethodCall Call<TRequest>(IUnaryMethod<TRequest, Nothing> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a simple remote call asynchronously.\n        /// </summary>\n        IUnaryMethodCall CallUnary<TRequest>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a simple remote call asynchronously.\n        /// </summary>\n        IUnaryMethodCall<TResponse> Call<TRequest, TResponse>(IUnaryMethod<TRequest, TResponse> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a simple remote call asynchronously.\n        /// </summary>\n        IUnaryMethodCall<TResponse> CallUnary<TRequest, TResponse>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes server streaming call asynchronously.\n        /// In server streaming scenario, client sends a single request and server responds with a stream of responses.\n        /// </summary>\n        IServerStreamingMethodCall<TResponse> Call<TRequest, TResponse>(IServerStreamingMethod<TRequest, TResponse> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes server streaming call asynchronously.\n        /// In server streaming scenario, client sends a single request and server responds with a stream of responses.\n        /// </summary>\n        IServerStreamingMethodCall<TResponse> CallServerStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a client streaming call asynchronously.\n        /// In client streaming scenario, client sends a stream of requests and server responds with a single response.\n        /// </summary>\n        IClientStreamingMethodCall<TRequest, TResponse> Call<TRequest, TResponse>(IClientStreamingMethod<TRequest, TResponse> method, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a client streaming call asynchronously.\n        /// In client streaming scenario, client sends a stream of requests and server responds with a single response.\n        /// </summary>\n        IClientStreamingMethodCall<TRequest, TResponse> CallClientStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a client streaming call asynchronously.\n        /// In client streaming scenario, client sends a stream of requests and server responds with a single response.\n        /// </summary>\n        IDuplexStreamingMethodCall<TRequest, TResponse> Call<TRequest, TResponse>(IDuplexStreamingMethod<TRequest, TResponse> method, ContextLinkageOptions contextLinkageOptions = default);\n\n        /// <summary>\n        /// Invokes a client streaming call asynchronously.\n        /// In client streaming scenario, client sends a stream of requests and server responds with a single response.\n        /// </summary>\n        IDuplexStreamingMethodCall<TRequest, TResponse> CallDuplexStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, ContextLinkageOptions contextLinkageOptions = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IClientDiscoveryInvoker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n\n    public interface IClientDiscoveryInvoker\n    {\n        Task<IReadOnlyCollection<DiscoveredMethod>> DiscoverAsync(MethodDiscoveryQuery query);\n\n        Task<IReadOnlyCollection<DiscoveredMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query);\n\n        Task<IReadOnlyCollection<DiscoveredMethod<TRequest, Nothing>>> DiscoverAsync<TRequest>(MethodDiscoveryQuery<TRequest, Nothing> query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, Nothing>>> DiscoverOnlineAsync<TRequest>(MethodDiscoveryQuery<TRequest, Nothing> query);\n\n        Task<IReadOnlyCollection<DiscoveredService>> DiscoverAsync(ServiceDiscoveryQuery query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverOnlineAsync(ServiceDiscoveryQuery query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverInCurrentContextAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverInSpecificContextAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query, string contextId);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverInCurrentContextAsync(ServiceDiscoveryQuery query);\n\n        Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverInSpecificContextAsync(ServiceDiscoveryQuery query, string contextId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IClientFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n\n    public interface IClientFactory\n    {\n        IClient Create(ClientOptions options);\n\n        IClient Create(\n            string appId, \n            ITransportClient transport, \n            IProtocolImplementation protocol, \n            IMarshallerProvider marshaller, \n            Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IClientStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    /// <inheritdoc />\n    /// <summary>\n    /// Return type for client streaming calls.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this call.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this call.</typeparam>\n    public interface IClientStreamingMethodCall<in TRequest, TResponse> : IMethodCall\n    {\n        /// <summary>\n        /// Async stream to send streaming requests.\n        /// </summary>\n        ITerminatableWritableChannel<TRequest> RequestStream { get; }\n\n        /// <summary>\n        /// Asynchronous call result.\n        /// </summary>\n        Task<TResponse> ResponseAsync { get; }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IDuplexStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop\n{\n    using Plexus.Channels;\n\n    /// <inheritdoc />\n    /// <summary>\n    /// Return type for bidirectional streaming calls.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this call.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this call.</typeparam>\n    public interface IDuplexStreamingMethodCall<in TRequest, TResponse> : IMethodCall\n    {\n        /// <summary>\n        /// Async stream to read streaming responses.\n        /// </summary>\n        IReadableChannel<TResponse> ResponseStream { get; }\n\n        /// <summary>\n        /// Async stream to send streaming requests.\n        /// </summary>\n        ITerminatableWritableChannel<TRequest> RequestStream { get; }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public interface IMethod\n    {\n        MethodCallDescriptor CallDescriptor { get; }\n    }\n\n    public interface IMethod<TRequest, TResponse> : IMethod\n    {\n    }\n\n    public interface IUnaryMethod<TRequest, TResponse> : IMethod<TRequest, TResponse>\n    {\n    }\n\n    public interface IServerStreamingMethod<TRequest, TResponse> : IMethod<TRequest, TResponse>\n    {\n    }\n\n    public interface IClientStreamingMethod<TRequest, TResponse> : IMethod<TRequest, TResponse>\n    {\n    }\n\n    public interface IDuplexStreamingMethod<TRequest, TResponse> : IMethod<TRequest, TResponse>\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n\n    public interface IMethodCall\n    {\n        Task StartCompletion { get; }\n\n        Task Completion { get; }\n\n        /// <summary>\n        /// Provides means to cancel the call.\n        /// If the call has already finished normally (request stream has been completed and call result has been received), doesn't do anything.\n        /// Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.\n        /// As a result, all resources being used by the call should be released eventually.\n        /// </summary>\n        void Cancel();\n\n        /// <summary>\n        /// Provides means to cancel the call.\n        /// If the call has already finished normally (request stream has been completed and call result has been received), doesn't do anything.\n        /// Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.\n        /// As a result, all resources being used by the call should be released eventually.\n        /// </summary>\n        Task CancelAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IServerStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop\n{\n    using Plexus.Channels;\n\n    /// <inheritdoc />\n    /// <summary>\n    /// Return type for server streaming calls.\n    /// </summary>\n    /// <typeparam name=\"TResponse\">Response message type for this call.</typeparam>\n    public interface IServerStreamingMethodCall<TResponse> : IMethodCall\n    {\n        /// <summary>\n        /// Async stream to read streaming responses.\n        /// </summary>\n        IReadableChannel<TResponse> ResponseStream { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IUnaryMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n\n    public interface IUnaryMethodCall: IMethodCall\n    {\n        /// <summary>\n        /// Asynchronous call result.\n        /// </summary>\n        Task ResponseAsync { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/IUnaryMethodCall~1.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{    \n    using System.Threading.Tasks;\n\n    public interface IUnaryMethodCall<TResponse> : IMethodCall\n    {\n        /// <summary>\n        /// Asynchronous call result.\n        /// </summary>\n        Task<TResponse> ResponseAsync { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/ClientStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Processes;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class ClientStreamingMethodCall<TRequest, TResponse> : \n        ProcessBase, IClientStreamingMethodCall<TRequest, TResponse>\n    {\n        private readonly IChannel<TRequest> _requestStream = new BufferedChannel<TRequest>(1);\n        private readonly Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> _invocationFactory;\n        private readonly Promise<TResponse> _responseCompletion = new Promise<TResponse>();\n\n        public ClientStreamingMethodCall(Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> invocationFactory)\n        {\n            _invocationFactory = invocationFactory;\n            Completion.LogCompletion(Log);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<ClientStreamingMethodCall<TRequest, TResponse>>();\n\n        public ITerminatableWritableChannel<TRequest> RequestStream => _requestStream.Out;\n\n        public Task<TResponse> ResponseAsync => _responseCompletion.Task;\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Trace(\"Creating invocation\");\n            var invocation = await _invocationFactory().ConfigureAwait(false);\n            OnStop(() => invocation.Out.TryTerminate());\n            await invocation.StartCompletion.ConfigureAwait(false);\n            var processRequestsAsync = ProcessRequestsAsync(invocation);\n            var processResponseAsync = ProcessResponseAsync(invocation);\n            _responseCompletion.PropagateCompletionFrom(processResponseAsync);\n            _requestStream.Out.PropagateCompletionFrom(invocation.Completion);\n            return Task\n                .WhenAll(processRequestsAsync, processResponseAsync)\n                .IgnoreExceptions()\n                .ContinueWithSynchronously(_ => invocation.Completion);\n        }\n\n        public void Cancel()\n        {\n            Stop();\n        }\n\n        public Task CancelAsync()\n        {\n            return StopAsync();\n        }\n\n        private async Task<TResponse> ProcessResponseAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                TResponse response = default;\n                Log.Trace(\"Reading response\");\n                await invocation.In.ConsumeAsync(item => response = item).ConfigureAwait(false);\n                Log.Trace(\"Response stream completed\");\n                return response;\n            }\n            catch (Exception ex)\n            {\n                invocation.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting response invocation completion\");\n                await invocation.In.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private async Task ProcessRequestsAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                Log.Trace(\"Writing requests\");\n                await _requestStream.In.ConsumeAsync(item => invocation.Out.WriteAsync(item)).ConfigureAwait(false);\n                invocation.Out.TryComplete();\n                await _requestStream.Out.Completion.ConfigureAwait(false);\n                Log.Trace(\"Requests stream completed\");\n            }\n            catch (Exception ex)\n            {\n                Log.Trace(\"Requests stream completed with exception: {0}\", ex.FormatTypeAndMessage());\n                invocation.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting request invocation completion\");\n                await invocation.Out.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/ClientStreamingMethodCallHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using System.Threading.Tasks;\n\n    internal sealed class ClientStreamingMethodCallHandler<TRequest, TResponse> : MethodCallHandlerBase<TRequest, TResponse>\n    {\n        private readonly ClientStreamingMethodHandler<TRequest, TResponse> _handler;\n\n        public ClientStreamingMethodCallHandler(\n            ClientStreamingMethodHandler<TRequest, TResponse> handler, \n            IIncomingInvocationFactory incomingInvocationFactory) \n            : base(incomingInvocationFactory)\n        {\n            _handler = handler;\n        }\n\n        protected override async Task HandleCoreAsync(IIncomingInvocation<TRequest, TResponse> invocation, MethodCallContext context)\n        {\n            var response = await _handler(invocation.In, context).ConfigureAwait(false);\n            await invocation.Out.WriteAsync(response).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/DuplexStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Processes;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class DuplexStreamingMethodCall<TRequest, TResponse> : \n        ProcessBase, IDuplexStreamingMethodCall<TRequest, TResponse>\n    {\n        private readonly IChannel<TRequest> _requestStream = new BufferedChannel<TRequest>(1);\n        private readonly IChannel<TResponse> _responseStream = new BufferedChannel<TResponse>(1);\n        private readonly Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> _invocationFactory;\n\n        public DuplexStreamingMethodCall(Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> invocationFactory)\n        {\n            _invocationFactory = invocationFactory;\n            Completion.LogCompletion(Log);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<DuplexStreamingMethodCall<TRequest, TResponse>>();\n\n        public IReadableChannel<TResponse> ResponseStream => _responseStream.In;\n\n        public ITerminatableWritableChannel<TRequest> RequestStream => _requestStream.Out;\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Trace(\"Creating invocation\");\n            var invocation = await _invocationFactory().ConfigureAwait(false);\n            OnStop(() => invocation.Out.TryTerminate());\n            await invocation.StartCompletion.ConfigureAwait(false);            \n            var processRequestsAsync = ProcessRequestsAsync(invocation);\n            var processResponseAsync = ProcessResponsesAsync(invocation);\n            _requestStream.Out.PropagateCompletionFrom(processRequestsAsync);\n            _responseStream.Out.PropagateCompletionFrom(processResponseAsync);\n            return Task\n                .WhenAll(processRequestsAsync, processResponseAsync)\n                .IgnoreExceptions()\n                .ContinueWithSynchronously(_ => invocation.Completion);\n        }\n\n        public void Cancel()\n        {\n            Stop();\n        }\n\n        public Task CancelAsync()\n        {\n            return StopAsync();\n        }\n\n        private async Task ProcessResponsesAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                Log.Trace(\"Reading responses\");\n                await invocation.In\n                    .ConsumeAsync(item => _responseStream.Out.WriteAsync(item, CancellationToken), CancellationToken)\n                    .ConfigureAwait(false);\n                Log.Trace(\"Responses stream completed\");\n            }\n            catch (Exception ex)\n            {\n                invocation.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting response invocation completion\");\n                await invocation.In.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private async Task ProcessRequestsAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                Log.Trace(\"Writing requests\");\n                await _requestStream.In\n                    .ConsumeAsync(item => invocation.Out.WriteAsync(item, CancellationToken), CancellationToken)\n                    .ConfigureAwait(false);\n                invocation.Out.TryComplete();\n                await _requestStream.Out.Completion.ConfigureAwait(false);\n                Log.Trace(\"Requests stream completed\");\n            }\n            catch (Exception ex)\n            {\n                Log.Trace(\"Requests stream completed with exception: {0}\", ex.FormatTypeAndMessage());\n                invocation.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting request invocation completion\");\n                await invocation.Out.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/DuplexStreamingMethodCallHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using System.Threading.Tasks;\n\n    internal sealed class DuplexStreamingMethodCallHandler<TRequest, TResponse> : MethodCallHandlerBase<TRequest, TResponse>\n    {\n        private readonly DuplexStreamingMethodHandler<TRequest, TResponse> _handler;\n\n        public DuplexStreamingMethodCallHandler(\n            DuplexStreamingMethodHandler<TRequest, TResponse> handler, \n            IIncomingInvocationFactory incomingInvocationFactory) \n            : base(incomingInvocationFactory)\n        {\n            _handler = handler;\n        }\n\n        protected override async Task HandleCoreAsync(IIncomingInvocation<TRequest, TResponse> invocation, MethodCallContext context)\n        {\n            await _handler(invocation.In, invocation.Out, context).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/MethodCallHandlerBase.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal abstract class MethodCallHandlerBase<TRequest, TResponse> : IMethodCallHandler\n    {\n        private readonly IIncomingInvocationFactory _incomingInvocationFactory;\n\n        protected MethodCallHandlerBase(IIncomingInvocationFactory incomingInvocationFactory)\n        {\n            _incomingInvocationFactory = incomingInvocationFactory;\n        }\n\n        public async Task HandleAsync(IncomingInvocationDescriptor info, ITransportChannel channel)\n        {\n            var invocation = _incomingInvocationFactory.CreateAsync<TRequest, TResponse>(info, channel);\n            var cancellation = new CancellationTokenSource();\n            invocation.Completion\n                .ContinueWithSynchronously(_ => cancellation.Cancel(), CancellationToken.None)\n                .IgnoreAwait();\n            try\n            {\n                await invocation.StartCompletion.ConfigureAwait(false);\n                var context = new MethodCallContext(\n                    info.Source.ApplicationId,\n                    info.Source.ApplicationInstanceId,\n                    info.Source.ConnectionId,\n                    info.Source.TransportType,\n                    cancellation.Token);\n                await HandleCoreAsync(invocation, context).ConfigureAwait(false);\n                invocation.Out.TryComplete();\n            }\n            catch (Exception ex)\n            {\n                invocation.Out.TryTerminate(ex);\n                invocation.In.ConsumeBufferedItems(x => { });\n                throw;\n            }\n            finally\n            {\n                await invocation.Completion.ConfigureAwait(false);\n            }\n        }\n\n        protected abstract Task HandleCoreAsync(\n            IIncomingInvocation<TRequest, TResponse> invocation,\n            MethodCallContext context);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/ServerStreamingMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using System;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Processes;\n\n    internal sealed class ServerStreamingMethodCall<TRequest, TResponse> \n        : ProcessBase, IServerStreamingMethodCall<TResponse>\n    {        \n        private readonly BufferedChannel<TResponse> _responseStream = new BufferedChannel<TResponse>(1);\n        private readonly Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> _invocationFactory;\n\n        public ServerStreamingMethodCall(Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> invocationFactory)\n        {\n            _invocationFactory = invocationFactory;\n            Completion.LogCompletion(Log);\n            _responseStream.PropagateCompletionFrom(Completion);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<ServerStreamingMethodCall<TRequest, TResponse>>();\n\n        public IReadableChannel<TResponse> ResponseStream => _responseStream;\n\n        public void Cancel()\n        {\n            Stop();\n        }\n\n        public Task CancelAsync()\n        {\n            return StopAsync();\n        }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Trace(\"Creating invocation\");\n            var invocation = await _invocationFactory().ConfigureAwait(false);\n            OnStop(invocation.Cancel);\n            await invocation.StartCompletion.ConfigureAwait(false);\n            return ProcessAsync(invocation);\n        }\n\n        private async Task ProcessAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                Log.Trace(\"Reading responses\");\n                await invocation.In\n                    .ConsumeAsync(item => _responseStream.Out.WriteAsync(item, CancellationToken), CancellationToken)\n                    .ConfigureAwait(false);\n                _responseStream.Out.TryComplete();\n            }\n            catch (Exception ex)\n            {\n                _responseStream.Out.TryTerminate(ex);\n                invocation.Out.TryTerminate(ex);\n                await invocation.In.ConsumeAsync(x => { }).IgnoreExceptions().ConfigureAwait(false);                \n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting invocation completion\");\n                await invocation.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/ServerStreamingMethodCallHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using System.Threading.Tasks;\n\n    internal sealed class ServerStreamingMethodCallHandler<TRequest, TResponse> : MethodCallHandlerBase<TRequest, TResponse>\n    {\n        private readonly ServerStreamingMethodHandler<TRequest, TResponse> _handler;\n\n        public ServerStreamingMethodCallHandler(\n            ServerStreamingMethodHandler<TRequest, TResponse> handler, \n            IIncomingInvocationFactory incomingInvocationFactory) \n            : base(incomingInvocationFactory)\n        {\n            _handler = handler;\n        }\n\n        protected override async Task HandleCoreAsync(IIncomingInvocation<TRequest, TResponse> invocation, MethodCallContext context)\n        {\n            TRequest request = default;\n            await invocation.In.ConsumeAsync(x => request = x).ConfigureAwait(false);\n            await _handler(request, invocation.Out, context).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/UnaryMethodCall.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Processes;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class UnaryMethodCall<TRequest, TResponse> \n        : ProcessBase, IUnaryMethodCall<TResponse>, IUnaryMethodCall\n    {\n        private readonly Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> _invocationFactory;\n        private TResponse _response;\n\n        public UnaryMethodCall(Func<ValueTask<IOutcomingInvocation<TRequest, TResponse>>> invocationFactory)\n        {\n            _invocationFactory = invocationFactory;\n            Completion.LogCompletion(Log);\n            ResponseAsync = Completion.ContinueWithSynchronously(t =>\n            {\n                t.GetResult();\n                return _response;\n            });\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<UnaryMethodCall<TRequest, TResponse>>();\n\n        public Task<TResponse> ResponseAsync { get; }\n\n        Task IUnaryMethodCall.ResponseAsync => ResponseAsync;\n\n        public void Cancel()\n        {\n            Stop();\n        }\n\n        public Task CancelAsync()\n        {\n            return StopAsync();\n        }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Trace(\"Creating invocation\");\n            var invocation = await _invocationFactory().ConfigureAwait(false);\n            OnStop(() => invocation.Out.TryTerminate());\n            await invocation.StartCompletion.ConfigureAwait(false);\n            return ProcessAsync(invocation);\n        }\n\n        private async Task ProcessAsync(IInvocation<TRequest, TResponse> invocation)\n        {\n            try\n            {\n                _response = default;\n                Log.Trace(\"Reading response\");\n                await invocation.In.ConsumeAsync(x => _response = x, CancellationToken).ConfigureAwait(false);\n                Log.Trace(\"Response stream completed\");\n            }\n            catch (Exception ex)\n            {\n                invocation.Out.TryTerminate(ex);\n                await invocation.In.ConsumeAsync(_ => { }).IgnoreExceptions().ConfigureAwait(false);\n                throw;\n            }\n            finally\n            {\n                Log.Trace(\"Awaiting invocation completion\");\n                await invocation.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Calls/UnaryMethodCallHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.Calls\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using System.Threading.Tasks;\n\n    internal sealed class UnaryMethodCallHandler<TRequest, TResponse> : MethodCallHandlerBase<TRequest, TResponse>\n    {\n        private readonly UnaryMethodHandler<TRequest, TResponse> _handler;\n\n        public UnaryMethodCallHandler(\n            UnaryMethodHandler<TRequest, TResponse> handler,\n            IIncomingInvocationFactory incomingInvocationFactory) \n            : base(incomingInvocationFactory)\n        {\n            _handler = handler;\n        }\n\n        protected override async Task HandleCoreAsync(IIncomingInvocation<TRequest, TResponse> invocation, MethodCallContext context)\n        {\n            TRequest request = default;\n            await invocation.In.ConsumeAsync(x => request = x).ConfigureAwait(false);\n            var response = await _handler(request, context).ConfigureAwait(false);\n            await invocation.Out.WriteAsync(response).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/Client.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Internal.Calls;\n    using Plexus.Interop.Internal.ClientProtocol.Discovery;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using Plexus.Processes;\n    using System;\n    using System.Collections.Concurrent;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n\n    internal sealed class Client : ProcessBase, IClient, IClientCallInvoker, IClientDiscoveryInvoker\n    {\n        private bool _connected = false;\n        private volatile bool _disconnecting = false;\n        private volatile bool _disposing = false;\n\n        private readonly ClientOptions _options;\n        private readonly BrokerToClientRequestHandler<Task, ITransportChannel> _incomingRequestHandler;\n        private readonly ConcurrentDictionary<Task, Nothing> _discoveryTasks = new ConcurrentDictionary<Task, Nothing>();\n        private readonly ConcurrentDictionary<ITransportChannel, Task> _handleChannelTasks = new ConcurrentDictionary<ITransportChannel, Task>();\n\n        private ILogger _log = LogManager.GetLogger<Client>();\n        private IOutcomingInvocationFactory _outcomingInvocationFactory;\n        private IDiscoveryService _discoveryService;\n\n        private IClientConnection _connection;\n\n        public Client(ClientOptions options)\n        {\n            _options = options;\n            _incomingRequestHandler = new BrokerToClientRequestHandler<Task, ITransportChannel>(HandleInvocationStartRequestAsync);            \n        }\n\n        public IClientCallInvoker CallInvoker => this;\n\n        public IClientDiscoveryInvoker DiscoveryInvoker => this;\n\n        public string ApplicationId => _options.ApplicationId;\n\n        public UniqueId ApplicationInstanceId => _options.ApplicationInstanceId;\n\n        public UniqueId ConnectionId { get; private set; }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            _log.Debug(\"Connecting {0}\", _options);\n            _connection = await ClientConnectionFactory.Instance\n                .ConnectAsync(_options, CancellationToken)\n                .ConfigureAwait(false);\n            ConnectionId = _connection.Id;\n            _log = LogManager.GetLogger<Client>(_connection.Id.ToString());\n            _outcomingInvocationFactory =\n                new OutcomingInvocationFactory(_connection, _options.Protocol, _options.Marshaller);\n            _discoveryService = new DiscoveryService(ConnectionId, _connection, _options.Protocol);\n            return ProcessAsync();\n        }\n\n        public async Task ConnectAsync()\n        {\n            await StartAsync();\n            _connected = true;\n        }\n\n        public void Disconnect()\n        {\n            _disconnecting = true;\n            Stop();\n        }\n\n        public Task DisconnectAsync()\n        {\n            _disconnecting = true;\n            return StopAsync();\n        }\n\n        public override void Dispose()\n        {\n            _disposing = true;\n            base.Dispose();\n        }\n\n        private void CheckConnectionState()\n        {\n            if (!_connected)\n                throw new InvalidOperationException($\"Client not connected (need wait for finish {nameof(ConnectAsync)}), options: {_options}\");\n            if (_disconnecting)\n                throw new InvalidOperationException($\"Client disconnecting ({nameof(Disconnect)} or {nameof(DisconnectAsync)} called), options: {_options}\");\n            if (_disposing)\n                throw new InvalidOperationException($\"Client disposing ({nameof(Dispose)} called), options: {_options}\");\n        }\n\n        public IUnaryMethodCall Call<TRequest>(IUnaryMethod<TRequest, Nothing> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            return CallUnary(method.CallDescriptor, request, contextLinkageOptions);\n        }\n\n        public IUnaryMethodCall CallUnary<TRequest>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            _log.Debug(\"Starting unary call: {0}\", descriptor);\n            var call = new UnaryMethodCall<TRequest, Nothing>(() => _outcomingInvocationFactory.CreateAsync<TRequest, Nothing>(descriptor, request, contextLinkageOptions));\n            call.Start();\n            return call;\n        }\n\n        public IUnaryMethodCall<TResponse> Call<TRequest, TResponse>(IUnaryMethod<TRequest, TResponse> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            return CallUnary<TRequest, TResponse>(method.CallDescriptor, request, contextLinkageOptions);\n        }\n\n        public IUnaryMethodCall<TResponse> CallUnary<TRequest, TResponse>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            _log.Debug(\"Starting unary call: {0}\", descriptor);\n            var call = new UnaryMethodCall<TRequest, TResponse>(() => _outcomingInvocationFactory.CreateAsync<TRequest, TResponse>(descriptor, request, contextLinkageOptions));\n            call.Start();\n            return call;\n        }\n\n        public IServerStreamingMethodCall<TResponse> Call<TRequest, TResponse>(IServerStreamingMethod<TRequest, TResponse> method, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            return CallServerStreaming<TRequest, TResponse>(method.CallDescriptor, request, contextLinkageOptions);\n        }\n\n        public IServerStreamingMethodCall<TResponse> CallServerStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, TRequest request, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            _log.Debug(\"Starting server streaming call: {0}\", descriptor);\n            var call = new ServerStreamingMethodCall<TRequest, TResponse>(() => _outcomingInvocationFactory.CreateAsync<TRequest, TResponse>(descriptor, request, contextLinkageOptions));\n            call.Start();\n            return call;\n        }\n\n        public IClientStreamingMethodCall<TRequest, TResponse> Call<TRequest, TResponse>(IClientStreamingMethod<TRequest, TResponse> method, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            return CallClientStreaming<TRequest, TResponse>(method.CallDescriptor, contextLinkageOptions);\n        }\n\n        public IClientStreamingMethodCall<TRequest, TResponse> CallClientStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            _log.Debug(\"Starting client streaming call: {0}\", descriptor);\n            var call = new ClientStreamingMethodCall<TRequest, TResponse>(() => _outcomingInvocationFactory.CreateAsync<TRequest, TResponse>(descriptor, contextLinkageOptions: contextLinkageOptions));\n            call.Start();\n            return call;\n        }\n\n        public IDuplexStreamingMethodCall<TRequest, TResponse> Call<TRequest, TResponse>(IDuplexStreamingMethod<TRequest, TResponse> method, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            return CallDuplexStreaming<TRequest, TResponse>(method.CallDescriptor, contextLinkageOptions);\n        }\n\n        public IDuplexStreamingMethodCall<TRequest, TResponse> CallDuplexStreaming<TRequest, TResponse>(MethodCallDescriptor descriptor, ContextLinkageOptions contextLinkageOptions = default)\n        {\n            CheckConnectionState();\n            _log.Debug(\"Starting duplex streaming call: {0}\", descriptor);\n            var call = new DuplexStreamingMethodCall<TRequest, TResponse>(() => _outcomingInvocationFactory.CreateAsync<TRequest, TResponse>(descriptor, contextLinkageOptions: contextLinkageOptions));\n            call.Start();\n            return call;\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredMethod>> DiscoverAsync(MethodDiscoveryQuery query)\n        {\n            return await DiscoverInternalAsync(query).ConfigureAwait(false);\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredMethod<TRequest, TResponse>>> DiscoverAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query)).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredMethod<TRequest, Nothing>>> DiscoverAsync<TRequest>(MethodDiscoveryQuery<TRequest, Nothing> query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query)).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredMethod<TRequest, Nothing>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverOnlineAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query), null, true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, Nothing>>> DiscoverOnlineAsync<TRequest>(MethodDiscoveryQuery<TRequest, Nothing> query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query), null,true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineMethod<TRequest, Nothing>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverInCurrentContextAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query), ContextLinkageOptions.WithCurrentContext(), true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineMethod<TRequest, TResponse>>> DiscoverInSpecificContextAsync<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query, string contextId)\n        {\n            var discoveryResults = await DiscoverInternalAsync(ConvertQuery(query), new ContextLinkageOptions(contextId), true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineMethod<TRequest, TResponse>(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredService>> DiscoverAsync(ServiceDiscoveryQuery query)\n        {\n            return await DiscoverInternalAsync(query).ConfigureAwait(false);\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverOnlineAsync(ServiceDiscoveryQuery query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(query, null, true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineService(x)).ToList();\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverInCurrentContextAsync(ServiceDiscoveryQuery query)\n        {\n            var discoveryResults = await DiscoverInternalAsync(query, ContextLinkageOptions.WithCurrentContext(), true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineService(x)).ToList();\n        }\n        \n        public async Task<IReadOnlyCollection<DiscoveredOnlineService>> DiscoverInSpecificContextAsync(ServiceDiscoveryQuery query, string contextId)\n        {\n            var discoveryResults = await DiscoverInternalAsync(query, new ContextLinkageOptions(contextId), true).ConfigureAwait(false);\n            return discoveryResults.Select(x => new DiscoveredOnlineService(x)).ToList();\n        }\n\n        private async Task ProcessAsync()\n        {\n            using (CancellationToken.Register(() => _connection.TryComplete(), false))\n            {\n                try\n                {\n                    _log.Debug(\"Connected. Listening to incoming invocations.\");\n                    await ListenIncomingInvocationsAsync(_connection).ConfigureAwait(false);\n                    await _connection.Completion.ConfigureAwait(false);\n                }\n                catch (OperationCanceledException) when (CancellationToken.IsCancellationRequested)\n                {\n                }\n                catch (Exception ex)\n                {\n                    _log.Debug(\"Connection terminated: {0}\", ex.FormatTypeAndMessage());\n                }\n                finally\n                {\n                    _log.Debug($\"Connection closed. Awaiting for {_discoveryTasks.Count} discovery tasks and {_handleChannelTasks.Count} channel handling tasks ({string.Join(\", \", _handleChannelTasks.Keys.Select(channel => channel.Id))})\");\n                    await Task.WhenAll(_discoveryTasks.Keys.Concat(_handleChannelTasks.Values)).IgnoreExceptions().ConfigureAwait(false);\n                    _log.Debug($\"Completed processing running tasks of connection {_connection.Id}\");\n                }\n            }\n        }\n\n        private Task ListenIncomingInvocationsAsync(ITransportConnection connection)\n        {\n            return connection\n                .IncomingChannels\n                .ConsumeAsync((Action<ITransportChannel>)HandleIncomingChannel)\n                .IgnoreExceptions();\n        }\n\n        private void HandleIncomingChannel(ITransportChannel channel)\n        {\n            var channelHandleTask = TaskRunner.RunInBackground(HandleIncomingChannelAsync, channel);\n            _handleChannelTasks[channel] = channelHandleTask;\n            channelHandleTask.ContinueWithSynchronously((Action<Task, object>)OnTaskCompleted, channel);\n        }\n\n        private void OnTaskCompleted(Task task, object state)\n        {\n            var channel = (ITransportChannel)state;\n            _log.Debug($\"Completed processing of channel {channel.Id} from connection {_connection.Id} in state {task.Status}\");\n            _handleChannelTasks.TryRemove(channel, out _);\n        }\n\n        private async Task HandleIncomingChannelAsync(object state)\n        {\n            var channel = (ITransportChannel)state;\n            _log.Debug(\"Started processing new channel {0} from connection {1}\", channel.Id, _connection.Id);\n            try\n            {                \n                try\n                {\n                    using (var msg = await channel.In.ReadAsync().ConfigureAwait(false))\n                    using (var request = _options.Protocol.Serializer.DeserializeBrokerToClientRequest(msg.Payload))\n                    {\n                        await request.Handle(_incomingRequestHandler, channel).ConfigureAwait(false);\n                    }\n                }\n                catch (Exception ex)\n                {\n                    channel.Out.TryTerminate(ex);\n                    await channel.In.ConsumeAsync(x => { }).IgnoreExceptions().ConfigureAwait(false);\n                }\n                finally\n                {\n                    await channel.Completion.IgnoreExceptions().ConfigureAwait(false);\n                }\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(\"Exception while handling incoming channel {0}: {1}\", channel.Id, ex.FormatTypeAndMessage());\n            }\n        }\n\n        private Task HandleInvocationStartRequestAsync(IInvocationStartRequested request, ITransportChannel channel)\n        {\n            _log.Debug($\"Handling invocation start request {request} on channel {channel.Id}\");\n            if (!_options.ServicesDictionary.TryGetValue(request.ServiceId, out var providedService))\n            {\n                throw new InvalidOperationException($\"Service implementation not provided: {request.ServiceId}\");\n            }\n            if (!providedService.CallHandlers.TryGetValue(request.MethodId, out var callHandler))\n            {\n                throw new InvalidOperationException($\"Method implementation not provided: {request.ServiceId}.{request.MethodId}\");\n            }\n            var invocationInfo =\n                new IncomingInvocationDescriptor(\n                    new InvocationMethodDescriptor(\n                        request.ServiceId,\n                        request.MethodId,\n                        request.ServiceAlias),\n                    new AppConnectionDescriptor(\n                        request.ConsumerConnectionId,\n                        request.ConsumerApplicationId,\n                        request.ConsumerApplicationInstanceId,\n                        _connection.TransportType));\n            return callHandler.HandleAsync(invocationInfo, channel);\n        }\n\n        private MethodDiscoveryQuery ConvertQuery<TRequest, TResponse>(MethodDiscoveryQuery<TRequest, TResponse> query)\n        {\n            Maybe<string> inputMessageId = default;\n            Maybe<string> outputMessageId = default;\n            if (typeof(TRequest) != typeof(Nothing))\n            {\n                inputMessageId = _options.Marshaller.GetMarshaller<TRequest>().MessageId;\n            }\n            if (typeof(TResponse) != typeof(Nothing))\n            {\n                outputMessageId = _options.Marshaller.GetMarshaller<TResponse>().MessageId;\n            }\n            return new MethodDiscoveryQuery(query.MethodReference, inputMessageId, outputMessageId);\n        }\n\n        private async Task<IReadOnlyCollection<DiscoveredMethod>> DiscoverInternalAsync(\n            MethodDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false)\n        {\n            _log.Debug(\"Method discovery {0}\", query);\n            var task = _discoveryService.DiscoverAsync(query, contextLinkageDiscoveryOptions, online);\n            _discoveryTasks[task] = Nothing.Instance;\n            ((Task)task).ContinueWithSynchronously((Action<Task>)OnDiscoveryTaskCompleted).IgnoreAwait();\n            var response = await task.ConfigureAwait(false);\n            _log.Debug(\"Method discovery response: {0}\", response);\n            return response;\n        }\n\n        private async Task<IReadOnlyCollection<DiscoveredService>> DiscoverInternalAsync(\n            ServiceDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false)\n        {\n            _log.Debug(\"Service discovery {0}\", query);\n            var task = _discoveryService.DiscoverAsync(query, contextLinkageDiscoveryOptions, online);\n            _discoveryTasks[task] = Nothing.Instance;\n            ((Task)task).ContinueWithSynchronously((Action<Task>)OnDiscoveryTaskCompleted).IgnoreAwait();\n            var response = await task.ConfigureAwait(false);\n            _log.Debug(\"Service discovery response: {0}\", response.FormatEnumerable());\n            return response;\n        }\n\n        private void OnDiscoveryTaskCompleted(Task task)\n        {\n            _discoveryTasks.TryRemove(task, out _);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class ClientConnection : IClientConnection\n    {\n        private readonly ITransportConnection _transportConnection;\n\n        public ClientConnection(UniqueId id, ITransportConnection transportConnection)\n        {\n            _transportConnection = transportConnection;\n            Id = id;\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion => _transportConnection.Completion;\n\n        public IReadableChannel<ITransportChannel> IncomingChannels => _transportConnection.IncomingChannels;\n\n        public TransportType TransportType => _transportConnection.TransportType;\n\n        public bool TryComplete()\n        {\n            return _transportConnection.TryComplete();\n        }\n\n        public bool TryTerminate(Exception ex = null)\n        {\n            return _transportConnection.TryTerminate(ex);\n        }\n\n        public ValueTask<Maybe<ITransportChannel>> TryCreateChannelSafeAsync()\n        {\n            return _transportConnection.TryCreateChannelSafeAsync();\n        }\n\n        public void Dispose()\n        {\n            _transportConnection.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientConnectionFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class ClientConnectionFactory\n    {\n        public static readonly ClientConnectionFactory Instance = new ClientConnectionFactory();\n\n        private static readonly ILogger Log = LogManager.GetLogger<ClientConnectionFactory>();\n\n        public async Task<IClientConnection> ConnectAsync(ClientOptions options, CancellationToken cancellationToken)\n        {\n            Log.Trace(\"Establishing new connection with broker\");\n            ITransportConnection transportConnection = null;            \n            try\n            {\n                transportConnection = await options.Transport.ConnectAsync(options.BrokerWorkingDir, cancellationToken).ConfigureAwait(false);\n                using (cancellationToken.Register(() => transportConnection.TryTerminate(), false))\n                {\n                    Log.Debug(\"Connection {0} established. Performing handshake: {1}\", transportConnection.Id, options);\n                    var channel = await transportConnection.CreateChannelAsync().ConfigureAwait(false);\n                    var protocolSerializer = options.Protocol.Serializer;\n                    using (var connectRequest =\n                        options.Protocol.MessageFactory.CreateConnectRequest(\n                            options.ApplicationId,\n                            options.ApplicationInstanceId))\n                    {\n                        var serializedRequest = protocolSerializer.Serialize(connectRequest);\n                        try\n                        {\n                            await channel.Out\n                                .WriteAsync(new TransportMessageFrame(serializedRequest), cancellationToken)\n                                .ConfigureAwait(false);\n                            channel.Out.TryComplete();\n                        }\n                        catch\n                        {\n                            serializedRequest.Dispose();\n                            throw;\n                        }\n                    }\n                    Log.Trace(\"Connection {0} receiving connection response.\", transportConnection.Id);\n                    using (var serializedResponse = await channel.In.ReadAsync(cancellationToken).ConfigureAwait(false))\n                    using (var connectResponse =\n                        protocolSerializer.DeserializeConnectResponse(serializedResponse.Payload))\n                    {\n                        await channel.Completion.ConfigureAwait(false);\n                        Log.Debug(\"Successfully authenticated: {0}\", connectResponse);\n                        return new ClientConnection(connectResponse.ConnectionId, transportConnection);\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                if (transportConnection != null)\n                {\n                    Log.Error(\"Connection failed {0}\", transportConnection);\n                }\n                else\n                {\n                    Log.Warn(ex, \"Connection failed\");\n                }\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Discovery/DiscoveryService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Discovery\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Transport;\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using MethodType = Plexus.Interop.MethodType;\n\n    internal sealed class DiscoveryService : IDiscoveryService\n    {\n        private readonly ILogger _log;\n        private readonly ITransportConnection _transportConnection;\n        private readonly IProtocolImplementation _protocol;\n\n        public DiscoveryService(\n            UniqueId id,\n            ITransportConnection transportConnection,\n            IProtocolImplementation protocol)\n        {\n            _log = LogManager.GetLogger<DiscoveryService>(id.ToString());\n            _transportConnection = transportConnection;\n            _protocol = protocol;\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredMethod>> DiscoverAsync(MethodDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false)\n        {\n            var channel = await _transportConnection.CreateChannelAsync().ConfigureAwait(false);\n            try\n            {\n                using (var msg = _protocol.MessageFactory\n                    .CreateMethodDiscoveryRequest(\n                        query.InputMessageId,\n                        query.OutputMessageId,\n                        Convert(query.MethodReference),\n                        online ? DiscoveryMode.Online : DiscoveryMode.Offline, \n                        contextLinkageDiscoveryOptions.Convert(_protocol.MessageFactory)))\n                {\n                    var serializedRequest = _protocol.Serializer.Serialize(msg);\n                    try\n                    {\n                        await channel.Out.WriteAsync(new TransportMessageFrame(serializedRequest)).ConfigureAwait(false);\n                        channel.Out.TryComplete();\n                    }\n                    catch\n                    {\n                        serializedRequest.Dispose();\n                        throw;\n                    }\n                    using (var serializedResponse = (await channel.In.ReadAsync().ConfigureAwait(false)).Payload)\n                    {\n                        var discoveryResponse = _protocol.Serializer.DeserializeMethodDiscoveryResponse(serializedResponse);\n                        return Convert(discoveryResponse);\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                channel.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                await channel.Completion.ConfigureAwait(false);\n            }\n        }\n\n        public async Task<IReadOnlyCollection<DiscoveredService>> DiscoverAsync(ServiceDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false)\n        {\n            var channel = await _transportConnection.CreateChannelAsync().ConfigureAwait(false);\n            try\n            {\n                using (var msg = _protocol.MessageFactory\n                    .CreateServiceDiscoveryRequest(\n                        Convert(query.ConsumedService),\n                        online ? DiscoveryMode.Online : DiscoveryMode.Offline,\n                        contextLinkageDiscoveryOptions.Convert(_protocol.MessageFactory)))\n                {\n                    var serializedRequest = _protocol.Serializer.Serialize(msg);\n                    await channel.Out.WriteOrDisposeAsync(new TransportMessageFrame(serializedRequest)).ConfigureAwait(false);\n                    channel.Out.TryComplete();\n                    using (var serializedResponse = (await channel.In.ReadAsync().ConfigureAwait(false)).Payload)\n                    {\n                        var discoveryResponse = _protocol.Serializer.DeserializeServiceDiscoveryResponse(serializedResponse);\n                        return Convert(discoveryResponse);\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                channel.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                await channel.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private IReadOnlyCollection<DiscoveredService> Convert(IServiceDiscoveryResponse discoveryResponse)\n        {\n            return discoveryResponse.Services.Select(Convert).ToList();\n        }\n\n        private DiscoveredService Convert(IDiscoveredService discoveredService)\n        {\n            var service = Convert(discoveredService.ProvidedService);\n            return new DiscoveredService(service, discoveredService.ServiceTitle, discoveredService.Methods.Select(m => Convert(service, m)));\n        }\n\n        private DiscoveredMethod Convert(ProvidedServiceReference providedService, IDiscoveredServiceMethod method)\n        {\n            return new DiscoveredMethod(\n                new ProvidedMethodReference(providedService, method.MethodId),\n                method.MethodTitle,\n                method.InputMessageId,\n                method.OutputMessageId,\n                Convert(method.MethodType),\n                method.Options.Select(x => new Option(x.Id, x.Value)).ToList());\n        }\n\n        private ProvidedServiceReference Convert(IProvidedServiceReference providedService)\n        {\n            return new ProvidedServiceReference(\n                providedService.ServiceId, \n                providedService.ServiceAlias, \n                providedService.ApplicationId, \n                providedService.ConnectionId,\n                providedService.ApplicationInstanceId);\n        }\n\n        private Maybe<IConsumedServiceReference> Convert(Maybe<ServiceReference> consumedService)\n        {\n            if (!consumedService.HasValue)\n            {\n                return Maybe<IConsumedServiceReference>.Nothing;\n            }\n            var value = consumedService.Value;\n            return new Maybe<IConsumedServiceReference>(_protocol.MessageFactory.CreateConsumedServiceReference(value.Id, value.Alias));\n        }\n\n        private static IReadOnlyCollection<DiscoveredMethod> Convert(IMethodDiscoveryResponse discoveryResponse)\n        {\n            return discoveryResponse.Methods.Select(Convert).ToList();\n        }\n\n        private static DiscoveredMethod Convert(IDiscoveredMethod method)\n        {\n            return new DiscoveredMethod(\n                new ProvidedMethodReference(\n                    new ProvidedServiceReference( \n                        method.ProvidedMethod.ProvidedService.ServiceId,\n                        method.ProvidedMethod.ProvidedService.ServiceAlias,                    \n                        method.ProvidedMethod.ProvidedService.ApplicationId,\n                        method.ProvidedMethod.ProvidedService.ConnectionId,\n                        method.ProvidedMethod.ProvidedService.ApplicationInstanceId),\n                    method.ProvidedMethod.MethodId),\n                method.MethodTitle,\n                method.InputMessageId,\n                method.OutputMessageId,\n                Convert(method.MethodType),\n                method.Options.Select(x => new Option(x.Id, x.Value)).ToList());\n        }\n\n        private static MethodType Convert(Protocol.Discovery.MethodType methodType)\n        {\n            switch (methodType)\n            {\n                case Protocol.Discovery.MethodType.Unary:\n                    return MethodType.Unary;\n                case Protocol.Discovery.MethodType.ServerStreaming:\n                    return MethodType.ServerStreaming;\n                case Protocol.Discovery.MethodType.ClientStreaming:\n                    return MethodType.ClientStreaming;\n                case Protocol.Discovery.MethodType.DuplexStreaming:\n                    return MethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(methodType), methodType, null);\n            }\n        }\n\n        private Maybe<IConsumedMethodReference> Convert(Maybe<MethodReference> method)\n        {\n            return method.HasValue\n                ? new Maybe<IConsumedMethodReference>(Convert(method.Value))\n                : Maybe<IConsumedMethodReference>.Nothing;\n        }\n\n        private IConsumedMethodReference Convert(MethodReference method)\n        {\n            return _protocol.MessageFactory.CreateConsumedMethodReference(\n                _protocol.MessageFactory.CreateConsumedServiceReference(\n                    method.Service.Id,\n                    method.Service.Alias),\n                method.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Discovery/IDiscoveryService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal.ClientProtocol.Discovery\n{\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n\n    internal interface IDiscoveryService\n    {\n        Task<IReadOnlyCollection<DiscoveredMethod>> DiscoverAsync(MethodDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false);\n\n        Task<IReadOnlyCollection<DiscoveredService>> DiscoverAsync(ServiceDiscoveryQuery query, ContextLinkageOptions contextLinkageDiscoveryOptions = null, bool online = false);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IIncomingInvocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    internal interface IIncomingInvocation<TRequest, TResponse> : IInvocation<TResponse, TRequest>\n    {\n        IncomingInvocationDescriptor Info { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IIncomingInvocationFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Interop.Transport;\n\n    internal interface IIncomingInvocationFactory\n    {\n        IIncomingInvocation<TRequest, TResponse> CreateAsync<TRequest, TResponse>(IncomingInvocationDescriptor info, ITransportChannel channel);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IInvocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using System.Threading.Tasks;    \n\n    internal interface IInvocation<in TRequest, TResponse>\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n\n        Task StartCompletion { get; }\n\n        IReadableChannel<TResponse> In { get; }\n\n        ITerminatableWritableChannel<TRequest> Out { get; }\n\n        void Cancel();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IOutcomingInvocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    internal interface IOutcomingInvocation<TRequest, TResponse> : IInvocation<TRequest, TResponse>\n    {\n        OutcomingInvocationDescriptor Info { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IOutcomingInvocationFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using System.Threading.Tasks;\n\n    internal interface IOutcomingInvocationFactory\n    {\n        ValueTask<IOutcomingInvocation<TRequest, TResponse>> CreateAsync<TRequest, TResponse>(\n            MethodCallDescriptor descriptor, Maybe<TRequest> request = default, Maybe<ContextLinkageOptions> contextLinkageOptions = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IncomingInvocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n\n    internal sealed class IncomingInvocation<TRequest, TResponse> : Invocation<TResponse, TRequest>, IIncomingInvocation<TRequest, TResponse>\n    {\n        private readonly ILogger _log;\n        private readonly ITransportChannel _channel;\n        private readonly IProtocolImplementation _protocol;\n\n        public IncomingInvocation(\n            IncomingInvocationDescriptor info,\n            ITransportChannel channel,\n            IProtocolImplementation protocol,\n            IMarshaller<TRequest> requestMarshaller,\n            IMarshaller<TResponse> responseMarshaller)\n            : base(channel, protocol, responseMarshaller, requestMarshaller)\n        {\n            _log = LogManager.GetLogger<IncomingInvocation<TRequest, TResponse>>(channel.Id.ToString());\n            Info = info;\n            _channel = channel;\n            _protocol = protocol;\n        }\n\n        public IncomingInvocationDescriptor Info { get; }\n\n        protected override async Task InitializeSendingAsync()\n        {\n            using (var invocationStarted = _protocol.MessageFactory.CreateInvocationStarted())\n            {\n                var serialized = _protocol.Serializer.Serialize(invocationStarted);\n                try\n                {\n                    await _channel.Out.WriteAsync(new TransportMessageFrame(serialized), CancellationToken).ConfigureAwait(false);\n                    _log.Trace(\"Invocation started event sent: {0}\", Info);\n                }\n                catch\n                {\n                    serialized.Dispose();\n                    throw;\n                }\n            }\n        }\n\n        protected override Task InitializeReceivingAsync()\n        {\n            return TaskConstants.Completed;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IncomingInvocationDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    internal sealed class IncomingInvocationDescriptor\n    {\n        public InvocationMethodDescriptor Method { get; }\n\n        public AppConnectionDescriptor Source { get; }\n\n        public IncomingInvocationDescriptor(\n            InvocationMethodDescriptor method,\n            AppConnectionDescriptor source)\n        {\n            Method = method;\n            Source = source;\n        }\n\n        public override bool Equals(object obj)\n            => obj is IncomingInvocationDescriptor other\n            && Method.Equals(other.Method)\n            && Source.Equals(other.Source);\n\n        public override int GetHashCode()\n            => Method.GetHashCode()\n            ^ Source.GetHashCode();\n\n        public override string ToString()\n            => $\"{{Type: {nameof(IncomingInvocationDescriptor)}, \" +\n               $\"{nameof(Method)}: {Method}, \" +\n               $\"{nameof(Source)}: {Source}}}\";\n\n\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IncomingInvocationFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n\n    internal sealed class IncomingInvocationFactory : IIncomingInvocationFactory\n    {\n        private readonly IProtocolImplementation _protocol;\n        private readonly IMarshallerProvider _marshaller;\n\n        public IncomingInvocationFactory(IProtocolImplementation protocol, IMarshallerProvider marshaller)\n        {\n            _protocol = protocol;\n            _marshaller = marshaller;\n        }\n\n        public IIncomingInvocation<TRequest, TResponse> CreateAsync<TRequest, TResponse>(IncomingInvocationDescriptor info, ITransportChannel channel)\n        {\n            var invocation = new IncomingInvocation<TRequest, TResponse>(\n                info,\n                channel,\n                _protocol,                \n                _marshaller.GetMarshaller<TRequest>(),\n                _marshaller.GetMarshaller<TResponse>());\n            invocation.Start();\n            return invocation;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/IncomingStreamState.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    internal enum IncomingStreamState\n    {\n        Open,\n        ReceivingMessage,\n        Completed\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/Invocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using Plexus.Processes;\n    using System;\n    using System.Threading.Tasks;\n\n    internal abstract class Invocation<TRequest, TResponse> : ProcessBase, IInvocation<TRequest, TResponse>\n    {\n        private readonly ILogger _log;\n        private readonly ITransportChannel _channel;\n        private readonly InvocationSendProcessor<TRequest> _sender;\n        private readonly InvocationReceiveProcessor<TResponse> _receiver;\n        private readonly InvocationState _invocationState = new InvocationState();\n\n        protected Invocation(\n            ITransportChannel channel,\n            IProtocolImplementation protocol,\n            IMarshaller<TRequest> requestMarshaller,\n            IMarshaller<TResponse> responseMarshaller)\n        {\n            _log = LogManager.GetLogger<Invocation<TRequest, TResponse>>(channel.Id.ToString());\n            _channel = channel;\n            _sender = new InvocationSendProcessor<TRequest>(channel.Id, channel.Out, protocol, requestMarshaller, _invocationState);\n            _receiver = new InvocationReceiveProcessor<TResponse>(channel.Id, channel.In, protocol, responseMarshaller, _sender, _invocationState);\n            _sender.RequestStream.PropagateCompletionFrom(_sender.Completion);\n            OnStop(_sender.Stop);\n            OnStop(_receiver.Stop);\n        }\n\n        protected override ILogger Log => _log;\n\n        public UniqueId Id => _channel.Id;\n\n        public ITerminatableWritableChannel<TRequest> Out => _sender.RequestStream;\n\n        public void Cancel()\n        {\n            Stop();\n        }\n\n        public IReadableChannel<TResponse> In => _receiver.ResponseStream;\n\n        protected abstract Task InitializeSendingAsync();\n\n        protected abstract Task InitializeReceivingAsync();\n\n        protected override async Task<Task> StartCoreAsync()\n        {            \n            try\n            {\n                _log.Trace(\"Starting processing invocation\");\n                await InitializeSendingAsync().ConfigureAwait(false);\n                await _sender.StartAsync().ConfigureAwait(false);\n                await InitializeReceivingAsync().ConfigureAwait(false);\n                await _receiver.StartAsync().ConfigureAwait(false);\n                return ProcessAsync();\n            }\n            catch (Exception ex)\n            {\n                _channel.Out.TryTerminate(ex);\n                await _channel.In.DisposeRemainingItemsAsync().IgnoreExceptions().ConfigureAwait(false);\n                await _channel.Completion.ConfigureAwait(false);\n                throw;\n            }\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                _sender.RequestStream.PropagateCompletionFrom(_receiver.Completion);\n                await _sender.RequestCompletion.ConfigureAwait(false);                \n                _log.Trace(\"Requests completed\");\n                await _receiver.ResponseCompletion.ConfigureAwait(false);\n                _log.Trace(\"Responses completed\");\n                _sender.TryComplete();\n                await _sender.Completion.ConfigureAwait(false);\n                _log.Trace(\"Sending completed\");\n                _channel.Out.TryComplete();\n                await _receiver.Completion.ConfigureAwait(false);\n                _log.Trace(\"Receiving completed\");\n            }\n            catch (Exception ex)\n            {\n                _log.Debug(\"Invocation terminated because of exception: {0}\", ex.FormatTypeAndMessage());\n                _channel.Out.TryTerminate(ex);                \n                throw;\n            }\n            finally\n            {\n                await _channel.In.DisposeRemainingItemsAsync().IgnoreExceptions().ConfigureAwait(false);\n                await _channel.Completion.ConfigureAwait(false);\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/InvocationMethodDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using System.Collections.Generic;\n\n    internal sealed class InvocationMethodDescriptor\n    {\n        public InvocationMethodDescriptor(\n            string serviceId, \n            string methodId,\n            Maybe<string> serviceAliasId = default)\n        {\n            ServiceId = serviceId;\n            MethodId = methodId;\n            ServiceAliasId = serviceAliasId;\n        }\n\n        public string ServiceId { get; }\n\n        public string MethodId { get; }\n\n        public Maybe<string> ServiceAliasId { get; }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationMethodDescriptor descriptor &&\n                   ServiceId == descriptor.ServiceId &&\n                   MethodId == descriptor.MethodId &&\n                   ServiceAliasId.Equals(descriptor.ServiceAliasId);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 84604672;\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ServiceId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(MethodId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<string>>.Default.GetHashCode(ServiceAliasId);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ServiceId)}: {ServiceId}, {nameof(MethodId)}: {MethodId}, {nameof(ServiceAliasId)}: {ServiceAliasId}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/InvocationReceiveProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using Plexus.Processes;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    internal sealed class InvocationReceiveProcessor<TResponse> : ProcessBase\n    {\n        private readonly ILogger _log;\n        private readonly IReadableChannel<TransportMessageFrame> _transport;\n        private readonly InvocationMessageHandler<Nothing, Nothing> _incomingHandler;\n        private readonly IProtocolImplementation _protocol;\n        private readonly MemoryStream _curIncomingMessage = new MemoryStream();\n        private readonly IMarshaller<TResponse> _marshaller;\n        private readonly BufferedChannel<TResponse> _responses = new BufferedChannel<TResponse>(1);\n        private readonly BufferedChannel<TResponse> _buffer = new BufferedChannel<TResponse>(5);\n        private readonly InvocationState _invocationState;\n        private readonly IWritableChannel<IInvocationMessage> _sender;\n\n        private IncomingStreamState _incomingStreamState;\n\n        public InvocationReceiveProcessor(\n            UniqueId id,\n            IReadableChannel<TransportMessageFrame> transport, \n            IProtocolImplementation protocol, \n            IMarshaller<TResponse> marshaller, \n            IWritableChannel<IInvocationMessage> sender, \n            InvocationState invocationState)\n        {\n            _log = LogManager.GetLogger<InvocationReceiveProcessor<TResponse>>(id.ToString());\n            _transport = transport;\n            _protocol = protocol;\n            _marshaller = marshaller;\n            _sender = sender;\n            _invocationState = invocationState;\n            _incomingHandler = new InvocationMessageHandler<Nothing, Nothing>(\n                HandleIncomingMessageHeader,\n                HandleIncomingConfirmation,\n                HandleIncomingCompletion);            \n        }\n\n        protected override ILogger Log => _log;\n\n        public IReadableChannel<TResponse> ResponseStream => _responses.In;\n\n        public Task ResponseCompletion => _responses.Out.Completion;\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            return Task.FromResult(ProcessAsync());\n        }        \n\n        private async Task ProcessAsync()\n        {\n            _responses.Out.PropagateCompletionFrom(_buffer.ConsumeAsync(HandleResponseMessageAsync, CancellationToken));\n            await Task.WhenAll(\n                    ProcessMessagesAsync(),\n                    ResponseCompletion)\n                .ConfigureAwait(false);\n        }\n\n        private async Task HandleResponseMessageAsync(TResponse msg)\n        {\n            var header = _protocol.MessageFactory.CreateInvocationMessageReceived();\n            if (!_sender.TryWrite(header))\n            {\n                await _sender.WriteOrDisposeAsync(header, CancellationToken).ConfigureAwait(false);\n            }\n            Log.Debug(\"Sent confirmation about received response of type {0}\", msg.GetType().Name);\n            if (!_responses.TryWrite(msg))\n            {\n                await _responses.WriteAsync(msg, CancellationToken).ConfigureAwait(false);\n            }\n            Log.Debug(\"Consumed response of type {0}\", msg.GetType().Name);\n        }\n\n        private async Task ProcessMessagesAsync()\n        {\n            try\n            {\n                await _transport.ConsumeAsync(HandleIncomingFrameAsync, CancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.ConsumeBufferedItems(_ => { });\n                throw;\n            }\n            finally\n            {\n                await _buffer.In.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private async Task HandleIncomingFrameAsync(TransportMessageFrame frame)\n        {\n            _log.Trace(\"Handling incoming frame {0}. Current state: {1}.\", frame, _incomingStreamState);\n            switch (_incomingStreamState)\n            {\n                case IncomingStreamState.Open:\n                case IncomingStreamState.Completed:\n                    HandleIncomingHeader(frame);\n                    break;\n                case IncomingStreamState.ReceivingMessage:\n                    await HandleIncomingMessageFrameAsync(frame).ConfigureAwait(false);\n                    break;\n                default:\n                    throw new InvalidOperationException($\"Unexpected state {_incomingStreamState}\");\n            }\n            _log.Trace(\"Handled incoming frame {0}. Current state: {1}.\", frame, _incomingStreamState);\n        }\n\n        private void HandleIncomingHeader(TransportMessageFrame frame)\n        {\n            using (var header = _protocol.Serializer.DeserializeInvocationMessage(frame.Payload))\n            {\n                _log.Trace(\"Handling incoming header: {0}. Current state: {1}.\", header, _incomingStreamState);\n                header.Handle(_incomingHandler);\n            }\n        }\n\n        private async Task HandleIncomingMessageFrameAsync(TransportMessageFrame frame)\n        {\n            _log.Trace(\"Consuming message frame: {0}\", frame);\n            _curIncomingMessage.Write(frame.Payload.Array, frame.Payload.Offset, frame.Payload.Count);\n            if (frame.HasMore)\n            {\n                _log.Trace(\"Consumed message frame {0}\", frame);\n            }\n            else\n            {\n                _curIncomingMessage.Position = 0;\n                var msg = _marshaller.Decode(_curIncomingMessage);\n                _log.Debug(\"Received message of type {0} with length {1}\", msg.GetType().Name, _curIncomingMessage.Length);\n                await _buffer.Out.WriteAsync(msg, CancellationToken).ConfigureAwait(false);\n                _log.Debug(\"Received message added to response buffer: type {0} with length {1}\", msg.GetType().Name, _curIncomingMessage.Length);\n                _curIncomingMessage.Position = 0;\n                _curIncomingMessage.SetLength(0);\n                _incomingStreamState = IncomingStreamState.Open;\n            }\n        }\n\n        private Nothing HandleIncomingCompletion(IInvocationSendCompleted completion, Nothing _)\n        {\n            switch (_incomingStreamState)\n            {\n                case IncomingStreamState.Open:\n                    _log.Debug(\"Incoming message stream completed\");\n                    _incomingStreamState = IncomingStreamState.Completed;\n                    _buffer.Out.TryComplete();\n                    break;\n                default:\n                    throw new InvalidOperationException($\"Received unexpected message when in state {_incomingStreamState}: {completion}\");\n            }\n            return Nothing.Instance;\n        }\n\n        private Nothing HandleIncomingConfirmation(IInvocationMessageReceived confirmation, Nothing _)\n        {\n            switch (_incomingStreamState)\n            {\n                case IncomingStreamState.Open:\n                case IncomingStreamState.Completed:\n                    _invocationState.OnConfirmationReceived();\n                    Log.Trace(\"Confirmation received: {0}\", _invocationState);\n                    break;\n                default:\n                    throw new InvalidOperationException(\n                        $\"Received unexpected message when in state {_incomingStreamState}: {confirmation}\");\n            }\n            return Nothing.Instance;\n        }\n\n        private Nothing HandleIncomingMessageHeader(IInvocationMessageHeader header, Nothing _)\n        {\n            switch (_incomingStreamState)\n            {\n                case IncomingStreamState.Open:\n                    _incomingStreamState = IncomingStreamState.ReceivingMessage;\n                    break;\n                default:\n                    throw new InvalidOperationException($\"Received unexpected message when in state {_incomingStreamState}: {header}\");\n            }\n            return Nothing.Instance;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/InvocationSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using Plexus.Pools;\n    using Plexus.Processes;\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class InvocationSendProcessor<TRequest> : ProcessBase, ITerminatableWritableChannel<IInvocationMessage>\n    {        \n        private readonly ILogger _log;\n\n        private readonly MemoryStream _curOutcomingMessage = new MemoryStream();\n\n        private readonly BufferedChannel<TRequest> _requestBuffer = new BufferedChannel<TRequest>(1);\n\n        private readonly BufferedChannel<(IInvocationMessage Header, Maybe<TRequest> Body)> _buffer\n            = new BufferedChannel<(IInvocationMessage, Maybe<TRequest>)>(10);\n\n        private readonly IWritableChannel<TransportMessageFrame> _transport;\n        private readonly IMarshaller<TRequest> _marshaller;\n        private readonly InvocationState _invocationState;\n        private readonly IProtocolImplementation _protocol;\n        private readonly Promise _requestCompletion = new Promise();\n        private readonly Stopwatch _sendWaitTimer = new Stopwatch();\n\n        public InvocationSendProcessor(\n            UniqueId id,\n            IWritableChannel<TransportMessageFrame> transport,\n            IProtocolImplementation protocol,\n            IMarshaller<TRequest> marshaller, \n            InvocationState invocationState)\n        {\n            _log = LogManager.GetLogger<InvocationSendProcessor<TRequest>>(id.ToString());\n            _transport = transport;\n            _marshaller = marshaller;\n            _invocationState = invocationState;\n            _protocol = protocol;\n            _requestBuffer.PropagateCompletionFrom(_buffer.Out.Completion);\n        }\n\n        protected override ILogger Log => _log;\n\n        public ITerminatableWritableChannel<TRequest> RequestStream => _requestBuffer.Out;\n\n        public Task RequestCompletion => _requestCompletion.Task;\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            return Task.FromResult(ProcessAsync());\n        }\n\n        private Task ProcessAsync()\n        {\n            _requestCompletion.PropagateCompletionFrom(ProcessRequestsAsync());\n            return Task.WhenAll(_requestCompletion.Task, ProcessMessagesAsync());\n        }\n\n        private async Task ProcessRequestsAsync()\n        {\n            try\n            {\n                await _requestBuffer.In.ConsumeAsync(SendRequestAsync, CancellationToken).ConfigureAwait(false);\n                await this.WriteOrDisposeAsync(_protocol.MessageFactory.CreateInvocationSendCompletion(), CancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _requestBuffer.Out.TryTerminate(ex);\n                _requestBuffer.In.ConsumeBufferedItems(x => { });\n                _buffer.Out.TryTerminate(ex);\n                throw;\n            }\n        }\n\n        private async Task ProcessMessagesAsync()\n        {\n            try\n            {\n                await _buffer.In.ConsumeAsync(SendAsync, CancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.ConsumeBufferedItems(x => x.Header.Dispose());\n                _requestBuffer.Out.TryTerminate(ex);\n                _requestBuffer.In.ConsumeBufferedItems(x => { });\n                throw;\n            }\n            finally\n            {\n                await _buffer.In.Completion.ConfigureAwait(false);\n            }\n        }\n\n        private async Task SendRequestAsync(TRequest request)\n        {\n            var task = _invocationState.OnBeforeMessageSendAsync();\n            if (!task.IsCompleted)\n            {                \n                Log.Debug(\"Waiting until send allowed\");\n                _sendWaitTimer.Restart();\n                await task.ConfigureAwait(false);\n                _sendWaitTimer.Stop();\n                Log.Debug(\"Proceeding with sending after waiting {0}ms\", _sendWaitTimer.ElapsedMilliseconds);\n            }\n            Log.Trace(\"Sending message: {0}\", _invocationState);\n            var header = _protocol.MessageFactory.CreateInvocationMessageHeader();\n            try\n            {\n                await _buffer.Out.WriteAsync((header, request), CancellationToken).ConfigureAwait(false);\n            }\n            catch\n            {\n                header.Dispose();\n                throw;\n            }\n        }\n\n        private async Task SendAsync((IInvocationMessage Header, Maybe<TRequest> Body) msg)\n        {\n            await SendHeaderAsync(msg.Header).ConfigureAwait(false);\n\n            if (msg.Body.HasValue)\n            {\n                await SerializeAndSendRequestBodyAsync(msg.Body.Value).ConfigureAwait(false);\n            }\n        }\n\n        private async Task SerializeAndSendRequestBodyAsync(TRequest msg)\n        {\n            _log.Debug(\"Sending message\");\n\n            _curOutcomingMessage.Position = 0;\n            _curOutcomingMessage.SetLength(0);\n            _marshaller.Encode(msg, _curOutcomingMessage);\n            var length = _curOutcomingMessage.Position;\n            long sentBytes = 0;\n            _curOutcomingMessage.Position = 0;\n            bool isLastFrameInMessage;\n            do\n            {\n                var frameLength = (int)(length - sentBytes);\n                if (frameLength > PooledBuffer.MaxSize)\n                {\n                    frameLength = PooledBuffer.MaxSize;\n                    isLastFrameInMessage = false;\n                }\n                else\n                {\n                    isLastFrameInMessage = true;\n                }\n                var payload = await PooledBuffer.Get(_curOutcomingMessage, frameLength, CancellationToken).ConfigureAwait(false);                \n                try\n                {\n                    var frame = new TransportMessageFrame(payload, !isLastFrameInMessage);\n                    _log.Trace(\"Sending frame of message of type {0}: {1}\", msg.GetType().Name, frame);\n                    await _transport.WriteAsync(frame, CancellationToken).ConfigureAwait(false);\n                }\n                catch\n                {\n                    payload.Dispose();\n                    throw;\n                }                \n                sentBytes += frameLength;\n            } while (!isLastFrameInMessage);\n            _curOutcomingMessage.Position = 0;\n            _curOutcomingMessage.SetLength(0);            \n\n            _log.Debug(\"Sent message of type {0}\", msg.GetType().Name);\n        }\n\n        private async Task SendHeaderAsync(IInvocationMessage header)\n        {\n            using (header)\n            {\n                var serialized = _protocol.Serializer.Serialize(header);\n                try\n                {\n                    _log.Trace(\"Sending header: {0}\", header);\n                    var message = new TransportMessageFrame(serialized);\n                    await _transport.WriteAsync(message, CancellationToken).ConfigureAwait(false);\n                    _log.Trace(\"Sent header: {0}\", header);\n                }\n                catch (Exception ex)\n                {\n                    _log.Trace(\"Terminated sending of header {0}: {1}\", header, ex.FormatTypeAndMessage());\n                    serialized.Dispose();\n                    throw;\n                }\n            }\n        }\n\n        public bool TryWrite(IInvocationMessage item)\n        {\n            return _buffer.TryWrite((item, Maybe<TRequest>.Nothing));\n        }\n\n        public Task<bool> WaitWriteAvailableAsync(CancellationToken cancellationToken = default)\n        {\n            using (var cancellation = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken, cancellationToken))\n            {\n                return _buffer.WaitWriteAvailableAsync(cancellation.Token);\n            }\n        }\n\n        public bool TryComplete()\n        {\n            return _buffer.TryComplete();\n        }\n\n        public bool TryTerminate(Exception error = null)\n        {\n            return _buffer.TryTerminate(error);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/InvocationState.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using System;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    internal sealed class InvocationState\n    {\n        private const int MaxPendingConfirmations = 3;\n\n        private readonly BufferedChannel<Nothing> _pendingConfirmations = new BufferedChannel<Nothing>(MaxPendingConfirmations);\n\n        public long SentCount { get; private set; }\n\n        public long ConfirmationsCount { get; private set; }\n\n        public bool ConfirmationsCompleted { get; private set; }\n\n        public async Task OnBeforeMessageSendAsync()\n        {\n            if (ConfirmationsCompleted)\n            {\n                throw new InvalidOperationException(\"Cannot send when confirmations response stream completed\");\n            }\n\n            if (!_pendingConfirmations.Out.TryWrite(Nothing.Instance))\n            {\n                await _pendingConfirmations.Out.WriteAsync(Nothing.Instance).ConfigureAwait(false);\n            }\n\n            if (ConfirmationsCompleted)\n            {\n                throw new InvalidOperationException(\"Cannot send when confirmations response stream completed\");\n            }\n\n            SentCount++;\n        }\n\n        public void OnConfirmationReceived()\n        {\n            ConfirmationsCount++;\n            if (!_pendingConfirmations.In.TryRead(out _))\n            {\n                throw new InvalidOperationException(\n                    $\"Unexpected confirmation received: confirmations count {ConfirmationsCount}, sent messages count {SentCount}\");\n            }\n        }\n\n        public void OnIncomingStreamCompleted()\n        {\n            ConfirmationsCompleted = true;\n            if (ConfirmationsCount != SentCount)\n            {\n                throw new InvalidOperationException(\n                    $\"Received confirmations count {ConfirmationsCount} != sent messages count {SentCount}\");\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(SentCount)}: {SentCount}, {nameof(ConfirmationsCount)}: {ConfirmationsCount}, {nameof(ConfirmationsCompleted)}: {ConfirmationsCompleted}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/InvocationTargetDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using System.Collections.Generic;\n\n    internal sealed class InvocationTargetDescriptor\n    {\n        public InvocationTargetDescriptor(\n            Maybe<string> applicationId = default,\n            Maybe<UniqueId> connectionId = default,\n            Maybe<string> serviceAliasId = default,\n            Maybe<UniqueId> applicationInstanceId = default)\n        {\n            ApplicationId = applicationId;\n            ConnectionId = connectionId;\n            ServiceAliasId = serviceAliasId;\n            ApplicationInstanceId = applicationInstanceId;\n        }\n\n        public Maybe<string> ApplicationId { get; }\n\n        public Maybe<UniqueId> ConnectionId { get; }\n\n        public Maybe<string> ServiceAliasId { get; }\n\n        public Maybe<UniqueId> ApplicationInstanceId { get; }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationTargetDescriptor descriptor &&\n                   ApplicationId.Equals(descriptor.ApplicationId) &&\n                   ConnectionId.Equals(descriptor.ConnectionId) &&\n                   ServiceAliasId.Equals(descriptor.ServiceAliasId) &&\n                   ApplicationInstanceId.Equals(descriptor.ApplicationInstanceId);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 60411934;\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<string>>.Default.GetHashCode(ApplicationId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<UniqueId>>.Default.GetHashCode(ConnectionId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<string>>.Default.GetHashCode(ServiceAliasId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<UniqueId>>.Default.GetHashCode(ApplicationInstanceId);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ApplicationId)}: {ApplicationId}, {nameof(ConnectionId)}: {ConnectionId}, {nameof(ServiceAliasId)}: {ServiceAliasId}, {nameof(ApplicationInstanceId)}: {ApplicationInstanceId}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/OutcomingInvocation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n\n    internal sealed class OutcomingInvocation<TRequest, TResponse> : Invocation<TRequest, TResponse>, IOutcomingInvocation<TRequest, TResponse>\n    {\n        private readonly ILogger _log;\n        private readonly ITransportChannel _channel;\n        private readonly IProtocolImplementation _protocol;\n\n        public OutcomingInvocation(\n            OutcomingInvocationDescriptor descriptor,\n            ITransportChannel channel,\n            IProtocolImplementation protocol,\n            IMarshaller<TRequest> requestMarshaller,\n            IMarshaller<TResponse> responseMarshaller)\n            : base(channel, protocol, requestMarshaller, responseMarshaller)\n        {\n            _channel = channel;\n            _log = LogManager.GetLogger<OutcomingInvocation<TRequest, TResponse>>(_channel.Id.ToString());\n            Info = descriptor;\n            _protocol = protocol;\n        }\n\n        public OutcomingInvocationDescriptor Info { get; }\n\n        protected override async Task InitializeSendingAsync()\n        {\n            var target =\n                Info.Target.HasValue\n                    ? (IInvocationTarget)_protocol.MessageFactory.CreateProvidedMethodReference(\n                        _protocol.MessageFactory.CreateProvidedServiceReference(\n                            Info.Method.ServiceId,\n                            Info.Target.Value.ServiceAliasId,\n                            Info.Target.Value.ApplicationId,\n                            Info.Target.Value.ConnectionId,\n                            Info.Target.Value.ApplicationInstanceId),\n                        Info.Method.MethodId)\n                    : _protocol.MessageFactory.CreateConsumedMethodReference(\n                        _protocol.MessageFactory.CreateConsumedServiceReference(Info.Method.ServiceId, Info.Method.ServiceAliasId),\n                        Info.Method.MethodId);\n            using (var request = _protocol.MessageFactory.CreateInvocationStartRequest(target, Info.ContextLinkageOptions.Convert(_protocol.MessageFactory)))\n            {\n                var serialized = _protocol.Serializer.Serialize(request);\n                try\n                {\n                    await _channel.Out.WriteAsync(new TransportMessageFrame(serialized)).ConfigureAwait(false);\n                    _log.Trace(\"Invocation start request sent: {0}\", Info);\n                }\n                catch\n                {\n                    serialized.Dispose();\n                    throw;\n                }\n            }            \n        }\n\n        protected override async Task InitializeReceivingAsync()\n        {\n            _log.Trace(\"Awaiting invocation start events\");\n            using (var frame = await _channel.In.ReadAsync(CancellationToken).ConfigureAwait(false))\n            using (_protocol.Serializer.DeserializeInvocationStarting(frame.Payload))\n            {\n                _log.Trace(\"Invocation starting event received: {0}\", Info);\n            }\n            using (var frame = await _channel.In.ReadAsync(CancellationToken).ConfigureAwait(false))\n            using (_protocol.Serializer.DeserializeInvocationStarted(frame.Payload))\n            {\n                _log.Trace(\"Invocation started event received: {0}\", Info);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/OutcomingInvocationDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    internal sealed class OutcomingInvocationDescriptor\n    {\n        public OutcomingInvocationDescriptor(\n            InvocationMethodDescriptor method,\n            InvocationTargetDescriptor target = null,\n            Maybe<ContextLinkageOptions> contextLinkageOptions = default)\n        {\n            Method = method;\n            Target = target ?? Maybe<InvocationTargetDescriptor>.Nothing;\n            ContextLinkageOptions = contextLinkageOptions; \n        }\n\n\n        public InvocationMethodDescriptor Method { get; }\n\n        public Maybe<InvocationTargetDescriptor> Target { get; }\n\n        public Maybe<ContextLinkageOptions> ContextLinkageOptions { get; }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {nameof(OutcomingInvocationDescriptor)}, {nameof(Method)}: {Method}, {nameof(Target)}: {Target}}}\";\n        }\n\n        private bool Equals(OutcomingInvocationDescriptor other)\n        {\n            return Equals(Method, other.Method) && Target.Equals(other.Target);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is OutcomingInvocationDescriptor && Equals((OutcomingInvocationDescriptor) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((Method != null ? Method.GetHashCode() : 0) * 397) ^ Target.GetHashCode();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/ClientProtocol/Invocations/OutcomingInvocationFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Internal.ClientProtocol.Invocations\n{\n    using System;\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol;\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using JetBrains.Annotations;\n\n    internal sealed class OutcomingInvocationFactory : IOutcomingInvocationFactory\n    {\n        private readonly ITransportConnection _connection;\n        private readonly IProtocolImplementation _protocol;\n        private readonly IMarshallerProvider _marshaller;\n\n        public OutcomingInvocationFactory(\n            [NotNull] ITransportConnection connection, \n            [NotNull] IProtocolImplementation protocol,\n            [NotNull] IMarshallerProvider marshaller)\n        {\n            _connection = connection ?? throw new ArgumentNullException(nameof(connection));\n            _protocol = protocol ?? throw new ArgumentNullException(nameof(protocol));\n            _marshaller = marshaller ?? throw new ArgumentNullException(nameof(marshaller));\n        }\n\n        public async ValueTask<IOutcomingInvocation<TRequest, TResponse>> CreateAsync<TRequest, TResponse>(\n            MethodCallDescriptor methodCall, Maybe<TRequest> request = default, Maybe<ContextLinkageOptions> contextLinkageOptions = default)\n        {\n            var channel = await _connection.CreateChannelAsync().ConfigureAwait(false);\n            InvocationMethodDescriptor methodDescriptor = null;\n            InvocationTargetDescriptor targetDescriptor = null;\n            if (methodCall.Method.HasValue)\n            {\n                var method = methodCall.Method.Value;\n                methodDescriptor = new InvocationMethodDescriptor(method.Service.Id, method.Name, method.Service.Alias);\n            }\n            if (methodCall.ProvidedMethod.HasValue)\n            {\n                var method = methodCall.ProvidedMethod.Value;\n                methodDescriptor = new InvocationMethodDescriptor(method.ProvidedService.ServiceId, method.Name, method.ProvidedService.ServiceId);\n                targetDescriptor = new InvocationTargetDescriptor(method.ProvidedService.ApplicationId, method.ProvidedService.ConnectionId, method.ProvidedService.ServiceAlias, method.ProvidedService.ApplicationInstanceId);\n            }\n            var descriptor = new OutcomingInvocationDescriptor(methodDescriptor, targetDescriptor, contextLinkageOptions);\n            var invocation = new OutcomingInvocation<TRequest, TResponse>(\n                descriptor,\n                channel,\n                _protocol,\n                GetMarshaller<TRequest>(),\n                GetMarshaller<TResponse>());\n            invocation.Start();\n            if (request.HasValue)\n            {\n                await invocation.Out.WriteAsync(request.Value).ConfigureAwait(false);\n                invocation.Out.TryComplete();\n            }\n            return invocation;\n        }\n\n        private IMarshaller<T> GetMarshaller<T>()\n        {\n            return typeof(T) == typeof(Nothing)\n                ? (IMarshaller<T>) NothingMarshaller.Instance\n                : _marshaller.GetMarshaller<T>();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/DiscoveredMethodInfo.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal\n{\n    using System;\n    using JetBrains.Annotations;\n\n    internal sealed class DiscoveredMethodInfo\n    {\n        public DiscoveredMethodInfo(\n            [NotNull] string hostApplicationId,\n            Maybe<UniqueId> hostConnectionId,             \n            Maybe<string> hostServiceAlias, \n            Maybe<string> title, \n            MethodType type)\n        {\n            HostApplicationId = hostApplicationId ?? throw new ArgumentNullException(nameof(hostApplicationId));\n            HostConnectionId = hostConnectionId;            \n            HostServiceAlias = hostServiceAlias;\n            Title = title;\n            Type = type;\n        }\n\n        public string HostApplicationId { get; }\n\n        public Maybe<UniqueId> HostConnectionId { get; }        \n\n        public Maybe<string> HostServiceAlias { get; }\n\n        public Maybe<string> Title { get; }\n\n        public MethodType Type { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(HostApplicationId)}: {HostApplicationId}, {nameof(HostConnectionId)}: {HostConnectionId}, {nameof(HostServiceAlias)}: {HostServiceAlias}, {nameof(Title)}: {Title}, {nameof(Type)}: {Type}\";\n        }\n\n        private bool Equals(DiscoveredMethodInfo other)\n        {\n            return string.Equals(HostApplicationId, other.HostApplicationId) && HostConnectionId.Equals(other.HostConnectionId) && HostServiceAlias.Equals(other.HostServiceAlias) && Title.Equals(other.Title) && Type == other.Type;\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is DiscoveredMethodInfo && Equals((DiscoveredMethodInfo) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = (HostApplicationId != null ? HostApplicationId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ HostConnectionId.GetHashCode();\n                hashCode = (hashCode * 397) ^ HostServiceAlias.GetHashCode();\n                hashCode = (hashCode * 397) ^ Title.GetHashCode();\n                hashCode = (hashCode * 397) ^ (int) Type;\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/IClientConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal\n{\n    using Plexus.Interop.Transport;\n\n    internal interface IClientConnection : ITransportConnection\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/IMethodCallHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal\n{\n    using Plexus.Interop.Transport;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n\n    internal interface IMethodCallHandler\n    {\n        Task HandleAsync(IncomingInvocationDescriptor info, ITransportChannel channel);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Internal/MethodCallHandlers.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Internal\n{\n    using Plexus.Interop.Internal.Calls;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n\n    internal sealed class MethodCallHandlers\n    {\n        public static IMethodCallHandler Unary<TRequest, TResponse>(\n            UnaryMethodHandler<TRequest, TResponse> methodHandler,\n            IIncomingInvocationFactory incomingInvocationFactory)\n        {\n            return new UnaryMethodCallHandler<TRequest, TResponse>(methodHandler, incomingInvocationFactory);\n        }\n\n        public static IMethodCallHandler ClientStreaming<TRequest, TResponse>(\n            ClientStreamingMethodHandler<TRequest, TResponse> methodHandler,\n            IIncomingInvocationFactory incomingInvocationFactory)\n        {\n            return new ClientStreamingMethodCallHandler<TRequest, TResponse>(methodHandler, incomingInvocationFactory);\n        }\n\n        public static IMethodCallHandler ServerStreaming<TRequest, TResponse>(\n            ServerStreamingMethodHandler<TRequest, TResponse> methodHandler,\n            IIncomingInvocationFactory incomingInvocationFactory)\n        {\n            return new ServerStreamingMethodCallHandler<TRequest, TResponse>(methodHandler, incomingInvocationFactory);\n        }\n\n        public static IMethodCallHandler DuplexStreaming<TRequest, TResponse>(\n            DuplexStreamingMethodHandler<TRequest, TResponse> methodHandler,\n            IIncomingInvocationFactory incomingInvocationFactory)\n        {\n            return new DuplexStreamingMethodCallHandler<TRequest, TResponse>(methodHandler, incomingInvocationFactory);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Method.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n\n    public sealed class Method\n    {\n        public static UnaryMethod<TRequest, TResponse> Unary<TRequest, TResponse>(string serviceId, string methodId)\n        {\n            return new UnaryMethod<TRequest, TResponse>(MethodReference.Create(serviceId, methodId));\n        }\n\n        public static UnaryMethod<TRequest, TResponse> Unary<TRequest, TResponse>(string serviceId, string serviceAlias, string methodId)\n        {\n            return new UnaryMethod<TRequest, TResponse>(MethodReference.Create(serviceId, serviceAlias, methodId));\n        }\n\n        public static ServerStreamingMethod<TRequest, TResponse> ServerStreaming<TRequest, TResponse>(string serviceId, string methodId)\n        {\n            return new ServerStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, methodId));\n        }\n\n        public static ServerStreamingMethod<TRequest, TResponse> ServerStreaming<TRequest, TResponse>(string serviceId, string serviceAlias, string methodId)\n        {\n            return new ServerStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, serviceAlias, methodId));\n        }\n\n        public static ClientStreamingMethod<TRequest, TResponse> ClientStreaming<TRequest, TResponse>(string serviceId, string methodId)\n        {\n            return new ClientStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, methodId));\n        }\n\n        public static ClientStreamingMethod<TRequest, TResponse> ClientStreaming<TRequest, TResponse>(string serviceId, string serviceAlias, string methodId)\n        {\n            return new ClientStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, serviceAlias, methodId));\n        }\n\n        public static DuplexStreamingMethod<TRequest, TResponse> DuplexStreaming<TRequest, TResponse>(string serviceId, string methodId)\n        {\n            return new DuplexStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, methodId));\n        }\n\n        public static DuplexStreamingMethod<TRequest, TResponse> DuplexStreaming<TRequest, TResponse>(string serviceId, string serviceAlias, string methodId)\n        {\n            return new DuplexStreamingMethod<TRequest, TResponse>(MethodReference.Create(serviceId, serviceAlias, methodId));\n        }\n    }\n\n    /// <summary>\n    /// A non-generic representation of a remote method.\n    /// </summary>\n    public class Method<TSend, TReceive> : IMethod<TSend, TReceive>\n    {\n        internal Method(MethodReference methodReference)\n        {\n            Reference = methodReference ?? throw new ArgumentNullException(nameof(methodReference));\n            CallDescriptor = Reference.CallDescriptor;\n        }\n\n        public MethodReference Reference { get; }\n\n        public MethodCallDescriptor CallDescriptor { get; }\n\n        public override string ToString()\n        {\n            return $\"Type: {GetType().FormatName()}, {nameof(Reference)}: {Reference}\";\n        }\n    }\n\n    public class UnaryMethod<TRequest> : Method<TRequest, Nothing>, IUnaryMethod<TRequest, Nothing>\n    {\n        internal UnaryMethod(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public class UnaryMethod<TRequest, TResponse> : Method<TRequest, TResponse>, IUnaryMethod<TRequest, TResponse>\n    {\n        internal UnaryMethod(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public class ServerStreamingMethod<TRequest, TResponse> : Method<TRequest, TResponse>, IServerStreamingMethod<TRequest, TResponse>\n    {\n        internal ServerStreamingMethod(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public class ClientStreamingMethod<TRequest, TResponse> : Method<TRequest, TResponse>, IClientStreamingMethod<TRequest, TResponse>\n    {\n        internal ClientStreamingMethod(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public class DuplexStreamingMethod<TRequest, TResponse> : Method<TRequest, TResponse>, IDuplexStreamingMethod<TRequest, TResponse>\n    {\n        internal DuplexStreamingMethod(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodCallContext.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System.Threading;\n\n    public sealed class MethodCallContext\n    {\n        internal MethodCallContext(\n            string consumerApplicationId,\n            UniqueId consumerApplicationInstanceId,\n            UniqueId consumerConnectionId,\n            TransportType consumerTransportType,\n            CancellationToken cancellationToken)\n        {\n            ConsumerApplicationId = consumerApplicationId;\n            ConsumerApplicationInstanceId = consumerApplicationInstanceId;\n            ConsumerConnectionId = consumerConnectionId;\n            CancellationToken = cancellationToken;\n            ConsumerTransportType = consumerTransportType;\n        }\n\n        public string ConsumerApplicationId { get; }\n\n        public UniqueId ConsumerApplicationInstanceId { get; }\n\n        public UniqueId ConsumerConnectionId { get; }\n\n        public TransportType ConsumerTransportType { get; }\n\n        public CancellationToken CancellationToken { get; }\n\n        public override string ToString()\n            => $\"{nameof(ConsumerApplicationId)}: {ConsumerApplicationId}, \" +\n               $\"{nameof(ConsumerConnectionId)}: {ConsumerConnectionId}, \" +\n               $\"{nameof(ConsumerApplicationInstanceId)}: {ConsumerApplicationInstanceId}, \" +\n               $\"{nameof(ConsumerTransportType)}: {ConsumerTransportType}\";\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodCallDescriptor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class MethodCallDescriptor\n    {\n        public MethodCallDescriptor(MethodReference method) : this(method, default)\n        {\n        }\n\n        public MethodCallDescriptor(ProvidedMethodReference method) : this(default, method)\n        {\n        }\n\n        internal MethodCallDescriptor(\n            Maybe<MethodReference> method,\n            Maybe<ProvidedMethodReference> providedMethod)\n        {\n            Method = method;\n            ProvidedMethod = providedMethod;\n        }\n\n        public Maybe<MethodReference> Method { get; }\n\n        public Maybe<ProvidedMethodReference> ProvidedMethod { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Method)}: {Method}, {nameof(ProvidedMethod)}: {ProvidedMethod}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodCallExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.Runtime.CompilerServices;\n    using System.Threading.Tasks;\n\n    public static class MethodCallExtensions\n    {\n        /// <summary>\n        /// Allows converting this object to Task.\n        /// </summary>\n        public static Task AsTask(this IUnaryMethodCall methodCall)\n        {\n            return methodCall.ResponseAsync;\n        }\n\n        /// <summary>\n        /// Allows awaiting this object directly.\n        /// </summary>\n        public static TaskAwaiter GetAwaiter(this IUnaryMethodCall methodCall)\n        {\n            return methodCall.ResponseAsync.GetAwaiter();\n        }\n\n        /// <summary>\n        /// Allows configuring awaiting for this object.\n        /// </summary>\n        public static ConfiguredTaskAwaitable ConfigureAwait(\n            this IUnaryMethodCall methodCall, bool continueOnCapturedContext)\n        {\n            return methodCall.ResponseAsync.ConfigureAwait(continueOnCapturedContext);\n        }\n\n        /// <summary>\n        /// Allows converting this object to Task.\n        /// </summary>\n        public static Task<TResponse> AsTask<TResponse>(this IUnaryMethodCall<TResponse> methodCall)\n        {\n            return methodCall.ResponseAsync;\n        }\n\n        /// <summary>\n        /// Allows awaiting this object directly.\n        /// </summary>\n        public static TaskAwaiter<TResponse> GetAwaiter<TResponse>(this IUnaryMethodCall<TResponse> methodCall)\n        {\n            return methodCall.ResponseAsync.GetAwaiter();\n        }\n\n        /// <summary>\n        /// Allows configuring awaiting for this object.\n        /// </summary>\n        public static ConfiguredTaskAwaitable<TResponse> ConfigureAwait<TResponse>(\n            this IUnaryMethodCall<TResponse> methodCall, bool continueOnCapturedContext)\n        {\n            return methodCall.ResponseAsync.ConfigureAwait(continueOnCapturedContext);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodDelegates.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop\n{\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    /// <summary>\n    /// Server-side handler for unary call.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this method.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this method.</typeparam>\n    public delegate Task<TResponse> UnaryMethodHandler<in TRequest, TResponse>(TRequest request, MethodCallContext context);\n\n    /// <summary>\n    /// Server-side handler for client streaming call.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this method.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this method.</typeparam>\n    public delegate Task<TResponse> ClientStreamingMethodHandler<TRequest, TResponse>(IReadableChannel<TRequest> requestStream, MethodCallContext context);\n\n    /// <summary>\n    /// Server-side handler for server streaming call.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this method.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this method.</typeparam>\n    public delegate Task ServerStreamingMethodHandler<in TRequest, out TResponse>(TRequest request, IWritableChannel<TResponse> responseStream, MethodCallContext context);\n\n    /// <summary>\n    /// Server-side handler for duplex streaming call.\n    /// </summary>\n    /// <typeparam name=\"TRequest\">Request message type for this method.</typeparam>\n    /// <typeparam name=\"TResponse\">Response message type for this method.</typeparam>\n    public delegate Task DuplexStreamingMethodHandler<TRequest, out TResponse>(IReadableChannel<TRequest> requestStream, IWritableChannel<TResponse> responseStream, MethodCallContext context);\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodDiscoveryQuery.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class MethodDiscoveryQuery\n    {\n        public static MethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>(Method<TRequest, TResponse> method) =>\n            new MethodDiscoveryQuery<TRequest, TResponse>(method.Reference);\n\n        public static UnaryMethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>(UnaryMethod<TRequest, TResponse> method)\n            => new UnaryMethodDiscoveryQuery<TRequest, TResponse>(method.Reference);\n\n        public static ServerStreamingMethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>(ServerStreamingMethod<TRequest, TResponse> method)\n            => new ServerStreamingMethodDiscoveryQuery<TRequest, TResponse>(method.Reference);\n\n        public static ClientStreamingMethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>(ClientStreamingMethod<TRequest, TResponse> method)\n            => new ClientStreamingMethodDiscoveryQuery<TRequest, TResponse>(method.Reference);\n\n        public static DuplexStreamingMethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>(\n            DuplexStreamingMethod<TRequest, TResponse> method)\n            => new DuplexStreamingMethodDiscoveryQuery<TRequest, TResponse>(method.Reference);\n\n        public static MethodDiscoveryQuery<TRequest, TResponse> Create<TRequest, TResponse>() =>\n            new MethodDiscoveryQuery<TRequest, TResponse>();\n\n        public static MethodDiscoveryQuery<TRequest, Nothing> Create<TRequest>() =>\n            new MethodDiscoveryQuery<TRequest, Nothing>();\n\n        public static MethodDiscoveryQuery Create() \n            => new MethodDiscoveryQuery(default, default, default);\n\n        public static MethodDiscoveryQuery Create(MethodReference method) \n            => new MethodDiscoveryQuery(method, default, default);\n\n        public static MethodDiscoveryQuery Create(string inputMessageId) \n            => new MethodDiscoveryQuery(default, inputMessageId, default);\n\n        public static MethodDiscoveryQuery Create(string inputMessageId, string outputMessageId) \n            => new MethodDiscoveryQuery(default, inputMessageId, outputMessageId);\n\n        public Maybe<MethodReference> MethodReference { get; }\n\n        public Maybe<string> InputMessageId { get; }\n\n        public Maybe<string> OutputMessageId { get; }\n\n        internal MethodDiscoveryQuery(\n            Maybe<MethodReference> methodReference, \n            Maybe<string> inputMessageId, \n            Maybe<string> outputMessageId)\n        {\n            MethodReference = methodReference;\n            InputMessageId = inputMessageId;\n            OutputMessageId = outputMessageId;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(MethodReference)}: {MethodReference}, {nameof(InputMessageId)}: {InputMessageId}, {nameof(OutputMessageId)}: {OutputMessageId}\";\n        }\n    }\n\n    public class MethodDiscoveryQuery<TRequest, TResponse>\n    {\n        internal MethodDiscoveryQuery()\n        {\n        }\n\n        internal MethodDiscoveryQuery(MethodDiscoveryQuery<TRequest, TResponse> query) : this(query.MethodReference)\n        {\n\n        }\n\n        internal MethodDiscoveryQuery(MethodReference methodReference) : this(new Maybe<MethodReference>(methodReference))\n        {\n        }\n\n        internal MethodDiscoveryQuery(Maybe<MethodReference> methodReference)\n        {\n            MethodReference = methodReference;\n        }\n\n        public Maybe<MethodReference> MethodReference { get; }\n\n        public override string ToString()\n        {\n            return $\"Type: {GetType().FormatName()}, {nameof(MethodReference)}: {MethodReference}\";\n        }\n    }\n\n    public sealed class UnaryMethodDiscoveryQuery<TRequest, TResponse> : MethodDiscoveryQuery<TRequest, TResponse>\n    {\n        internal UnaryMethodDiscoveryQuery(MethodDiscoveryQuery<TRequest, TResponse> query) : base(query)\n        {\n        }\n\n        internal UnaryMethodDiscoveryQuery(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public sealed class ServerStreamingMethodDiscoveryQuery<TRequest, TResponse> : MethodDiscoveryQuery<TRequest, TResponse>\n    {\n        internal ServerStreamingMethodDiscoveryQuery(MethodDiscoveryQuery<TRequest, TResponse> query) : base(query)\n        {\n        }\n\n        internal ServerStreamingMethodDiscoveryQuery(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public sealed class ClientStreamingMethodDiscoveryQuery<TRequest, TResponse> : MethodDiscoveryQuery<TRequest, TResponse>\n    {\n        internal ClientStreamingMethodDiscoveryQuery(MethodDiscoveryQuery<TRequest, TResponse> query) : base(query)\n        {\n        }\n\n        internal ClientStreamingMethodDiscoveryQuery(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n\n    public sealed class DuplexStreamingMethodDiscoveryQuery<TRequest, TResponse> : MethodDiscoveryQuery<TRequest, TResponse>\n    {\n        internal DuplexStreamingMethodDiscoveryQuery(MethodDiscoveryQuery<TRequest, TResponse> query) : base(query)\n        {\n        }\n\n        internal DuplexStreamingMethodDiscoveryQuery(MethodReference methodReference) : base(methodReference)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class MethodReference : IMethod\n    {\n        public static MethodReference Create(string serviceId, string methodId)\n        {\n            return new MethodReference(ServiceReference.Create(serviceId), methodId);\n        }\n\n        public static MethodReference Create(string serviceId, string serviceAliasId, string methodId)\n        {\n            return new MethodReference(ServiceReference.Create(serviceId, serviceAliasId), methodId);\n        }\n\n        internal MethodReference(ServiceReference service, string name)\n        {\n            Service = service;\n            Name = name;\n            CallDescriptor = new MethodCallDescriptor(this);\n        }\n\n        public ServiceReference Service { get; }\n\n        public string Name { get; }\n\n        public MethodCallDescriptor CallDescriptor { get; }\n\n        public static implicit operator MethodCallDescriptor(MethodReference reference)\n        {\n            return new MethodCallDescriptor(reference);\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Service)}: {{{Service}}}, {nameof(Name)}: {Name}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/MethodType.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public enum MethodType\n    {\n        Unary,\n        ServerStreaming,\n        ClientStreaming,\n        DuplexStreaming\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Option.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class Option\n    {\n        internal Option(string id, string value)\n        {\n            Id = id;\n            Value = value;\n        }\n\n        public string Id { get; }\n\n        public string Value { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(Value)}: {Value}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/Plexus.Interop.Client.Core.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>\n    <AssemblyName>Plexus.Interop.Client.Core</AssemblyName>\n  </PropertyGroup>\n  <ItemGroup>\n    <None Include=\"Internal\\Client.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"JetBrains.Annotations\" Version=\"2018.3.0\" PrivateAssets=\"All\" />\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client.Marshalling.Contracts\\Plexus.Interop.Client.Marshalling.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Contracts\\Plexus.Interop.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ProvidedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class ProvidedMethodReference : IMethod\n    {\n        public static ProvidedMethodReference Create(ProvidedServiceReference providedService, string methodName)\n        {\n            return new ProvidedMethodReference(providedService, methodName);\n        }\n\n        public static ProvidedMethodReference Create(string serviceId, string methodName, string applicationId)\n        {\n            return Create(ProvidedServiceReference.Create(serviceId, applicationId), methodName);\n        }\n\n        public static ProvidedMethodReference Create(string serviceId, string serviceAliasId, string methodName, string applicationId)\n        {\n            return Create(ProvidedServiceReference.Create(serviceId, serviceAliasId, applicationId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithConnectionId(string serviceId, string methodName, UniqueId connectionId)\n        {\n            return Create(ProvidedServiceReference.CreateWithConnectionId(serviceId, default, connectionId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithConnectionId(string serviceId, string methodName, string applicationId, UniqueId connectionId)\n        {\n            return Create(ProvidedServiceReference.CreateWithConnectionId(serviceId, applicationId, connectionId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithConnectionId(string serviceId, string serviceAliasId, string methodName, string applicationId, UniqueId connectionId)\n        {\n            return Create(ProvidedServiceReference.CreateWithConnectionId(serviceId, serviceAliasId, applicationId, connectionId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithAppInstanceId(string serviceId, string methodName, UniqueId appInstanceId)\n        {\n            return Create(ProvidedServiceReference.CreateWithAppInstanceId(serviceId, default, appInstanceId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithAppInstanceId(string serviceId, string methodName, string applicationId, UniqueId appInstanceId)\n        {\n            return Create(ProvidedServiceReference.CreateWithAppInstanceId(serviceId, applicationId, appInstanceId), methodName);\n        }\n\n        public static ProvidedMethodReference CreateWithAppInstanceId(string serviceId, string serviceAliasId, string methodName, string applicationId, UniqueId appInstanceId)\n        {\n            return Create(ProvidedServiceReference.CreateWithAppInstanceId(serviceId, serviceAliasId, applicationId, appInstanceId), methodName);\n        }\n\n        internal ProvidedMethodReference(ProvidedServiceReference providedService, string methodName)\n        {\n            ProvidedService = providedService;\n            Name = methodName;\n            CallDescriptor = new MethodCallDescriptor(this);\n        }\n\n        public ProvidedServiceReference ProvidedService { get; }\n        \n        public string Name { get; }\n\n        public MethodCallDescriptor CallDescriptor { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ProvidedService)}: {{{ProvidedService}}}, {nameof(Name)}: {Name}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ProvidedServiceDefinition.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using Plexus.Interop.Internal;\n    using Plexus.Interop.Internal.ClientProtocol.Invocations;\n    using System.Collections.Generic;\n\n    /// <summary>\n    /// Mapping of method names to call handlers.\n    /// </summary>\n    public sealed class ProvidedServiceDefinition\n    {\n        internal ProvidedServiceDefinition(string id, Maybe<string> alias, IReadOnlyDictionary<string, IMethodCallHandler> callHandlers)\n        {\n            Id = id;\n            Alias = alias;\n            CallHandlers = callHandlers;\n        }\n\n        public string Id { get; }\n\n        public Maybe<string> Alias { get; }\n\n        internal IReadOnlyDictionary<string, IMethodCallHandler> CallHandlers { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(Alias)}: {Alias}\";\n        }\n\n        /// <summary>\n        /// Builder class for <see cref=\"ProvidedServiceDefinition\"/>.\n        /// </summary>\n        public sealed class Builder\n        {            \n            private readonly Dictionary<string, IMethodCallHandler> _callHandlers = new Dictionary<string, IMethodCallHandler>();\n            private readonly IIncomingInvocationFactory _invocationFactory;\n\n            internal Builder(string name, Maybe<string> alias, IIncomingInvocationFactory invocationFactory)\n            {\n                _invocationFactory = invocationFactory;\n                Name = name;\n                Alias = alias;\n            }\n\n            public string Name { get; }\n\n            public Maybe<string> Alias { get; }\n\n            /// <summary>\n            /// Adds a definitions for a single request - single response method.\n            /// </summary>\n            /// <typeparam name=\"TRequest\">The request message class.</typeparam>\n            /// <typeparam name=\"TResponse\">The response message class.</typeparam>\n            /// <param name=\"name\">The method name.</param>\n            /// <param name=\"handler\">The method handler.</param>\n            /// <returns>This builder instance.</returns>\n            public Builder WithUnaryMethod<TRequest, TResponse>(string name, UnaryMethodHandler<TRequest, TResponse> handler)\n            {\n                _callHandlers.Add(name, MethodCallHandlers.Unary(handler, _invocationFactory));\n                return this;\n            }\n\n            /// <summary>\n            /// Adds a definitions for a client streaming method.\n            /// </summary>\n            /// <typeparam name=\"TRequest\">The request message class.</typeparam>\n            /// <typeparam name=\"TResponse\">The response message class.</typeparam>\n            /// <param name=\"name\">The method name.</param>\n            /// <param name=\"handler\">The method handler.</param>\n            /// <returns>This builder instance.</returns>\n            public Builder WithClientStreamingMethod<TRequest, TResponse>(string name, ClientStreamingMethodHandler<TRequest, TResponse> handler)\n            {\n                _callHandlers.Add(name, MethodCallHandlers.ClientStreaming(handler, _invocationFactory));\n                return this;\n            }\n\n            /// <summary>\n            /// Adds a definitions for a server streaming method.\n            /// </summary>\n            /// <typeparam name=\"TRequest\">The request message class.</typeparam>\n            /// <typeparam name=\"TResponse\">The response message class.</typeparam>\n            /// <param name=\"name\">The method name.</param>\n            /// <param name=\"handler\">The method handler.</param>\n            /// <returns>This builder instance.</returns>\n            public Builder WithServerStreamingMethod<TRequest, TResponse>(string name, ServerStreamingMethodHandler<TRequest, TResponse> handler)\n            {\n                _callHandlers.Add(name, MethodCallHandlers.ServerStreaming(handler, _invocationFactory));\n                return this;\n            }\n\n            /// <summary>\n            /// Adds a definitions for a bidirectional streaming method.\n            /// </summary>\n            /// <typeparam name=\"TRequest\">The request message class.</typeparam>\n            /// <typeparam name=\"TResponse\">The response message class.</typeparam>\n            /// <param name=\"name\">The method name.</param>\n            /// <param name=\"handler\">The method handler.</param>\n            /// <returns>This builder instance.</returns>\n            public Builder WithDuplexStreamingMethod<TRequest, TResponse>(string name, DuplexStreamingMethodHandler<TRequest, TResponse> handler)\n            {\n                _callHandlers.Add(name, MethodCallHandlers.DuplexStreaming(handler, _invocationFactory));\n                return this;\n            }\n\n            internal ProvidedServiceDefinition Build()\n            {\n                return new ProvidedServiceDefinition(Name, Alias, _callHandlers);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ProvidedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class ProvidedServiceReference\n    {\n        public static ProvidedServiceReference Create(string serviceId, string applicationId)\n        {\n            return new ProvidedServiceReference(serviceId, default, applicationId, default, default);\n        }\n\n        public static ProvidedServiceReference Create(string serviceId, string serviceAliasId, string applicationId)\n        {\n            return new ProvidedServiceReference(serviceId, serviceAliasId, applicationId, default, default);\n        }\n\n        public static ProvidedServiceReference CreateWithConnectionId(string serviceId, string applicationId, UniqueId connectionId)\n        {\n            return new ProvidedServiceReference(serviceId, default, applicationId, connectionId, default);\n        }\n\n        public static ProvidedServiceReference CreateWithAppInstanceId(string serviceId, string applicationId, UniqueId appInstanceId)\n        {\n            return new ProvidedServiceReference(serviceId, default, applicationId, default, appInstanceId);\n        }\n\n        public static ProvidedServiceReference CreateWithConnectionId(string serviceId, string serviceAliasId, string applicationId, UniqueId connectionId)\n        {\n            return new ProvidedServiceReference(serviceId, serviceAliasId, applicationId, connectionId, default);\n        }\n\n        public static ProvidedServiceReference CreateWithAppInstanceId(string serviceId, string serviceAliasId, string applicationId, UniqueId appInstanceId)\n        {\n            return new ProvidedServiceReference(serviceId, serviceAliasId, applicationId, default, appInstanceId);\n        }\n\n        internal ProvidedServiceReference(string serviceId,\n            Maybe<string> serviceAlias,\n            Maybe<string> applicationId,\n            Maybe<UniqueId> connectionId, \n            Maybe<UniqueId> applicationInstanceId)\n        {\n            ServiceId = serviceId;\n            ServiceAlias = serviceAlias;\n            ApplicationId = applicationId;\n            ConnectionId = connectionId;\n            ApplicationInstanceId = applicationInstanceId;\n        }\n\n        public string ServiceId { get; }\n\n        public Maybe<string> ServiceAlias { get; }\n\n        public Maybe<string> ApplicationId { get; }\n\n        public Maybe<UniqueId> ConnectionId { get; }\n\n        public Maybe<UniqueId> ApplicationInstanceId { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ServiceId)}: {ServiceId}, {nameof(ServiceAlias)}: {ServiceAlias}, {nameof(ApplicationId)}: {ApplicationId}, {nameof(ApplicationInstanceId)}: {ApplicationInstanceId}, {nameof(ConnectionId)}: {ConnectionId}\";\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ServiceDiscoveryQuery.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class ServiceDiscoveryQuery\n    {\n        public static ServiceDiscoveryQuery Create(ServiceReference consumedService)\n        {\n            return new ServiceDiscoveryQuery(consumedService);\n        }\n\n        internal ServiceDiscoveryQuery(Maybe<ServiceReference> consumedService)\n        {\n            ConsumedService = consumedService;\n        }\n\n        public Maybe<ServiceReference> ConsumedService { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ConsumedService)}: {{{ConsumedService}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Core/ServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public sealed class ServiceReference\n    {\n        public static ServiceReference Create(string serviceId, string serviceAlias)\n        {\n            return new ServiceReference(serviceId, serviceAlias);\n        }\n\n        public static ServiceReference Create(string serviceId)\n        {\n            return new ServiceReference(serviceId, Maybe<string>.Nothing);\n        }\n\n        internal ServiceReference(string id, Maybe<string> @alias)\n        {\n            Id = id;\n            Alias = alias;\n        }\n\n        public string Id { get; }\n\n        public Maybe<string> Alias { get; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(Alias)}: {Alias}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Contracts/IMarshaller.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System.IO;\n\n    public interface IMarshaller<T>\n    {\n        string MessageId { get; }\n\n        void Encode(T obj, Stream stream);\n\n        T Decode(Stream stream);        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Contracts/IMarshallerProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    public interface IMarshallerProvider\n    {\n        IMarshaller<T> GetMarshaller<T>();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Contracts/Marshaller.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop\n{\n    using System;\n    using System.IO;\n\n    public sealed class Marshaller<T> : IMarshaller<T>\n    {\n        private readonly Action<T, Stream> _encodeAction;\n        private readonly Func<Stream, T> _decodeFunc;\n\n        public Marshaller(\n            string id,\n            Action<T, Stream> encodeAction,\n            Func<Stream, T> decodeFunc)\n        {\n            MessageId = id;\n            _encodeAction = encodeAction;\n            _decodeFunc = decodeFunc;\n        }\n\n        public string MessageId { get; }\n\n        public void Encode(T obj, Stream stream)\n        {\n            _encodeAction(obj, stream);\n        }\n\n        public T Decode(Stream stream)\n        {\n            return _decodeFunc(stream);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Contracts/NothingMarshaller.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System.IO;\n\n    public sealed class NothingMarshaller : IMarshaller<Nothing>\n    {\n        private static readonly byte[] Buffer = new byte[64];\n\n        public static readonly IMarshaller<Nothing> Instance = new NothingMarshaller();\n\n        private NothingMarshaller()\n        {\n        }\n\n        public string MessageId { get; } = \"interop.Nothing\";\n\n        public void Encode(Nothing obj, Stream stream)\n        {\n        }\n\n        public Nothing Decode(Stream stream)\n        {\n            while (stream.Read(Buffer, 0, Buffer.Length) > 0)\n            {\n            }\n            return Nothing.Instance;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Contracts/Plexus.Interop.Client.Marshalling.Contracts.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Protobuf/Plexus.Interop.Client.Marshalling.Protobuf.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.20.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Client.Marshalling.Contracts\\Plexus.Interop.Client.Marshalling.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Protobuf/ProtobufMarshallerProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using Google.Protobuf;\n    using Google.Protobuf.Reflection;\n    using System;\n    using System.IO;\n    using System.Reflection;\n\n    public sealed class ProtobufMarshallerProvider : IMarshallerProvider\n    {\n        private const int MessageIdFieldNum = 9650;\n        private const string DescriptorPropertyName = \"Descriptor\";\n        private static readonly TypeInfo ProtobufMessageType = typeof(IMessage).GetTypeInfo();\n\n        public IMarshaller<T> GetMarshaller<T>()\n        {\n            var typeInfo = typeof(T).GetTypeInfo();\n            if (!ProtobufMessageType.IsAssignableFrom(typeInfo))\n            {\n                throw new InvalidOperationException($\"Provided type {typeInfo} is not a protobuf message\");\n            }\n            var descriptorProperty = typeInfo.GetDeclaredProperty(DescriptorPropertyName);\n            var messageDescriptor = (MessageDescriptor)descriptorProperty.GetValue(null);\n            if (!messageDescriptor.CustomOptions.TryGetString(MessageIdFieldNum, out var id))\n            {\n                id = messageDescriptor.FullName;\n            }\n            return new Marshaller<T>(id, Encode, Decode<T>);\n        }\n\n        private static T Decode<T>(Stream stream)\n        {\n            var msg = Activator.CreateInstance<T>();\n            ((IMessage)msg).MergeFrom(stream);\n            return msg;\n        }\n\n        private static void Encode<T>(T obj, Stream stream)\n        {\n            ((IMessage)obj).WriteTo(stream);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Protobuf.Tests/Plexus.Interop.Client.Marshalling.Protobuf.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Client.Marshalling.Protobuf</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Client.Marshalling.Protobuf\\Plexus.Interop.Client.Marshalling.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Testing\\Plexus.Interop.Transport.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Client.Marshalling.Protobuf.Tests/ProtobufMarshallerProviderTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Client.Marshalling.Protobuf\n{\n    using System.IO;\n    using Google.Protobuf.WellKnownTypes;\n    using Shouldly;\n    using Xunit;\n\n    public sealed class ProtobufMarshallerProviderTests : TestsSuite\n    {\n        private readonly ProtobufMarshallerProvider _sut = new ProtobufMarshallerProvider();\n\n        [Fact]\n        public void CanGetMarshallerForWellKnownType()\n        {\n            var marshaller = _sut.GetMarshaller<UInt64Value>();\n            var encodedValue = new UInt64Value\n            {\n                Value = ulong.MaxValue\n            };\n            UInt64Value decodedValue;\n            using (var stream = new MemoryStream())\n            {\n                marshaller.Encode(encodedValue, stream);\n                stream.Seek(0, SeekOrigin.Begin);\n                decodedValue = marshaller.Decode(stream);                \n            }\n            marshaller.MessageId.ShouldBe(\"google.protobuf.UInt64Value\");\n            decodedValue.ShouldBe(encodedValue);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/AnyMatchPattern.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public sealed class AnyMatchPattern : IMatchPattern\n    {\n        public static AnyMatchPattern Instance = new AnyMatchPattern();\n\n        public bool IsMatch(string id)\n        {\n            return true;\n        }\n\n        public override string ToString()\n        {\n            return \"Any\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Application.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public sealed class Application : IApplication\n    {\n        public string Id { get; set; }\n\n        public List<IConsumedService> ConsumedServices { get; set; } = new List<IConsumedService>();\n\n        public List<IProvidedService> ProvidedServices { get; set; } = new List<IProvidedService>();\n\n        IReadOnlyCollection<IConsumedService> IApplication.ConsumedServices => ConsumedServices;\n\n        IReadOnlyCollection<IProvidedService> IApplication.ProvidedServices => ProvidedServices;\n\n        public Maybe<LaunchMode> LaunchMode { get; set; }\n\n        private bool Equals(Application other)\n        {\n            return string.Equals(Id, other.Id);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is Application && Equals((Application) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id != null ? Id.GetHashCode() : 0);\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(LaunchMode)}: {LaunchMode}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/CompositeMatchPattern.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n    using System.Linq;\n\n    public sealed class CompositeMatchPattern : IMatchPattern\n    {\n        private readonly IReadOnlyCollection<IMatchPattern> _patterns;\n\n        public CompositeMatchPattern(IEnumerable<IMatchPattern> patterns)\n        {\n            _patterns = new List<IMatchPattern>(patterns);\n        }\n\n        public bool IsMatch(string id)\n        {\n            return _patterns.Any(x => x.IsMatch(id));\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(_patterns)}: {string.Join(\", \", _patterns)}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/ConsumedMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public sealed class ConsumedMethod : IConsumedMethod\n    {\n        public IMethod Method { get; set; }\n\n        public IConsumedService ConsumedService { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Method)}: {Method}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/ConsumedService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public sealed class ConsumedService : IConsumedService\n    {\n        public IService Service { get; set; }\n\n        public IApplication Application { get; set; }\n\n        public IMatchPattern From { get; set; }\n\n        public Maybe<string> Alias { get; set; }\n\n        public Dictionary<string, IConsumedMethod> Methods { get; set; } = new Dictionary<string, IConsumedMethod>();\n\n        IReadOnlyDictionary<string, IConsumedMethod> IConsumedService.Methods => Methods;\n\n        public override string ToString()\n        {\n            return $\"{nameof(Service)}: {Service.Id}, {nameof(Alias)}: {Alias}, {nameof(From)}: {From}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/MatchPattern.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System;\n\n    public sealed class MatchPattern : IMatchPattern\n    {\n        public MatchPattern(MatchType type, string value)\n        {\n            Type = type;\n            Value = value;\n        }\n\n        public MatchType Type { get; }\n\n        public string Value { get; }\n\n        public bool IsMatch(string id)\n        {\n            switch (Type)\n            {\n                case MatchType.Exact:\n                    return string.Equals(id, Value);\n                case MatchType.StartsWith:\n                    return id.StartsWith(Value);\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Type)}: {Type}, {nameof(Value)}: {Value}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Message.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public sealed class Message : IMessage\n    {\n        public string Id { get; set; }\n\n        private bool Equals(Message other)\n        {\n            return string.Equals(Id, other.Id);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is Message message && Equals(message);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id != null ? Id.GetHashCode() : 0);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Method.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel\n{\n    public sealed class Method : IMethod\n    {\n        public string Name { get; set; }\n\n        public MethodType Type { get; set; }\n\n        public IMessage InputMessage { get; set; }\n\n        public IMessage OutputMessage { get; set; }\n\n        public IService Service { get; set; }\n\n        private bool Equals(Method other)\n        {\n            return string.Equals(Name, other.Name) && Equals(Service, other.Service);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is Method && Equals((Method) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((Name != null ? Name.GetHashCode() : 0) * 397) ^ (Service != null ? Service.GetHashCode() : 0);\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Name)}: {Name}, {nameof(Type)}: {Type}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Option.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public sealed class Option : IOption\n    {\n        public string Id { get; set; }\n        public string Value { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(Value)}: {Value}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Plexus.Interop.Metamodel.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Metamodel</RootNamespace>\n    <IsPackable>true</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Contracts\\Plexus.Interop.Metamodel.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/ProvidedMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public sealed class ProvidedMethod : IProvidedMethod\n    {\n        public Maybe<string> Title { get; set; }\n               \n        public IProvidedService ProvidedService { get; set; }\n\n        public IMethod Method { get; set; }\n\n        public Maybe<LaunchMode> LaunchMode { get; set; }\n\n        public int TimeoutMs { get; set; } = 0;\n\n        public IReadOnlyCollection<IOption> Options { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Title)}: {Title}, {nameof(Method)}: {Method}, {nameof(LaunchMode)}: {LaunchMode}, {nameof(TimeoutMs)}: {TimeoutMs}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/ProvidedService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public sealed class ProvidedService : IProvidedService\n    {\n        public IService Service { get; set; }\n\n        public IApplication Application { get; set; }\n\n        public IMatchPattern To { get; set; }\n\n        public Maybe<string> Title { get; set; }\n\n        public Maybe<string> Alias { get; set; }\n\n        public Dictionary<string, IProvidedMethod> Methods { get; set; } = new Dictionary<string, IProvidedMethod>();        \n\n        IReadOnlyDictionary<string, IProvidedMethod> IProvidedService.Methods => Methods;\n\n        public Maybe<LaunchMode> LaunchMode { get; set; } = Metamodel.LaunchMode.SingleInstance;\n\n        public override string ToString()\n        {\n            return $\"{nameof(Service)}: {Service.Id}, {nameof(Alias)}: {Alias}, {nameof(Title)}: {Title}, {nameof(To)}: {To}, {nameof(LaunchMode)}: {LaunchMode}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Registry.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System;\n    using System.Collections.Generic;\n\n    public sealed class Registry : IRegistry, IRegistryProvider\n    {\n        public static readonly Registry Empty = new Registry();\n\n        public Dictionary<string, IApplication> Applications { get; set; } = new Dictionary<string, IApplication>();\n\n        public Dictionary<string, IService> Services { get; set; } = new Dictionary<string, IService>();\n\n        public Dictionary<string, IMessage> Messages { get; set; } = new Dictionary<string, IMessage>();\n\n        IReadOnlyDictionary<string, IApplication> IRegistry.Applications => Applications;\n\n        IReadOnlyDictionary<string, IMessage> IRegistry.Messages => Messages;\n\n        IReadOnlyDictionary<string, IService> IRegistry.Services => Services;\n\n        public IRegistry Current => this;\n\n        public event Action<IRegistry> Updated\n        {\n            add { value(this); }\n            remove { }\n        }\n\n        public IRegistry MergeWith(IRegistry registry)\n        {\n            var newRegistry = new Registry();\n            newRegistry.AddAll(registry);\n            newRegistry.AddAll(this);\n            return newRegistry;\n        }\n\n        private void AddAll(IRegistry registry)\n        {\n            foreach (var message in registry.Messages.Values)\n            {\n                Messages[message.Id] = message;\n            }\n            foreach (var service in registry.Services.Values)\n            {\n                Services[service.Id] = service;\n            }\n            foreach (var app in registry.Applications.Values)\n            {\n                Applications[app.Id] = app;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel/Service.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public sealed class Service : IService\n    {\n        public string Id { get; set; }\n\n        public Dictionary<string, IMethod> Methods { get; set; } = new Dictionary<string, IMethod>();\n\n        IReadOnlyDictionary<string, IMethod> IService.Methods => Methods;\n\n        private bool Equals(Service other)\n        {\n            return string.Equals(Id, other.Id);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is Service service && Equals(service);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id != null ? Id.GetHashCode() : 0);\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IApplication.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IApplication\n    {\n        string Id { get; }\n\n        IReadOnlyCollection<IConsumedService> ConsumedServices { get; }\n\n        IReadOnlyCollection<IProvidedService> ProvidedServices { get; }\n\n        Maybe<LaunchMode> LaunchMode { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IConsumedMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public interface IConsumedMethod\n    {\n        IMethod Method { get; }\n\n        IConsumedService ConsumedService { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IConsumedService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IConsumedService\n    {\n        IService Service { get; }\n\n        IApplication Application { get; }\n\n        IMatchPattern From { get; }\n\n        Maybe<string> Alias { get; }\n\n        IReadOnlyDictionary<string, IConsumedMethod> Methods { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IMatchPattern.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public interface IMatchPattern\n    {\n        bool IsMatch(string id);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public interface IMessage\n    {\n        string Id { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public interface IMethod\n    {\n        string Name { get; }\n\n        MethodType Type { get; }\n\n        IMessage InputMessage { get; }\n\n        IMessage OutputMessage { get; }\n\n        IService Service { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IOption.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public interface IOption\n    {\n        string Id { get; }\n        string Value { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IProvidedMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IProvidedMethod\n    {\n        IMethod Method { get; }\n\n        IProvidedService ProvidedService { get; }\n\n        Maybe<string> Title { get; }\n\n        Maybe<LaunchMode> LaunchMode { get; }\n\n        int TimeoutMs { get; }\n\n        IReadOnlyCollection<IOption> Options { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IProvidedService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IProvidedService\n    {\n        IService Service { get; }\n\n        IApplication Application { get; }\n\n        IMatchPattern To { get; }\n\n        Maybe<string> Title { get; }\n\n        Maybe<string> Alias { get; }\n\n        IReadOnlyDictionary<string, IProvidedMethod> Methods { get; }\n\n        Maybe<LaunchMode> LaunchMode { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IRegistry.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IRegistry\n    {\n        IReadOnlyDictionary<string, IApplication> Applications { get; }\n\n        IReadOnlyDictionary<string, IMessage> Messages { get; }\n\n        IReadOnlyDictionary<string, IService> Services { get; }\n\n        IRegistry MergeWith(IRegistry registry);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System;\n\n    public interface IRegistryProvider\n    {\n        IRegistry Current { get; }\n\n        event Action<IRegistry> Updated;        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/IService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    using System.Collections.Generic;\n\n    public interface IService\n    {\n        string Id { get; }\n\n        IReadOnlyDictionary<string, IMethod> Methods { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/LaunchMode.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Metamodel\n{\n    public enum LaunchMode\n    {\n        None,\n        SingleInstance,\n        MultiInstance\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/MatchType.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public enum MatchType\n    {\n        Exact,\n        StartsWith,\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/MethodType.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel\n{\n    public enum MethodType\n    {\n        Unary,\n        ServerStreaming,\n        ClientStreaming,\n        DuplexStreaming\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Contracts/Plexus.Interop.Metamodel.Contracts.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Metamodel</RootNamespace>\n    <IsPackable>true</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ApplicationDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ApplicationDto\n    {\n        private List<ProvidedServiceDto> _providedServices = new List<ProvidedServiceDto>();\n        private List<ConsumedServiceDto> _consumedServices = new List<ConsumedServiceDto>();\n        private List<OptionDto> _options = new List<OptionDto>();\n\n        [DataMember(Name = \"id\")]\n        public string Id { get; set; }\n\n        [DataMember(Name = \"provides\")]\n        public List<ProvidedServiceDto> ProvidedServices\n        {\n            get => _providedServices = _providedServices ?? new List<ProvidedServiceDto>();\n            set => _providedServices = value ?? new List<ProvidedServiceDto>();\n        }\n\n        [DataMember(Name = \"consumes\")]\n        public List<ConsumedServiceDto> ConsumedServices\n        {\n            get => _consumedServices = _consumedServices ?? new List<ConsumedServiceDto>();\n            set => _consumedServices = value ?? new List<ConsumedServiceDto>();\n        }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ConsumedMethodDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ConsumedMethodDto\n    {\n        private List<OptionDto> _options = new List<OptionDto>();\n\n        [DataMember(Name = \"name\")]\n        public string Name { get; set; }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ConsumedServiceDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ConsumedServiceDto\n    {\n        private List<OptionDto> _options = new List<OptionDto>();\n        private List<ConsumedMethodDto> _methods = new List<ConsumedMethodDto>();\n        private List<string> _from = new List<string>();\n\n        [DataMember(Name = \"service\")]\n        public string ServiceId{ get; set; }\n\n        [DataMember(Name = \"methods\")]\n        public List<ConsumedMethodDto> Methods\n        {\n            get => _methods = _methods ?? new List<ConsumedMethodDto>();\n            set => _methods = value ?? new List<ConsumedMethodDto>();\n        }\n\n        [DataMember(Name = \"alias\")]\n        public string Alias { get; set; }\n\n        [DataMember(Name = \"from\")]\n        public List<string> From\n        {\n            get => _from = _from ?? new List<string>();\n            set => _from = value ?? new List<string>();\n        }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/MethodDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;    \n\n    [DataContract]\n    internal sealed class MethodDto\n    {\n        private List<OptionDto> _options = new List<OptionDto>();\n\n        [DataMember(Name = \"name\")]\n        public string Name { get; set; }\n\n        [DataMember(Name = \"title\")]\n        public string Title { get; set; }\n\n        [DataMember(Name = \"request\")]\n        public string RequestMessageId { get; set; }\n\n        [DataMember(Name = \"response\")]\n        public string ResponseMessageId { get; set; }\n\n        public MethodTypeDto Type { get; set; }\n\n        [DataMember(Name = \"type\")]\n        internal string TypeInternal\n        {\n            get => Enum.GetName(typeof(MethodTypeDto), Type);\n            set => Type = (MethodTypeDto)Enum.Parse(typeof(MethodTypeDto), value);\n        }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/MethodTypeDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Runtime.Serialization;\n\n    internal enum MethodTypeDto\n    {\n        [EnumMember(Value = \"Unary\")]\n        Unary,\n        [EnumMember(Value = \"ServerStreaming\")]\n        ServerStreaming,\n        [EnumMember(Value = \"ClientStreaming\")]\n        ClientStreaming,\n        [EnumMember(Value = \"DuplexStreaming\")]\n        DuplexStreaming\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/OptionDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class OptionDto\n    {\n        [DataMember(Name = \"id\")]\n        public string Id { get; set; }\n\n        [DataMember(Name = \"value\")]\n        public string Value { get; set; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/OptionListExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json.Internal\n{    \n    using System.Collections.Generic;\n    using System.Linq;\n\n    internal static class OptionListExtensions\n    {\n        public static Maybe<string> GetValue(this ICollection<OptionDto> options, string id)\n        {\n            var option = options.FirstOrDefault(x => x.Id.Equals(id));\n            if (option == null)\n            {\n                return Maybe<string>.Nothing;\n            }\n            return option.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ProvidedMethodDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ProvidedMethodDto\n    {\n        private List<OptionDto> _options = new List<OptionDto>();\n\n        [DataMember(Name = \"name\")]\n        public string Name { get; set; }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ProvidedServiceDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ProvidedServiceDto\n    {\n        private List<ProvidedMethodDto> _methods = new List<ProvidedMethodDto>();\n        private List<OptionDto> _options = new List<OptionDto>();\n        private List<string> _to = new List<string>();\n\n        [DataMember(Name = \"service\")]\n        public string ServiceId { get; set; }\n\n        [DataMember(Name = \"methods\")]\n        public List<ProvidedMethodDto> Methods\n        {\n            get => _methods = _methods ?? new List<ProvidedMethodDto>();\n            set => _methods = value ?? new List<ProvidedMethodDto>();\n        }\n\n        [DataMember(Name = \"to\")]\n        public List<string> To\n        {\n            get => _to = _to ?? new List<string>();\n            set => _to = value ?? new List<string>();\n        }\n\n        [DataMember(Name = \"alias\")]\n        public string Alias { get; set; }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/RegistryDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class RegistryDto\n    {\n        private List<ServiceDto> _services = new List<ServiceDto>();\n        private List<ApplicationDto> _applications = new List<ApplicationDto>();\n\n        [DataMember(Name = \"services\")]\n        public List<ServiceDto> Services\n        {\n            get => _services = _services ?? new List<ServiceDto>();\n            set => _services = value ?? new List<ServiceDto>();\n        }\n\n        [DataMember(Name = \"applications\")]\n        public List<ApplicationDto> Applications\n        {\n            get => _applications = _applications ?? new List<ApplicationDto>();\n            set => _applications = value ?? new List<ApplicationDto>();\n        }\n\n        public static RegistryDto LoadFromFile(string filePath) =>\n            JsonConvert.DeserializeFromFile<RegistryDto>(filePath);\n\n        public static RegistryDto LoadFromStream(Stream stream) => JsonConvert.Deserialize<RegistryDto>(stream);\n\n        public static RegistryDto Parse(string content) => JsonConvert.Deserialize<RegistryDto>(content);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Internal/ServiceDto.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json.Internal\n{\n    using System.Collections.Generic;\n    using System.Runtime.Serialization;\n\n    [DataContract]\n    internal sealed class ServiceDto\n    {\n        private List<MethodDto> _methods = new List<MethodDto>();\n        private List<OptionDto> _options = new List<OptionDto>();\n\n        [DataMember(Name = \"id\")]\n        public string Id { get; set; }\n        \n        [DataMember(Name = \"methods\")]\n        public List<MethodDto> Methods\n        {\n            get => _methods = _methods ?? new List<MethodDto>();\n            set => _methods = value ?? new List<MethodDto>();\n        }\n\n        [DataMember(Name = \"options\")]\n        public List<OptionDto> Options\n        {\n            get => _options = _options ?? new List<OptionDto>();\n            set => _options = value ?? new List<OptionDto>();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/JsonFileRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json\n{\n    public sealed class JsonRegistryProvider : BaseJsonFileRegistryProvider<IRegistry>, IRegistryProvider\n    {\n        public JsonRegistryProvider(string jsonFileName) : base(jsonFileName)\n        { }\n\n        public override IRegistry ParseRegistry(string registryContent)\n        {\n            return JsonRegistry.FromContent(registryContent);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/JsonRegistry.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Metamodel.Json\n{\n    using Plexus.Interop.Metamodel.Json.Internal;\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Linq;\n\n    public static class JsonRegistry\n    {\n        public static IRegistry LoadRegistry(string fileName)\n        {\n            using (var stream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n            {\n                return LoadRegistry(stream);\n            }\n        }\n\n        public static IRegistry LoadRegistry(Stream stream)\n        {\n            return LoadRegistry(RegistryDto.LoadFromStream(stream));\n        }\n\n        public static IRegistry FromContent(string registryContent)\n        {\n            return LoadRegistry(RegistryDto.Parse(registryContent));\n        }\n\n        private static IRegistry LoadRegistry(RegistryDto dto)\n        {\n            var messageIds =\n                from svcDto in dto.Services\n                from metDto in svcDto.Methods\n                from mid in new[] {metDto.RequestMessageId, metDto.ResponseMessageId}\n                select mid;\n            var messages = messageIds.Distinct().ToDictionary(x => x, x => (IMessage) new Message {Id = x});\n            var services = dto.Services.Select(x => Convert(messages, x)).ToDictionary(x => x.Id, x => x);\n            var applications = dto.Applications.Select(x => Convert(services, x)).ToDictionary(x => x.Id, x => x);\n            return new Registry\n            {\n                Messages = messages,\n                Services = services,\n                Applications = applications\n            };\n        }\n\n        private static IService Convert(IReadOnlyDictionary<string, IMessage> messages, ServiceDto svcDto)\n        {\n            var service = new Service { Id = svcDto.Id };\n            service.Methods = svcDto.Methods.Select(x =>\n                (IMethod)new Method\n                {\n                    Name = x.Name,\n                    InputMessage = messages[x.RequestMessageId],\n                    OutputMessage = messages[x.ResponseMessageId],\n                    Service = service,\n                    Type = Convert(x.Type)\n                })\n                .ToDictionary(x => x.Name, x => x);\n            return service;\n        }\n\n        private static IApplication Convert(\n            IReadOnlyDictionary<string, IService> services,\n            ApplicationDto appDto)\n        {\n            var app = new Application { Id = appDto.Id };\n            app.ConsumedServices = appDto.ConsumedServices.Select(x => Convert(app, services[x.ServiceId], x)).ToList();\n            app.ProvidedServices = appDto.ProvidedServices.Select(x => Convert(app, services[x.ServiceId], x)).ToList();\n            app.LaunchMode = ConvertLaunchMode(\n                appDto.Options.GetValue(\"interop.ApplicationOptions.launch_on_call\").GetValueOrDefault());\n            return app;\n        }\n\n        private static IConsumedService Convert(\n            IApplication application,\n            IService service,\n            ConsumedServiceDto dto)\n        {\n            var cs = new ConsumedService\n            {\n                Alias = ConvertMaybe(dto.Alias),\n                Service = service,\n                Application = application,\n                From = ConvertMatchPatterns(dto.From)\n            };\n            cs.Methods = dto.Methods\n                .Select(x => (IConsumedMethod)new ConsumedMethod { Method = service.Methods[x.Name], ConsumedService = cs })\n                .ToDictionary(x => x.Method.Name, x => x);\n            return cs;\n        }\n\n        private static IMatchPattern ConvertMatchPatterns(IReadOnlyCollection<string> dto)\n        {\n            return dto.Count == 0\n                ? (IMatchPattern)AnyMatchPattern.Instance\n                : new CompositeMatchPattern(dto.Select(ConvertMatchPattern));\n        }\n\n        private static IMatchPattern ConvertMatchPattern(string str)\n        {\n            return str.EndsWith(\"*\")\n                ? new MatchPattern(MatchType.StartsWith, str.Substring(0, str.Length - 1))\n                : new MatchPattern(MatchType.Exact, str);\n        }\n\n        private static IProvidedService Convert(\n            IApplication application,\n            IService service,\n            ProvidedServiceDto dto)\n        {\n            var ps = new ProvidedService\n            {\n                Alias = ConvertMaybe(dto.Alias),\n                Service = service,\n                Title = dto.Options.GetValue(\"interop.ProvidedServiceOptions.title\"),\n                Application = application,\n                To = ConvertMatchPatterns(dto.To),\n                LaunchMode = ConvertLaunchMode(\n                    dto.Options.GetValue(\"interop.ProvidedServiceOptions.launch_on_call\").GetValueOrDefault())\n        };\n            ps.Methods = dto.Methods\n                .Select(x => (IProvidedMethod)new ProvidedMethod\n                {\n                    Method = service.Methods[x.Name], \n                    ProvidedService = ps, \n                    Title = x.Options.GetValue(\"interop.ProvidedMethodOptions.title\"),\n                    LaunchMode = ConvertLaunchMode(\n                        x.Options.GetValue(\"interop.ProvidedMethodOptions.launch_on_call\").GetValueOrDefault()),\n                    TimeoutMs = int.TryParse(\n                        x.Options.GetValue(\"interop.ProvidedMethodOptions.timeout_ms\").GetValueOrDefault(), \n                        out var result) ? result : 0,\n                    Options = x.Options.Select(o => new Option { Id = o.Id, Value = o.Value }).ToList()\n                })\n                .ToDictionary(x => x.Method.Name, x => x);\n            return ps;\n        }\n\n        private static MethodType Convert(MethodTypeDto dto)\n        {\n            switch (dto)\n            {\n                case MethodTypeDto.Unary:\n                    return MethodType.Unary;\n                case MethodTypeDto.ServerStreaming:\n                    return MethodType.ServerStreaming;\n                case MethodTypeDto.ClientStreaming:\n                    return MethodType.ClientStreaming;\n                case MethodTypeDto.DuplexStreaming:\n                    return MethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(dto), dto, null);\n            }\n        }\n\n        private static Maybe<string> ConvertMaybe(string s)\n        {\n            return string.IsNullOrEmpty(s) ? Maybe<string>.Nothing : new Maybe<string>(s);\n        }\n\n        private static Maybe<LaunchMode> ConvertLaunchMode(string value)\n        {\n            switch (value)\n            {\n                case \"NEVER\":\n                case \"DISABLED\":\n                    return LaunchMode.None;\n                case \"ALWAYS\": \n                case \"ENABLED\": \n                    return LaunchMode.MultiInstance;\n                case \"DEFAULT\":\n                case \"IF_NOT_LAUNCHED\":\n                    return LaunchMode.SingleInstance;\n                default: \n                    return Maybe<LaunchMode>.Nothing;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json/Plexus.Interop.Metamodel.Json.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <IsPackable>true</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel\\Plexus.Interop.Metamodel.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json.Tests/JsonRegistryProviderTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Metamodel.Json\n{\n    using System.Linq;\n    using Shouldly;\n    using Xunit;\n\n    public sealed class JsonRegistryProviderTests : TestsSuite\n    {\n        [Fact]\n        public void ParsesRegistryJson()\n        {\n            using (var provider = new JsonRegistryProvider(\"interop.json\"))\n            {\n                var registry = provider.Current;\n\n                registry.ShouldNotBeNull();\n                registry.Services.Count.ShouldBe(2);\n                registry.Applications.Count.ShouldBe(4);\n                registry.Messages.Count.ShouldBe(3);\n\n                var message = registry.Messages[\"interop.testing.EchoRequest\"];\n                message.Id.ShouldBe(\"interop.testing.EchoRequest\");\n\n                var service = registry.Services[\"interop.testing.EchoService\"];\n                service.Id.ShouldBe(\"interop.testing.EchoService\");\n                service.Methods.Count.ShouldBe(4);\n\n                var unaryMethod = service.Methods[\"Unary\"];\n                unaryMethod.Service.ShouldBe(service);\n                unaryMethod.InputMessage.ShouldBe(message);\n                unaryMethod.OutputMessage.ShouldBe(message);\n                unaryMethod.Type.ShouldBe(MethodType.Unary);                \n\n                var clientStreamingMethod = service.Methods[\"ClientStreaming\"];\n                clientStreamingMethod.Service.ShouldBe(service);\n                clientStreamingMethod.InputMessage.ShouldBe(message);\n                clientStreamingMethod.OutputMessage.ShouldBe(message);\n                clientStreamingMethod.Type.ShouldBe(MethodType.ClientStreaming);\n\n                var consumerApp = registry.Applications[\"interop.testing.EchoClient\"];\n                consumerApp.ConsumedServices.Count.ShouldBe(1);\n                var consumedService = consumerApp.ConsumedServices.Single();\n                consumedService.Service.ShouldBe(service);\n                consumedService.Alias.ShouldBe(Maybe<string>.Nothing);\n                consumedService.From.ShouldNotBeNull();\n                consumedService.From.IsMatch(\"interop.testing.EchoServer\").ShouldBe(true);\n                consumedService.From.IsMatch(\"something.EchoServer\").ShouldBe(false);\n                consumedService.Methods.Count.ShouldBe(4);\n                consumedService.Methods[\"ClientStreaming\"].Method.ShouldBe(clientStreamingMethod);            \n\n                var providerApp = registry.Applications[\"interop.testing.EchoServer\"];\n                providerApp.ProvidedServices.Count.ShouldBe(1);\n                var providedService = providerApp.ProvidedServices.Single();\n                providedService.Service.ShouldBe(service);\n                providedService.Alias.ShouldBe(Maybe<string>.Nothing);\n                providedService.To.ShouldNotBeNull();\n                providedService.To.IsMatch(\"interop.testing.*\").ShouldBe(true);\n                providedService.Title.ShouldBe(\"Sample Echo Service Implementation\");\n                var providedMethod = providedService.Methods[\"Unary\"];\n                providedMethod.Method.ShouldBe(unaryMethod);\n                providedMethod.LaunchMode.ShouldBe(LaunchMode.MultiInstance);                \n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json.Tests/Plexus.Interop.Metamodel.Json.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Metamodel.Json</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Metamodel.Json\\Plexus.Interop.Metamodel.Json.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"interop.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Metamodel.Json.Tests/interop.json",
    "content": "﻿{\n  \"services\": [\n    {\n      \"id\": \"interop.testing.EchoService\",\n      \"methods\": [\n        {\n          \"name\": \"Unary\",\n          \"request\": \"interop.testing.EchoRequest\",\n          \"response\": \"interop.testing.EchoRequest\",\n          \"type\": \"Unary\"\n        },\n        {\n          \"name\": \"ServerStreaming\",\n          \"request\": \"interop.testing.EchoRequest\",\n          \"response\": \"interop.testing.EchoRequest\",\n          \"type\": \"ServerStreaming\"\n        },\n        {\n          \"name\": \"ClientStreaming\",\n          \"request\": \"interop.testing.EchoRequest\",\n          \"response\": \"interop.testing.EchoRequest\",\n          \"type\": \"ClientStreaming\"\n        },\n        {\n          \"name\": \"DuplexStreaming\",\n          \"request\": \"interop.testing.EchoRequest\",\n          \"response\": \"interop.testing.EchoRequest\",\n          \"type\": \"DuplexStreaming\"\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.AppLauncherService\",\n      \"methods\": [\n        {\n          \"name\": \"Launch\",\n          \"request\": \"interop.AppLaunchRequest\",\n          \"response\": \"interop.AppLaunchResponse\",\n          \"type\": \"Unary\"\n        }\n      ]\n    }\n  ],\n  \"applications\": [\n    {\n      \"id\": \"interop.testing.EchoServer\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"provides\": [\n        {\n          \"service\": \"interop.testing.EchoService\",\n          \"title\": \"Sample Echo Service\",\n          \"to\": [ \"interop.testing.*\" ],\n          \"methods\": [\n            {\n              \"name\": \"Unary\",\n              \"title\": \"Sample Unary Method\",\n              \"options\":  [\n                {\n                   \"id\": \"interop.ProvidedMethodOptions.launch_on_call\", \n                   \"value\": \"ALWAYS\"\n                } \n              ]\n            },\n            {\n              \"name\": \"ServerStreaming\"\n            },\n            {\n              \"name\": \"ClientStreaming\"\n            },\n            {\n              \"name\": \"DuplexStreaming\"\n            }\n          ],\n          \"options\":  [\n            {\n              \"id\": \"interop.ProvidedServiceOptions.title\", \n              \"value\": \"Sample Echo Service Implementation\"\n            } \n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.testing.EchoClient\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"consumes\": [\n        {\n          \"service\": \"interop.testing.EchoService\",\n          \"from\": [\"interop.testing.*\"],\n          \"methods\": [\n            { \"name\": \"Unary\" },\n            { \"name\": \"ServerStreaming\" }, \n            { \"name\": \"ClientStreaming\" }, \n            { \"name\": \"DuplexStreaming\" }\n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.AppLifecycleManager\",\n      \"consumes\": [\n        {\n          \"service\": \"interop.AppLauncherService\",\n          \"from\": [ \"*\" ],\n          \"methods\": [\n            { \"name\": \"Launch\" }\n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"interop.NativeAppLauncher\",\n      \"provides\": [\n        {\n          \"service\": \"interop.AppLauncherService\",\n          \"to\": [ \"interop.AppLifecycleManager\" ],\n          \"methods\": [\n            {\n              \"name\": \"Launch\",\n              \"title\": \"Launch app using native OS capabilities\"\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protobuf/Plexus.Interop.Protobuf.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <NUGET_PACKAGES Condition=\" '$(NUGET_PACKAGES)' == '' \">$(USERPROFILE)\\.nuget\\packages</NUGET_PACKAGES>\n    <ProtoCompilerPath>$(NUGET_PACKAGES)\\google.protobuf.tools\\3.20.1\\tools\\windows_x86\\protoc</ProtoCompilerPath>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.20.1\" />\n    <PackageReference Include=\"Google.Protobuf.Tools\" Version=\"3.20.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Common.Contracts\\Plexus.Interop.Protocol.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <ProtoRoot>../../../protocol/</ProtoRoot>\n    <ProtoOutDir></ProtoOutDir>\n    <ProtoOutDirParam>$(ProtoOutDir)</ProtoOutDirParam>\n    <ProtoOutDirParam Condition=\" '$(ProtoOutDirParam)' == '' \">.</ProtoOutDirParam>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <AvailableItemName Include=\"Protobuf\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Protobuf Include=\"$(ProtoRoot)plexus.proto\" />\n  </ItemGroup>\n\n  <Target Name=\"ProtoCompile\" BeforeTargets=\"CoreCompile\">\n    <PropertyGroup>\n      <ProtoCCommand>$(ProtoCompilerPath) --csharp_out=$(ProtoOutDirParam) --csharp_opt=file_extension=.proto.cs -I $(ProtoRoot) @(Protobuf -> '%(Identity)', ' ')</ProtoCCommand>\n    </PropertyGroup>\n    <Message Importance=\"high\" Text=\"$(ProtoCCommand)\" />\n    <Delete Files=\"$(ProtoOutDir)*.proto.cs\" />\n    <Exec Command=\"$(ProtoCCommand)\" WorkingDirectory=\"$(ProjectDir)\" />\n    <ItemGroup>\n      <Generated Include=\"$(ProtoOutDir)*.proto.cs\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Remove=\"@(Generated)\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Include=\"@(Generated)\" />\n    </ItemGroup>\n  </Target>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protobuf/ProtobufConverter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protobuf\n{    \n    using Plexus.Interop.Protocol.Common;\n    using System;\n    using PlexusUniqueId = Plexus.UniqueId;    \n\n    public static class ProtobufConverter\n    {\n        public static CompletionHeader ConvertFromProto(this Completion proto)\n        {\n            if (proto == null)\n            {\n                return CompletionHeader.Completed;\n            }\n            return new CompletionHeader(ConvertFromProto(proto.Status), ConvertFromProto(proto.Error));\n        }\n\n        public static CompletionStatusHeader ConvertFromProto(this Completion.Types.Status message)\n        {\n            switch (message)\n            {\n                case Completion.Types.Status.Completed:\n                    return CompletionStatusHeader.Completed;\n                case Completion.Types.Status.Canceled:\n                    return CompletionStatusHeader.Canceled;\n                case Completion.Types.Status.Failed:\n                    return CompletionStatusHeader.Failed;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(message), message, null);\n            }\n        }\n\n        public static PlexusUniqueId ConvertFromProtoStrict(this UniqueId guid)\n        {\n            if (guid == null || (long)guid.Lo == 0L && (long)guid.Hi == 0L)\n            {\n                throw new InvalidOperationException($\"Cannot convert from proto as UniqueId: {guid}\");\n            }         \n            return PlexusUniqueId.FromHiLo(guid.Hi, guid.Lo);\n        }\n\n        public static Maybe<PlexusUniqueId> ConvertFromProto(this UniqueId guid)\n        {\n            if (guid == null || (long)guid.Lo == 0L && (long)guid.Hi == 0L)\n            {\n                return Maybe<PlexusUniqueId>.Nothing;\n            }\n            return PlexusUniqueId.FromHiLo(guid.Hi, guid.Lo);\n        }\n\n        public static string ConvertFromProtoStrict(this string str)\n        {\n            if (string.IsNullOrEmpty(str))\n            {\n                throw new InvalidOperationException(\"Required string is unspecified\");\n            }\n            return str;\n        }\n\n        public static Maybe<string> ConvertFromProto(this string str)\n        {\n            return string.IsNullOrEmpty(str) ? Maybe<string>.Nothing : str;\n        }\n\n        public static Maybe<ErrorHeader> ConvertFromProto(this Error proto)\n        {\n            return proto == null\n                ? Maybe<ErrorHeader>.Nothing\n                : new Maybe<ErrorHeader>(new ErrorHeader(proto.Message, proto.Details, proto.ExceptionName));\n        }\n\n        public static Completion MergeFrom(this Completion proto, CompletionHeader message)\n        {\n            proto = proto ?? new Completion();\n            proto.Status = ConvertToProto(message.Status);\n            proto.Error = message.Error.HasValue ? MergeFrom(proto.Error, message.Error.Value) : null;\n            return proto;\n        }\n\n        public static Error MergeFrom(this Error proto, ErrorHeader message)\n        {\n            proto = proto ?? new Error();\n            proto.Message = message.Message;\n            proto.Details = message.Details;\n            proto.ExceptionName = message.ExceptionName;\n            return proto;\n        }\n\n        public static string ConvertToProtoStrict(this string str)\n        {\n            if (string.IsNullOrEmpty(str))\n            {\n                throw new InvalidOperationException(\"Required string is unspecified\");\n            }\n            return str;\n        }\n\n        public static string ConvertToProto(this Maybe<string> str)\n        {\n            if (!str.HasValue)\n            {\n                return string.Empty;\n            }\n            return str.Value ?? string.Empty;\n        }\n\n        public static UniqueId MergeFrom(this UniqueId proto, Maybe<PlexusUniqueId> guid)\n        {\n            proto = proto ?? new UniqueId();\n            if (guid.HasValue)\n            {\n                var value = guid.Value;\n                proto.Lo = value.Lo;\n                proto.Hi = value.Hi;\n            }\n            else\n            {\n                proto.Lo = 0;\n                proto.Hi = 0;\n            }\n            return proto;\n        }\n\n        public static Completion.Types.Status ConvertToProto(this CompletionStatusHeader message)\n        {\n            switch (message)\n            {\n                case CompletionStatusHeader.Completed:\n                    return Completion.Types.Status.Completed;\n                case CompletionStatusHeader.Canceled:\n                    return Completion.Types.Status.Canceled;\n                case CompletionStatusHeader.Failed:\n                    return Completion.Types.Status.Failed;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(message), message, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protobuf/ProtobufExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Google.Protobuf;\nusing Plexus.Pools;\n\nnamespace Plexus.Interop.Protobuf\n{\n    public static class ProtobufExtensions\n    {\n        public static IPooledBuffer Serialize(this IMessage message)\n        {\n            var buffer = PooledBuffer.Rent();\n            var stream = new CodedOutputStream(buffer.Array);\n            message.WriteTo(stream);\n            stream.Flush();\n            buffer.Count = (int)stream.Position;\n            return buffer;\n        }\n\n        public static void MergeFrom<T>(this T message, IPooledBuffer datagram) where T : IMessage<T>\n        {\n            // We don't need to dispose stream here because it throws on disposing if created from array.\n            var stream = new CodedInputStream(datagram.Array, datagram.Offset, datagram.Count);\n            message.MergeFrom(stream);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Connect/ConnectRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing Plexus.Interop.Protocol.Connect;\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Protocol.Internal.Connect\n{\n    internal sealed class ConnectRequest : PooledObject<ConnectRequest>, IConnectRequest\n    {\n        public string ApplicationId { get; set; }\n\n        public UniqueId ApplicationInstanceId { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var request = obj as ConnectRequest;\n            return request != null &&\n                   ApplicationId == request.ApplicationId &&\n                   ApplicationInstanceId.Equals(request.ApplicationInstanceId);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = -1840500065;\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ApplicationId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<UniqueId>.Default.GetHashCode(ApplicationInstanceId);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(ApplicationId)}: {ApplicationId}, {nameof(ApplicationInstanceId)}: {ApplicationInstanceId}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ApplicationId = default;\n            ApplicationInstanceId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Connect/ConnectResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing Plexus.Interop.Protocol.Connect;\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Protocol.Internal.Connect\n{\n    internal sealed class ConnectResponse : PooledObject<ConnectResponse>, IConnectResponse\n    {\n        public UniqueId ConnectionId { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var response = obj as ConnectResponse;\n            return response != null &&\n                   ConnectionId.Equals(response.ConnectionId);\n        }\n\n        public override int GetHashCode()\n        {\n            return -463474436 + EqualityComparer<UniqueId>.Default.GetHashCode(ConnectionId);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(ConnectionId)}: {ConnectionId}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ConnectionId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/ConsumedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Pools;\n\n    internal sealed class ConsumedMethodReference : PooledObject<ConsumedMethodReference>, IConsumedMethodReference\n    {\n        protected override void Cleanup()\n        {\n            ConsumedService?.Dispose();\n            ConsumedService = default;\n            MethodId = default;\n        }\n\n        public T Handle<T, TArgs>(InvocationTargetHandler<T, TArgs> handler, TArgs args)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArg1, TArg2>(InvocationTargetHandler<T, TArg1, TArg2> handler, TArg1 arg1 = default, TArg2 arg2 = default)\n        {\n            return handler.Handle(this, arg1, arg2);\n        }\n\n        public T Handle<T, TArg1, TArg2, TArg3>(InvocationTargetHandler<T, TArg1, TArg2, TArg3> handler, TArg1 arg1 = default, TArg2 arg2 = default, TArg3 arg3 = default)\n        {\n            return handler.Handle(this, arg1, arg2, arg3);\n        }\n\n        public IConsumedServiceReference ConsumedService { get; set; }\n\n        public string MethodId { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ConsumedService)}: {{{ConsumedService}}}, {nameof(MethodId)}: {MethodId}\";\n        }\n\n        private bool Equals(ConsumedMethodReference other)\n        {\n            return Equals(ConsumedService, other.ConsumedService) && string.Equals(MethodId, other.MethodId);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is ConsumedMethodReference && Equals((ConsumedMethodReference) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((ConsumedService != null ? ConsumedService.GetHashCode() : 0) * 397) ^ (MethodId != null ? MethodId.GetHashCode() : 0);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/ConsumedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal\n{\n    using Plexus.Pools;\n\n    internal sealed class ConsumedServiceReference : PooledObject<ConsumedServiceReference>, IConsumedServiceReference\n    {\n        protected override void Cleanup()\n        {\n            ServiceId = default;\n            ServiceAlias = default;\n        }\n\n        public string ServiceId { get; set; }\n\n        public Maybe<string> ServiceAlias { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ServiceId)}: {ServiceId}, {nameof(ServiceAlias)}: {ServiceAlias}\";\n        }\n\n        private bool Equals(ConsumedServiceReference other)\n        {\n            return string.Equals(ServiceId, other.ServiceId) && ServiceAlias.Equals(other.ServiceAlias);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is ConsumedServiceReference && Equals((ConsumedServiceReference) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((ServiceId != null ? ServiceId.GetHashCode() : 0) * 397) ^ ServiceAlias.GetHashCode();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/ContextLinkageOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Pools;\n\n    internal class ContextLinkageOptions : PooledObject<ContextLinkageOptions>, IContextLinkageOptions\n    {\n        public ContextLinkageDiscoveryMode Mode { get; set; }\n\n        public Maybe<string> SpecificContext { get; set; }\n\n        protected override void Cleanup()\n        {\n            SpecificContext = Maybe<string>.Nothing;\n            Mode = ContextLinkageDiscoveryMode.None;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Mode)}: {Mode}, {nameof(SpecificContext)}: {SpecificContext}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/DiscoveredMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal sealed class DiscoveredMethod : PooledObject<DiscoveredMethod>, IDiscoveredMethod\n    {\n        protected override void Cleanup()\n        {\n            ProvidedMethod?.Dispose();\n            ProvidedMethod = default;\n            MethodTitle = default;\n            InputMessageId = default;\n            OutputMessageId = default;\n            MethodType = default;\n            foreach (var option in Options)\n            {\n                option.Dispose();\n            }\n            Options = ArrayConstants<IOption>.Empty;\n        }\n\n        public IProvidedMethodReference ProvidedMethod { get; set; }\n\n        public Maybe<string> MethodTitle { get; set; }\n\n        public string InputMessageId { get; set; }\n\n        public string OutputMessageId { get; set; }\n\n        public MethodType MethodType { get; set; }\n\n        public IReadOnlyCollection<IOption> Options { get; set; } = ArrayConstants<IOption>.Empty;\n\n        public override string ToString()\n        {\n            return $\"{nameof(ProvidedMethod)}: {{{ProvidedMethod}}}, {nameof(MethodTitle)}: {MethodTitle}, {nameof(InputMessageId)}: {InputMessageId}, {nameof(OutputMessageId)}: {OutputMessageId}, {nameof(MethodType)}: {MethodType}, {nameof(Options)}: {Options.FormatEnumerableObjects()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/DiscoveredService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal sealed class DiscoveredService : PooledObject<DiscoveredService>, IDiscoveredService\n    {\n        public IConsumedServiceReference ConsumedService { get; set; }\n\n        public IProvidedServiceReference ProvidedService { get; set; }\n\n        public Maybe<string> ServiceTitle { get; set; }\n\n        public IReadOnlyCollection<IDiscoveredServiceMethod> Methods { get; set; }\n\n        protected override void Cleanup()\n        {\n            ConsumedService?.Dispose();\n            ConsumedService = default;\n            ProvidedService?.Dispose();\n            ProvidedService = default;\n            ServiceTitle = default;\n            if (Methods != null)\n            {\n                foreach (var method in Methods)\n                {\n                    method?.Dispose();\n                }\n            }\n            Methods = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ConsumedService)}: {{{ConsumedService}}}, {nameof(ProvidedService)}: {{{ProvidedService}}}, {nameof(ServiceTitle)}: {ServiceTitle}, {nameof(Methods)}: {Methods.FormatEnumerableObjects()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/DiscoveredServiceMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal sealed class DiscoveredServiceMethod : PooledObject<DiscoveredServiceMethod>, IDiscoveredServiceMethod\n    {\n        protected override void Cleanup()\n        {\n            MethodId = default;\n            MethodTitle = default;\n            InputMessageId = default;\n            OutputMessageId = default;\n            MethodType = default;\n            foreach (var option in Options)\n            {\n                option.Dispose();\n            }\n            Options = ArrayConstants<IOption>.Empty;\n        }\n\n        public string MethodId { get; set; }\n\n        public Maybe<string> MethodTitle { get; set; }\n\n        public string InputMessageId { get; set; }\n\n        public string OutputMessageId { get; set; }\n\n        public MethodType MethodType { get; set; }\n\n        public IReadOnlyCollection<IOption> Options { get; set; } = ArrayConstants<IOption>.Empty;\n\n        public override string ToString()\n        {\n            return $\"{nameof(MethodId)}: {MethodId}, {nameof(MethodTitle)}: {MethodTitle}, {nameof(InputMessageId)}: {InputMessageId}, {nameof(OutputMessageId)}: {OutputMessageId}, {nameof(MethodType)}: {MethodType}, {nameof(Options)}: {Options.FormatEnumerableObjects()}\";\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/MethodDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n\n    internal sealed class MethodDiscoveryRequest : PooledObject<MethodDiscoveryRequest>, IMethodDiscoveryRequest\n    {\n        protected override void Cleanup()\n        {\n            InputMessageId = default;\n            OutputMessageId = default;\n            DiscoveryMode = default;\n            if (ConsumedMethod.HasValue)\n            {\n                ConsumedMethod.GetValueOrDefault()?.Dispose();\n            }\n            ContextLinkageOptions = default;\n            ConsumedMethod = default;\n        }\n\n        public T Handle<T, TArgs>(ClientToBrokerRequestHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public Maybe<string> InputMessageId { get; set; }\n\n        public Maybe<string> OutputMessageId { get; set; }\n\n        public Maybe<IConsumedMethodReference> ConsumedMethod { get; set; }\n\n        public DiscoveryMode DiscoveryMode { get; set; }\n\n        public IContextLinkageOptions ContextLinkageOptions { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(InputMessageId)}: {InputMessageId}, {nameof(OutputMessageId)}: {OutputMessageId}, {nameof(ConsumedMethod)}: {{{ConsumedMethod}}}, {nameof(DiscoveryMode)}: {DiscoveryMode}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/MethodDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal sealed class MethodDiscoveryResponse : PooledObject<MethodDiscoveryResponse>, IMethodDiscoveryResponse\n    {\n        protected override void Cleanup()\n        {\n            if (Methods == null)\n            {\n                return;\n            }\n            foreach (var method in Methods)\n            {\n                method.Dispose();\n            }\n            Methods = default;\n        }\n\n        public IReadOnlyCollection<IDiscoveredMethod> Methods { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Methods)}: {Methods.FormatEnumerableObjects()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/ServiceDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n\n    internal sealed class ServiceDiscoveryRequest : PooledObject<ServiceDiscoveryRequest>, IServiceDiscoveryRequest\n    {\n        public Maybe<IConsumedServiceReference> ConsumedService { get; set; }\n\n        public DiscoveryMode DiscoveryMode { get; set; }\n\n        public IContextLinkageOptions ContextLinkageOptions { get; set; }\n\n        public T Handle<T, TArgs>(ClientToBrokerRequestHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        protected override void Cleanup()\n        {\n            ConsumedService.GetValueOrDefault()?.Dispose();\n            ConsumedService = default;\n            DiscoveryMode = default;\n            ContextLinkageOptions = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ConsumedService)}: {{{ConsumedService}}}, {nameof(DiscoveryMode)}: {DiscoveryMode}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Discovery/ServiceDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Discovery\n{\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal sealed class ServiceDiscoveryResponse : PooledObject<ServiceDiscoveryResponse>, IServiceDiscoveryResponse\n    {\n        public IReadOnlyCollection<IDiscoveredService> Services { get; set; } =\n            ArrayConstants<IDiscoveredService>.Empty;\n\n        protected override void Cleanup()\n        {\n            if (Services != null)\n            {\n                foreach (var service in Services)\n                {\n                    service.Dispose();\n                }\n            }\n            Services = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"Type: {typeof(ServiceDiscoveryResponse).Name}, {nameof(Services)}: {Services.FormatEnumerableObjects()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationMessageHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    using Plexus.Interop.Protocol.Invocation;\n\n    internal sealed class InvocationMessageHeader : IInvocationMessageHeader\n    {\n        public static readonly InvocationMessageHeader Instance = new InvocationMessageHeader();\n\n        public override string ToString()\n        {\n            return $\"{{Type: {GetType().Name}}}\";\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationMessageHeader;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public void Dispose()\n        {\n        }\n\n        public void Retain()\n        {\n        }\n\n        public T Handle<T, TArgs>(InvocationMessageHandler<T, TArgs> handler, TArgs args)\n        {\n            return handler.Handle(this, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationMessageReceived.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Invocation;\n\nnamespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    internal sealed class InvocationMessageReceived : IInvocationMessageReceived\n    {\n        public static readonly InvocationMessageReceived Instance = new InvocationMessageReceived();\n\n        public override string ToString()\n        {\n            return $\"{{Type: {GetType().Name}}}\";\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationMessageReceived;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public void Dispose()\n        {\n        }\n\n        public void Retain()\n        {\n        }\n\n        public T Handle<T, TArgs>(InvocationMessageHandler<T, TArgs> handler, TArgs args)\n        {\n            return handler.Handle(this, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationSendCompleted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Invocation;\n\nnamespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    internal sealed class InvocationSendCompleted : IInvocationSendCompleted\n    {\n        public static readonly InvocationSendCompleted Instance = new InvocationSendCompleted();\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(InvocationSendCompleted).Name}}}\";\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationSendCompleted;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public void Dispose()\n        {\n        }\n\n        public void Retain()\n        {\n        }\n\n        public T Handle<T, TArgs>(InvocationMessageHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationStart.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Pools;\n\n    internal sealed class InvocationStart : PooledObject<InvocationStart>, IInvocationStart\n    {\n        public T Handle<T, TArgs>(ClientToBrokerRequestHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        protected override void Cleanup()\n        {\n            Target = default;\n        }\n\n        public IInvocationTarget Target { get; set; }\n\n        public IContextLinkageOptions ContextLinkageOptions { get; set; }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Target)}: {Target}\";\n        }\n\n        private bool Equals(InvocationStart other)\n        {\n            return Equals(Target, other.Target) && Equals(ContextLinkageOptions, other.ContextLinkageOptions);\n        }\n\n        public override bool Equals(object obj)\n        {\n            return ReferenceEquals(this, obj) || obj is InvocationStart other && Equals(other);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((Target != null ? Target.GetHashCode() : 0) * 397) ^ (ContextLinkageOptions != null ? ContextLinkageOptions.GetHashCode() : 0);\n            }\n        }\n\n        public static bool operator ==(InvocationStart left, InvocationStart right)\n        {\n            return Equals(left, right);\n        }\n\n        public static bool operator !=(InvocationStart left, InvocationStart right)\n        {\n            return !Equals(left, right);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationStartRequested.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Pools;\n\n    internal sealed class InvocationStartRequested : PooledObject<InvocationStartRequested>, IInvocationStartRequested\n    {\n        public string ServiceId { get; set; }\n\n        public string MethodId { get; set; }\n\n        public Maybe<string> ServiceAlias { get; set; }\n\n        public string ConsumerApplicationId { get; set; }\n\n        public UniqueId ConsumerConnectionId { get; set; }\n\n        public UniqueId ConsumerApplicationInstanceId { get; set; }\n\n        public T Handle<T, TArgs>(BrokerToClientRequestHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        protected override void Cleanup()\n        {\n            ServiceId = default;\n            MethodId = default;\n            ConsumerApplicationId = default;\n            ConsumerConnectionId = default;\n            ConsumerApplicationInstanceId = default;\n            ServiceAlias = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ServiceId)}: {ServiceId}, {nameof(MethodId)}: {MethodId}, {nameof(ServiceAlias)}: {ServiceAlias}, {nameof(ConsumerApplicationId)}: {ConsumerApplicationId}, {nameof(ConsumerConnectionId)}: {ConsumerConnectionId}, {nameof(ConsumerApplicationInstanceId)}: {ConsumerApplicationInstanceId}\";\n        }\n\n        private bool Equals(InvocationStartRequested other)\n        {\n            return string.Equals(ServiceId, other.ServiceId) && string.Equals(MethodId, other.MethodId) && ServiceAlias.Equals(other.ServiceAlias) && string.Equals(ConsumerApplicationId, other.ConsumerApplicationId) && ConsumerConnectionId.Equals(other.ConsumerConnectionId) && ConsumerApplicationInstanceId.Equals(other.ConsumerApplicationInstanceId);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is InvocationStartRequested requested && Equals(requested);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = (ServiceId != null ? ServiceId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ (MethodId != null ? MethodId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ ServiceAlias.GetHashCode();\n                hashCode = (hashCode * 397) ^ (ConsumerApplicationId != null ? ConsumerApplicationId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ ConsumerConnectionId.GetHashCode();\n                hashCode = (hashCode * 397) ^ ConsumerApplicationInstanceId.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationStarted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Invocation;\n\nnamespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    internal sealed class InvocationStarted : IInvocationStarted\n    {\n        public static readonly InvocationStarted Instance = new InvocationStarted();\n\n        public override string ToString()\n        {\n            return $\"{{Type: {GetType().Name}}}\";\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationStarted;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public void Dispose()\n        {\n        }\n\n        public void Retain()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Invocation/InvocationStarting.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Invocation;\n\nnamespace Plexus.Interop.Protocol.Internal.Invocation\n{\n    internal sealed class InvocationStarting : IInvocationStarting\n    {\n        public static readonly InvocationStarting Instance = new InvocationStarting();\n\n        public override string ToString()\n        {\n            return $\"{{Type: {GetType().Name}}}\";\n        }\n\n        public override bool Equals(object obj)\n        {\n            return obj is InvocationStarting;\n        }\n\n        public override int GetHashCode()\n        {\n            return 0;\n        }\n\n        public void Retain()\n        {\n        }\n\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/Option.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal\n{\n    using Plexus.Pools;\n\n    internal sealed class Option : PooledObject<Option>, IOption\n    {\n        public string Id { get; set; }\n\n        public string Value { get; set; }\n\n        protected override void Cleanup()\n        {\n            Id = default;\n            Value = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(Id)}: {Id}, {nameof(Value)}: {Value}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/ProvidedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Pools;\n\n    internal sealed class ProvidedMethodReference : PooledObject<ProvidedMethodReference>, IProvidedMethodReference\n    {\n        public T Handle<T, TArgs>(InvocationTargetHandler<T, TArgs> handler, TArgs args)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArg1, TArg2>(InvocationTargetHandler<T, TArg1, TArg2> handler, TArg1 arg1 = default, TArg2 arg2 = default)\n        {\n            return handler.Handle(this, arg1, arg2);\n        }\n\n        public T Handle<T, TArg1, TArg2, TArg3>(InvocationTargetHandler<T, TArg1, TArg2, TArg3> handler, TArg1 arg1 = default, TArg2 arg2 = default, TArg3 arg3 = default)\n        {\n            return handler.Handle(this, arg1, arg2, arg3);\n        }\n\n        public IProvidedServiceReference ProvidedService { get; set; }\n\n        public string MethodId { get; set; }\n\n        protected override void Cleanup()\n        {\n            ProvidedService?.Dispose();\n            ProvidedService = default;\n            MethodId = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ProvidedService)}: {{{ProvidedService}}}, {nameof(MethodId)}: {MethodId}\";\n        }\n\n        private bool Equals(ProvidedMethodReference other)\n        {\n            return Equals(ProvidedService, other.ProvidedService) && string.Equals(MethodId, other.MethodId);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is ProvidedMethodReference && Equals((ProvidedMethodReference) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return ((ProvidedService != null ? ProvidedService.GetHashCode() : 0) * 397) ^ (MethodId != null ? MethodId.GetHashCode() : 0);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Internal/ProvidedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Internal\n{\n    using Plexus.Pools;\n\n    internal sealed class ProvidedServiceReference : PooledObject<ProvidedServiceReference>, IProvidedServiceReference\n    {\n        public string ServiceId { get; set; }\n\n        public Maybe<string> ServiceAlias { get; set; }\n\n        public Maybe<string> ApplicationId { get; set; }\n\n        public Maybe<UniqueId> ConnectionId { get; set; }\n\n        public Maybe<UniqueId> ApplicationInstanceId { get; set; }\n\n        protected override void Cleanup()\n        {\n            ServiceAlias = default;\n            ServiceId = default;\n            ApplicationId = default;\n            ConnectionId = default;\n            ApplicationInstanceId = default;\n        }\n\n        public override string ToString()\n        {\n            return $\"{nameof(ServiceId)}: {ServiceId}, {nameof(ServiceAlias)}: {ServiceAlias}, {nameof(ApplicationId)}: {ApplicationId}, {nameof(ConnectionId)}: {ConnectionId}, {nameof(ApplicationInstanceId)}: {ApplicationInstanceId}\";\n        }\n\n        private bool Equals(ProvidedServiceReference other)\n        {\n            return string.Equals(ServiceId, other.ServiceId) && ServiceAlias.Equals(other.ServiceAlias) && string.Equals(ApplicationId, other.ApplicationId) && ConnectionId.Equals(other.ConnectionId);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            if (ReferenceEquals(this, obj)) return true;\n            return obj is ProvidedServiceReference && Equals((ProvidedServiceReference) obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                var hashCode = (ServiceId != null ? ServiceId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ ServiceAlias.GetHashCode();\n                hashCode = (hashCode * 397) ^ (ApplicationId != null ? ApplicationId.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ ConnectionId.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/Plexus.Interop.Protocol.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>    \n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Contracts\\Plexus.Interop.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol/ProtocolMessagePool.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol\n{\n    using Plexus.Interop.Protocol.Connect;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Protocol.Internal;\n    using Plexus.Interop.Protocol.Internal.Connect;\n    using Plexus.Interop.Protocol.Internal.Discovery;\n    using Plexus.Interop.Protocol.Internal.Invocation;\n    using Plexus.Interop.Protocol.Invocation;\n    using System.Collections.Generic;\n\n    public sealed class ProtocolMessagePool : IProtocolMessageFactory\n    {\n        public static readonly ProtocolMessagePool Instance = new ProtocolMessagePool();\n\n        public IConnectRequest CreateConnectRequest(string hostAppId, UniqueId hostAppInstanceId)\n        {\n            var obj = ConnectRequest.Rent();\n            obj.ApplicationId = hostAppId;\n            obj.ApplicationInstanceId = hostAppInstanceId;\n            return obj;\n        }\n\n        public IConnectResponse CreateConnectResponse(UniqueId connectionId)\n        {\n            var obj = ConnectResponse.Rent();\n            obj.ConnectionId = connectionId;\n            return obj;\n        }\n\n        public IInvocationMessageHeader CreateInvocationMessageHeader()\n        {\n            return InvocationMessageHeader.Instance;\n        }\n\n        public IInvocationMessageReceived CreateInvocationMessageReceived()\n        {\n            return InvocationMessageReceived.Instance;\n        }\n\n        public IInvocationStart CreateInvocationStartRequest(IInvocationTarget target, IContextLinkageOptions contextLinkageOptions)\n        {\n            var obj = InvocationStart.Rent();\n            obj.Target = target;\n            obj.ContextLinkageOptions = contextLinkageOptions ?? CreateContextLinkageOptions(ContextLinkageDiscoveryMode.None);\n            return obj;\n        }\n\n        public IInvocationStarted CreateInvocationStarted()\n        {\n            return InvocationStarted.Instance;\n        }\n\n        public IInvocationStarting CreateInvocationStarting()\n        {\n            return InvocationStarting.Instance;\n        }\n\n        public IInvocationStartRequested CreateInvocationStartRequested(\n            string serviceId,\n            string methodId,\n            Maybe<string> providerServiceAlias,\n            string consumerApplicationId,\n            UniqueId consumerApplicationInstanceId,\n            UniqueId consumerConnectionId)\n        {\n            var obj = InvocationStartRequested.Rent();\n            obj.ServiceId = serviceId;\n            obj.MethodId = methodId;\n            obj.ServiceAlias = providerServiceAlias;\n            obj.ConsumerApplicationId = consumerApplicationId;\n            obj.ConsumerApplicationInstanceId = consumerApplicationInstanceId;\n            obj.ConsumerConnectionId = consumerConnectionId;\n            return obj;\n        }\n\n        public IServiceDiscoveryRequest CreateServiceDiscoveryRequest(\n            Maybe<IConsumedServiceReference> consumedService,\n            DiscoveryMode mode, \n            IContextLinkageOptions contextLinkageOptions)\n        {\n            var obj = ServiceDiscoveryRequest.Rent();\n            obj.ConsumedService = consumedService;\n            obj.DiscoveryMode = mode;\n            obj.ContextLinkageOptions = contextLinkageOptions;\n            return obj;\n        }\n\n        public IServiceDiscoveryResponse CreateServiceDiscoveryResponse(IReadOnlyCollection<IDiscoveredService> services)\n        {\n            var obj = ServiceDiscoveryResponse.Rent();\n            obj.Services = services;\n            return obj;\n        }\n\n        public IDiscoveredService CreateDiscoveredService(\n            IConsumedServiceReference consumedService,\n            IProvidedServiceReference providedService,\n            Maybe<string> serviceTitle,\n            IReadOnlyCollection<IDiscoveredServiceMethod> methods)\n        {\n            var obj = DiscoveredService.Rent();\n            obj.ConsumedService = consumedService;\n            obj.ProvidedService = providedService;\n            obj.ServiceTitle = serviceTitle;\n            obj.Methods = methods;\n            return obj;\n        }\n\n        public IDiscoveredServiceMethod CreateDiscoveredServiceMethod(\n            string methodId, \n            Maybe<string> methodTitle, \n            string inputMessageId, \n            string outputMessageId,\n            MethodType methodType,\n            IReadOnlyCollection<IOption> options)\n        {\n            var obj = DiscoveredServiceMethod.Rent();\n            obj.MethodId = methodId;\n            obj.MethodTitle = methodTitle;\n            obj.InputMessageId = inputMessageId;\n            obj.OutputMessageId = outputMessageId;\n            obj.MethodType = methodType;\n            obj.Options = options;\n            return obj;\n        }\n\n        public IMethodDiscoveryRequest CreateMethodDiscoveryRequest(\n            Maybe<string> inputMessageId, \n            Maybe<string> outputMessageId,\n            Maybe<IConsumedMethodReference> method, \n            DiscoveryMode discoveryMode,\n            IContextLinkageOptions contextLinkageOptions)\n        {\n            var obj = MethodDiscoveryRequest.Rent();\n            obj.InputMessageId = inputMessageId;\n            obj.OutputMessageId = outputMessageId;\n            obj.ConsumedMethod = method;\n            obj.DiscoveryMode = discoveryMode;\n            obj.ContextLinkageOptions = contextLinkageOptions;\n            return obj;\n        }\n\n        public IDiscoveredMethod CreateDiscoveredMethod(\n            IProvidedMethodReference providedMethod,\n            Maybe<string> methodTitle, \n            string inputMessageId, \n            string outputMessageId,\n            MethodType methodType,\n            IReadOnlyCollection<IOption> options)\n        {\n            var obj = DiscoveredMethod.Rent();\n            obj.ProvidedMethod = providedMethod;\n            obj.MethodTitle = methodTitle;\n            obj.InputMessageId = inputMessageId;\n            obj.OutputMessageId = outputMessageId;\n            obj.MethodType = methodType;\n            obj.Options = options;\n            return obj;\n        }\n\n        public IMethodDiscoveryResponse CreateMethodDiscoveryResponse(IReadOnlyCollection<IDiscoveredMethod> methods)\n        {\n            var obj = MethodDiscoveryResponse.Rent();\n            obj.Methods = methods;\n            return obj;\n        }\n\n        public IOption CreateOption(string id, string value)\n        {\n            var obj = Option.Rent();\n            obj.Id = id;\n            obj.Value = value;\n            return obj;\n        }\n\n        public IInvocationSendCompleted CreateInvocationSendCompletion()\n        {\n            return InvocationSendCompleted.Instance;\n        }\n\n        public IConsumedServiceReference CreateConsumedServiceReference(string serviceId, Maybe<string> serviceAlias)\n        {\n            var obj = ConsumedServiceReference.Rent();\n            obj.ServiceId = serviceId;\n            obj.ServiceAlias = serviceAlias;\n            return obj;\n        }\n\n        public IConsumedMethodReference CreateConsumedMethodReference(IConsumedServiceReference consumedService, string methodId)\n        {\n            var obj = ConsumedMethodReference.Rent();\n            obj.ConsumedService = consumedService;\n            obj.MethodId = methodId;\n            return obj;\n        }\n\n        public IProvidedServiceReference CreateProvidedServiceReference(string serviceId, Maybe<string> serviceAlias, Maybe<string> applicationId, Maybe<UniqueId> connectionId, Maybe<UniqueId> applicationInstanceId)\n        {\n            var obj = ProvidedServiceReference.Rent();\n            obj.ServiceId = serviceId;\n            obj.ServiceAlias = serviceAlias;\n            obj.ApplicationId = applicationId;\n            obj.ConnectionId = connectionId;\n            obj.ApplicationInstanceId = applicationInstanceId;\n            return obj;\n        }\n\n        public IProvidedMethodReference CreateProvidedMethodReference(IProvidedServiceReference providedService, string methodId)\n        {\n            var obj = ProvidedMethodReference.Rent();\n            obj.ProvidedService = providedService;\n            obj.MethodId = methodId;\n            return obj;\n        }\n\n        public IContextLinkageOptions CreateContextLinkageOptions(ContextLinkageDiscoveryMode contextLinkageDiscoveryMode, Maybe<string> specificContextId = default)\n        {\n            var obj = ContextLinkageOptions.Rent();\n            obj.Mode = contextLinkageDiscoveryMode;\n            obj.SpecificContext = specificContextId;\n            return obj;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Common.Contracts/CompletionHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System.Collections.Generic;\n\nnamespace Plexus.Interop.Protocol.Common\n{\n    public struct CompletionHeader\n    {\n        public static readonly CompletionHeader Completed = new CompletionHeader(CompletionStatusHeader.Completed, Maybe<ErrorHeader>.Nothing);\n        public static readonly CompletionHeader Canceled = new CompletionHeader(CompletionStatusHeader.Canceled, Maybe<ErrorHeader>.Nothing);\n        public static CompletionHeader Failed(ErrorHeader error) => new CompletionHeader(CompletionStatusHeader.Failed, error);\n\n        public CompletionHeader(CompletionStatusHeader status, Maybe<ErrorHeader> error)\n        {\n            Status = status;\n            Error = error;\n        }\n\n        public CompletionStatusHeader Status { get; }\n\n        public Maybe<ErrorHeader> Error { get; }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is CompletionHeader))\n            {\n                return false;\n            }\n\n            var header = (CompletionHeader)obj;\n            return Status == header.Status &&\n                   Error.Equals(header.Error);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = -1826857896;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + Status.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<ErrorHeader>>.Default.GetHashCode(Error);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Status)}: {Status.ToString()}, {nameof(Error)}: {Error.ToString()}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Common.Contracts/CompletionStatusHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Common\n{\n    public enum CompletionStatusHeader : byte\n    {\n        Completed,\n        Canceled,\n        Failed\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Common.Contracts/ErrorHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Protocol.Common\n{\n    using System;\n\n    public readonly struct ErrorHeader\n    {\n        public string Message { get; }\n\n        public string Details { get; }\n\n        public string ExceptionName { get; }\n\n        public ErrorHeader(string message, string details, string exceptionName)\n        {\n            Message = message;\n            Details = details;\n            ExceptionName = exceptionName;\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is ErrorHeader))\n            {\n                return false;\n            }\n\n            var header = (ErrorHeader)obj;\n            return Message == header.Message &&\n                   Details == header.Details;\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 707783785;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Message);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Details);\n            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ExceptionName);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Message)}: {Message}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Common.Contracts/Plexus.Interop.Protocol.Common.Contracts.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Interop.Protocol.Common.Contracts</AssemblyName>\n    <RootNamespace>Plexus.Interop.Protocol.Common</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/BrokerToClientRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Invocation;\nusing System;\n\nnamespace Plexus.Interop.Protocol\n{\n    public struct BrokerToClientRequestHandler<T, TArgs>\n    {\n        private readonly Func<IInvocationStartRequested, TArgs, T> _invocationStartRequestHandler;\n\n        public BrokerToClientRequestHandler(Func<IInvocationStartRequested, TArgs, T> invocationStartRequestHandler)\n        {\n            _invocationStartRequestHandler = invocationStartRequestHandler;\n        }\n\n        public T Handle(IInvocationStartRequested message, TArgs args)\n        {\n            return _invocationStartRequestHandler(message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/ClientToBrokerRequestHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Discovery;\nusing Plexus.Interop.Protocol.Invocation;\nusing System;\n\nnamespace Plexus.Interop.Protocol\n{\n    public struct ClientToBrokerRequestHandler<T, TArgs>\n    {\n        private readonly Func<IInvocationStart, TArgs, T> _handleInvocationStart;\n        private readonly Func<IServiceDiscoveryRequest, TArgs, T> _handleServiceDiscoveryRequest;\n        private readonly Func<IMethodDiscoveryRequest, TArgs, T> _handleMethodDiscoveryRequest;\n\n        public ClientToBrokerRequestHandler(\n            Func<IInvocationStart, TArgs, T> handleInvocationStart,\n            Func<IServiceDiscoveryRequest, TArgs, T> handleServiceDiscoveryRequest, \n            Func<IMethodDiscoveryRequest, TArgs, T> handleMethodDiscoveryRequest)\n        {\n            _handleInvocationStart = handleInvocationStart;\n            _handleServiceDiscoveryRequest = handleServiceDiscoveryRequest;\n            _handleMethodDiscoveryRequest = handleMethodDiscoveryRequest;\n        }\n\n        public T Handle(IInvocationStart message, TArgs args)\n        {\n            return _handleInvocationStart(message, args);\n        }\n\n        public T Handle(IServiceDiscoveryRequest message, TArgs args)\n        {\n            return _handleServiceDiscoveryRequest(message, args);\n        }\n\n        public T Handle(IMethodDiscoveryRequest message, TArgs args)\n        {\n            return _handleMethodDiscoveryRequest(message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Connect/IConnectProtocolMessageFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Connect\n{\n    public interface IConnectProtocolMessageFactory\n    {\n        IConnectRequest CreateConnectRequest(string hostAppId, UniqueId hostAppInstanceId);\n\n        IConnectResponse CreateConnectResponse(UniqueId connectionId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Connect/IConnectProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\n\nnamespace Plexus.Interop.Protocol.Connect\n{\n    public interface IConnectProtocolSerializer\n    {\n        IPooledBuffer Serialize(IConnectRequest msg);\n\n        IPooledBuffer Serialize(IConnectResponse msg);\n\n        IConnectRequest DeserializeConnectRequest(IPooledBuffer msg);\n\n        IConnectResponse DeserializeConnectResponse(IPooledBuffer msg);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Connect/IConnectRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Connect\n{\n    public interface IConnectRequest : IProtocolMessage\n    {        \n        string ApplicationId { get; }\n\n        UniqueId ApplicationInstanceId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Connect/IConnectResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Connect\n{\n    public interface IConnectResponse : IProtocolMessage\n    {\n        UniqueId ConnectionId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/ContextLinkageDiscoveryMode.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol\n{\n    public enum ContextLinkageDiscoveryMode\n    {\n        None = 0,\n        SpecificContext = 1,\n        CurrentContext = 2,\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/DiscoveryMode.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    public enum DiscoveryMode\n    {\n        Offline,\n        Online\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IDiscoveredMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using System.Collections.Generic;\n\n    public interface IDiscoveredMethod : IProtocolMessage\n    {\n        IProvidedMethodReference ProvidedMethod { get; }\n\n        Maybe<string> MethodTitle { get; }\n\n        string InputMessageId { get; }\n\n        string OutputMessageId { get; }\n\n        MethodType MethodType { get; }\n\n        IReadOnlyCollection<IOption> Options { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IDiscoveredService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using System.Collections.Generic;\n\n    public interface IDiscoveredService : IProtocolMessage\n    {\n        IConsumedServiceReference ConsumedService { get; }\n\n        IProvidedServiceReference ProvidedService { get; }\n\n        Maybe<string> ServiceTitle { get; }\n\n        IReadOnlyCollection<IDiscoveredServiceMethod> Methods { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IDiscoveredServiceMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using System.Collections.Generic;\n\n    public interface IDiscoveredServiceMethod : IProtocolMessage\n    {\n        string MethodId { get; }\n\n        Maybe<string> MethodTitle { get; }\n\n        string InputMessageId { get; }\n\n        string OutputMessageId { get; }\n\n        MethodType MethodType { get; }\n\n        IReadOnlyCollection<IOption> Options { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IDiscoveryProtocolMessageFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using System.Collections.Generic;\n\nnamespace Plexus.Interop.Protocol.Discovery\n{\n    public interface IDiscoveryProtocolMessageFactory\n    {\n        IServiceDiscoveryRequest CreateServiceDiscoveryRequest(\n            Maybe<IConsumedServiceReference> consumedService,\n            DiscoveryMode discoveryMode, \n            IContextLinkageOptions contextLinkageOptions);\n\n        IServiceDiscoveryResponse CreateServiceDiscoveryResponse(IReadOnlyCollection<IDiscoveredService> services);\n\n        IDiscoveredService CreateDiscoveredService(\n            IConsumedServiceReference consumedService,\n            IProvidedServiceReference providedService,\n            Maybe<string> serviceTitle,\n            IReadOnlyCollection<IDiscoveredServiceMethod> methods);\n\n        IDiscoveredServiceMethod CreateDiscoveredServiceMethod(\n            string methodId, \n            Maybe<string> methodTitle, \n            string inputMessageId, \n            string outputMessageId,\n            MethodType methodType,\n            IReadOnlyCollection<IOption> options);\n\n        IMethodDiscoveryRequest CreateMethodDiscoveryRequest(\n            Maybe<string> inputMessageId,\n            Maybe<string> outputMessageId,\n            Maybe<IConsumedMethodReference> method, \n            DiscoveryMode discoveryMode, \n            IContextLinkageOptions contextLinkageOptions);\n\n        IDiscoveredMethod CreateDiscoveredMethod(\n            IProvidedMethodReference providedMethod,\n            Maybe<string> methodTitle,\n            string inputMessageId,\n            string outputMessageId,\n            MethodType methodType,\n            IReadOnlyCollection<IOption> options);\n\n        IMethodDiscoveryResponse CreateMethodDiscoveryResponse(\n            IReadOnlyCollection<IDiscoveredMethod> methods);\n\n        IOption CreateOption(string id, string value);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IDiscoveryProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using Plexus.Pools;\n\n    public interface IDiscoveryProtocolSerializer\n    {\n        IPooledBuffer Serialize(IServiceDiscoveryResponse message);\n\n        IPooledBuffer Serialize(IMethodDiscoveryResponse message);\n\n        IServiceDiscoveryResponse DeserializeServiceDiscoveryResponse(IPooledBuffer message);\n\n        IMethodDiscoveryResponse DeserializeMethodDiscoveryResponse(IPooledBuffer message);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IMethodDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Discovery\n{\n    public interface IMethodDiscoveryRequest : IClientToBrokerRequest\n    {\n        Maybe<string> InputMessageId { get; }\n\n        Maybe<string> OutputMessageId { get; }\n\n        Maybe<IConsumedMethodReference> ConsumedMethod { get; }\n            \n        DiscoveryMode DiscoveryMode { get; }\n\n        IContextLinkageOptions ContextLinkageOptions { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IMethodDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using System.Collections.Generic;\n\n    public interface IMethodDiscoveryResponse : IProtocolMessage\n    {\n        IReadOnlyCollection<IDiscoveredMethod> Methods { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IServiceDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Discovery\n{\n    public interface IServiceDiscoveryRequest : IClientToBrokerRequest\n    {\n        Maybe<IConsumedServiceReference> ConsumedService { get; }\n\n        DiscoveryMode DiscoveryMode { get; }\n\n        IContextLinkageOptions ContextLinkageOptions { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/IServiceDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    using System.Collections.Generic;\n\n    public interface IServiceDiscoveryResponse : IProtocolMessage\n    {\n        IReadOnlyCollection<IDiscoveredService> Services { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Discovery/MethodType.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Discovery\n{\n    public enum MethodType\n    {\n        Unary,\n        ServerStreaming,\n        ClientStreaming,\n        DuplexStreaming\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IBrokerToClientRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IBrokerToClientRequest : IProtocolMessage\n    {\n        T Handle<T, TArgs>(BrokerToClientRequestHandler<T, TArgs> handler, TArgs args = default(TArgs));\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IClientToBrokerRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IClientToBrokerRequest : IProtocolMessage\n    {\n        T Handle<T, TArgs>(ClientToBrokerRequestHandler<T, TArgs> handler, TArgs args = default(TArgs));\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IConsumedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    using Plexus.Interop.Protocol.Invocation;\n\n    public interface IConsumedMethodReference : IInvocationTarget\n    {\n        IConsumedServiceReference ConsumedService { get; }\n\n        string MethodId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IConsumedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IConsumedServiceReference : IProtocolMessage\n    {\n        string ServiceId { get; }\n\n        Maybe<string> ServiceAlias { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IContextLinkageOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol\n{\n    public interface IContextLinkageOptions\n    {\n        ContextLinkageDiscoveryMode Mode { get; }\n\n        Maybe<string> SpecificContext { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IOption.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IOption : IProtocolMessage\n    {\n        string Id { get; }\n\n        string Value { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProtocolImplementation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IProtocolImplementation\n    {\n        IProtocolMessageFactory MessageFactory { get; }\n\n        IProtocolSerializer Serializer { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProtocolMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System;\n\nnamespace Plexus.Interop.Protocol\n{\n    public interface IProtocolMessage : IPooledObject\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProtocolMessageFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using Plexus.Interop.Protocol.Discovery;\nusing Plexus.Interop.Protocol.Connect;\nusing Plexus.Interop.Protocol.Invocation;\n\nnamespace Plexus.Interop.Protocol\n{\n    public interface IProtocolMessageFactory : \n        IConnectProtocolMessageFactory,\n        IInvocationProtocolMessageFactory,\n        IDiscoveryProtocolMessageFactory\n    {\n        IConsumedServiceReference CreateConsumedServiceReference(\n            string serviceId,\n            Maybe<string> serviceAlias);\n\n        IConsumedMethodReference CreateConsumedMethodReference(IConsumedServiceReference consumedService, string methodId);\n\n        IProvidedServiceReference CreateProvidedServiceReference(\n            string serviceId,\n            Maybe<string> serviceAlias,\n            Maybe<string> applicationId,\n            Maybe<UniqueId> connectionId,\n            Maybe<UniqueId> applicationInstanceId);\n\n        IProvidedMethodReference CreateProvidedMethodReference(\n            IProvidedServiceReference providedService,\n            string methodId);\n\n        IContextLinkageOptions CreateContextLinkageOptions(ContextLinkageDiscoveryMode contextLinkageDiscoveryMode, Maybe<string> specificContextId);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    using Plexus.Interop.Protocol.Connect;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Pools;\n\n    public interface IProtocolSerializer :\n        IConnectProtocolSerializer,\n        IInvocationProtocolSerializer,\n        IDiscoveryProtocolSerializer\n    {\n        IPooledBuffer Serialize(IClientToBrokerRequest message);        \n        IPooledBuffer Serialize(IBrokerToClientRequest message);\n\n        IClientToBrokerRequest DeserializeClientToBrokerRequest(IPooledBuffer message);\n        IBrokerToClientRequest DeserializeBrokerToClientRequest(IPooledBuffer message);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProtocolSerializerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IProtocolSerializerFactory\n    {\n        IProtocolSerializer Create(IProtocolMessageFactory messageFactory);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProvidedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    using Plexus.Interop.Protocol.Invocation;\n\n    public interface IProvidedMethodReference : IInvocationTarget\n    {\n        IProvidedServiceReference ProvidedService { get; }\n\n        string MethodId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/IProvidedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public interface IProvidedServiceReference : IProtocolMessage\n    {\n        string ServiceId { get; }\n\n        Maybe<string> ServiceAlias { get; }\n\n        Maybe<string> ApplicationId { get; }\n\n        Maybe<UniqueId> ConnectionId { get; }\n\n        Maybe<UniqueId> ApplicationInstanceId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationMessage : IProtocolMessage\n    {\n        T Handle<T, TArgs>(InvocationMessageHandler<T, TArgs> handler, TArgs args = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationMessageHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationMessageHeader : IInvocationMessage\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationMessageReceived.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationMessageReceived : IInvocationMessage\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationProtocolMessageFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationProtocolMessageFactory\n    {\n        IInvocationStart CreateInvocationStartRequest(IInvocationTarget target, IContextLinkageOptions contextLinkageOptions);\n\n        IInvocationStartRequested CreateInvocationStartRequested(\n            string serviceId,\n            string methodId,\n            Maybe<string> providerServiceAlias,\n            string consumerApplicationId,\n            UniqueId consumerApplicationInstanceId,\n            UniqueId consumerConnectionId);\n\n        IInvocationStarted CreateInvocationStarted();\n\n        IInvocationStarting CreateInvocationStarting();\n\n        IInvocationMessageHeader CreateInvocationMessageHeader();\n\n        IInvocationMessageReceived CreateInvocationMessageReceived();\n\n        IInvocationSendCompleted CreateInvocationSendCompletion();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\n\nnamespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationProtocolSerializer\n    {\n        IPooledBuffer Serialize(IInvocationStarting message);\n\n        IPooledBuffer Serialize(IInvocationStarted message);\n\n        IPooledBuffer Serialize(IInvocationMessage message);\n\n        IInvocationStarting DeserializeInvocationStarting(IPooledBuffer message);\n\n        IInvocationStarted DeserializeInvocationStarted(IPooledBuffer message);\n\n        IInvocationMessage DeserializeInvocationMessage(IPooledBuffer message);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationSendCompleted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationSendCompleted : IInvocationMessage\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationStart.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationStart : IClientToBrokerRequest\n    {\n        IInvocationTarget Target { get; }\n        IContextLinkageOptions ContextLinkageOptions { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationStartRequested.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationStartRequested : IBrokerToClientRequest\n    {\n        string ServiceId { get; }\n\n        string MethodId { get; }\n\n        Maybe<string> ServiceAlias { get; }\n\n        string ConsumerApplicationId { get; }\n\n        UniqueId ConsumerConnectionId { get; }\n\n        UniqueId ConsumerApplicationInstanceId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationStarted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationStarted : IProtocolMessage\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationStarting.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationStarting : IProtocolMessage\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/IInvocationTarget.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    public interface IInvocationTarget : IProtocolMessage\n    {\n        T Handle<T, TArgs>(InvocationTargetHandler<T, TArgs> handler, TArgs args = default);\n\n        T Handle<T, TArg1, TArg2>(InvocationTargetHandler<T, TArg1, TArg2> handler, TArg1 arg1 = default, TArg2 arg2 = default);\n\n        T Handle<T, TArg1, TArg2, TArg3>(InvocationTargetHandler<T, TArg1, TArg2, TArg3> handler, TArg1 arg1 = default, TArg2 arg2 = default, TArg3 arg3 = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/InvocationMessageHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    using System;\n\n    public struct InvocationMessageHandler<T, TArgs>\n    {\n        private readonly Func<IInvocationMessageHeader, TArgs, T> _messageHandler;\n        private readonly Func<IInvocationMessageReceived, TArgs, T> _confirmationHandler;\n        private readonly Func<IInvocationSendCompleted, TArgs, T> _sendCompletedHandler;\n\n        public InvocationMessageHandler(\n            Func<IInvocationMessageHeader, TArgs, T> messageHandler,\n            Func<IInvocationMessageReceived, TArgs, T> confirmationHandler,\n            Func<IInvocationSendCompleted, TArgs, T> sendCompletedHandler)\n        {\n            _messageHandler = messageHandler;\n            _confirmationHandler = confirmationHandler;\n            _sendCompletedHandler = sendCompletedHandler;\n        }\n\n        public T Handle(IInvocationMessageHeader header, TArgs args)\n        {\n            return _messageHandler(header, args);\n        }\n\n        public T Handle(IInvocationMessageReceived header, TArgs args)\n        {\n            return _confirmationHandler(header, args);\n        }\n\n        public T Handle(IInvocationSendCompleted header, TArgs args)\n        {\n            return _sendCompletedHandler(header, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Invocation/InvocationTargetHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Invocation\n{\n    using System;\n\n    public sealed class InvocationTargetHandler<T, TArgs>\n    {\n        private readonly Func<IConsumedMethodReference, TArgs, T> _consumedMethodHandler;\n        private readonly Func<IProvidedMethodReference, TArgs, T> _providedMethodHandler;\n\n        public InvocationTargetHandler(\n            Func<IConsumedMethodReference, TArgs, T> consumedMethodHandler,\n            Func<IProvidedMethodReference, TArgs, T> providedMethodHandler)\n        {\n            _consumedMethodHandler = consumedMethodHandler;\n            _providedMethodHandler = providedMethodHandler;\n        }\n\n        public T Handle(IConsumedMethodReference target, TArgs args)\n        {\n            return _consumedMethodHandler(target, args);\n        }\n\n        public T Handle(IProvidedMethodReference target, TArgs args)\n        {\n            return _providedMethodHandler(target, args);\n        }\n    }\n\n    public sealed class InvocationTargetHandler<T, TArgs1, TArgs2>\n    {\n        private readonly Func<IConsumedMethodReference, TArgs1, TArgs2, T> _consumedMethodHandler;\n        private readonly Func<IProvidedMethodReference, TArgs1, TArgs2, T> _providedMethodHandler;\n\n        public InvocationTargetHandler(\n            Func<IConsumedMethodReference, TArgs1, TArgs2, T> consumedMethodHandler, \n            Func<IProvidedMethodReference, TArgs1, TArgs2, T> providedMethodHandler)\n        {\n            _consumedMethodHandler = consumedMethodHandler;\n            _providedMethodHandler = providedMethodHandler;\n        }\n\n        public T Handle(IConsumedMethodReference target, TArgs1 args1, TArgs2 args2)\n        {\n            return _consumedMethodHandler(target, args1, args2);\n        }\n\n        public T Handle(IProvidedMethodReference target, TArgs1 args1, TArgs2 args2)\n        {\n            return _providedMethodHandler(target, args1, args2);\n        }\n    }\n\n    public sealed class InvocationTargetHandler<T, TArgs1, TArgs2, TArgs3>\n    {\n        private readonly Func<IConsumedMethodReference, TArgs1, TArgs2, TArgs3, T> _consumedMethodHandler;\n        private readonly Func<IProvidedMethodReference, TArgs1, TArgs2, TArgs3, T> _providedMethodHandler;\n\n        public InvocationTargetHandler(\n            Func<IConsumedMethodReference, TArgs1, TArgs2, TArgs3, T> consumedMethodHandler,\n            Func<IProvidedMethodReference, TArgs1, TArgs2, TArgs3, T> providedMethodHandler)\n        {\n            _consumedMethodHandler = consumedMethodHandler;\n            _providedMethodHandler = providedMethodHandler;\n        }\n\n        public T Handle(IConsumedMethodReference target, TArgs1 args1, TArgs2 args2, TArgs3 args3)\n        {\n            return _consumedMethodHandler(target, args1, args2, args3);\n        }\n\n        public T Handle(IProvidedMethodReference target, TArgs1 args1, TArgs2 args2, TArgs3 args3)\n        {\n            return _providedMethodHandler(target, args1, args2, args3);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/Plexus.Interop.Protocol.Contracts.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Protocol</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Common.Contracts\\Plexus.Interop.Protocol.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/ProtocolImplementation.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    public sealed class ProtocolImplementation : IProtocolImplementation\n    {\n        public ProtocolImplementation(\n            IProtocolMessageFactory messageFactory,\n            IProtocolSerializerFactory serializerFactory)\n        {\n            MessageFactory = messageFactory;\n            Serializer = serializerFactory.Create(MessageFactory);\n        }\n\n        public IProtocolMessageFactory MessageFactory { get; }\n\n        public IProtocolSerializer Serializer { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Contracts/ProtocolMessageFactoryExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol\n{\n    using Plexus.Interop.Protocol.Invocation;\n\n    public static class ProtocolMessageFactoryExtensions\n    {\n        public static IInvocationStart CreateInvocationStartRequest(this IProtocolMessageFactory factory, string serviceId, string methodId)\n        {\n            return factory.CreateInvocationStartRequest(\n                factory.CreateConsumedMethodReference(\n                    factory.CreateConsumedServiceReference(serviceId, Maybe<string>.Nothing),\n                    methodId), null);\n        }\n\n        public static IInvocationStart CreateInvocationStartRequest(this IProtocolMessageFactory factory, string serviceId, Maybe<string> serviceAlias, string methodId)\n        {\n            return factory.CreateInvocationStartRequest(\n                factory.CreateConsumedMethodReference(\n                    factory.CreateConsumedServiceReference(serviceId, serviceAlias),\n                    methodId), null);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/BrokerToClientRequestEnvelope.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class BrokerToClientRequestEnvelope : PooledObject<BrokerToClientRequestEnvelope>\n    {\n        protected override void Cleanup()\n        {\n            InvocationStartRequested?.Dispose();\n            ClearPayload();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ClientToBrokerRequestEnvelope.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ClientToBrokerRequestEnvelope : PooledObject<ClientToBrokerRequestEnvelope>\n    {\n        protected override void Cleanup()\n        {\n            InvocationStartRequest?.Dispose();\n            ServiceDiscoveryRequest?.Dispose();\n            MethodDiscoveryRequest?.Dispose();\n            ClearPayload();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ConnectRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConnectRequest : PooledObject<ConnectRequest>\n    {\n        protected override void Cleanup()\n        {\n            ApplicationId = string.Empty;\n            ApplicationInstanceId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ConnectResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConnectResponse : PooledObject<ConnectResponse>\n    {\n        protected override void Cleanup()\n        {\n            ConnectionId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ConsumedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConsumedMethodReference : PooledObject<ConsumedMethodReference>\n    {\n        protected override void Cleanup()\n        {\n            ConsumedService?.Dispose();\n            ConsumedService = default;\n            MethodId = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ConsumedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConsumedServiceReference : PooledObject<ConsumedServiceReference>\n    {\n        protected override void Cleanup()\n        {\n            ServiceAlias = string.Empty;\n            ServiceId = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ContextLinkageDiscoveryOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ContextLinkageOptions : PooledObject<ContextLinkageOptions>\n    {\n        protected override void Cleanup()\n        {\n            ClearMode();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/DiscoveredMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class DiscoveredMethod : PooledObject<DiscoveredMethod>\n    {\n        protected override void Cleanup()\n        {\n            InputMessageId = string.Empty;\n            OutputMessageId = string.Empty;\n            MethodTitle = string.Empty;\n            MethodType = default;\n            ProvidedMethod?.Dispose();\n            ProvidedMethod = default;\n            foreach (var option in Options)\n            {\n                option.Dispose();\n            }\n            Options.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/DiscoveredService.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class DiscoveredService : PooledObject<DiscoveredService>\n    {\n        protected override void Cleanup()\n        {\n            ConsumedService?.Dispose();\n            ConsumedService = default;\n            ProvidedService?.Dispose();\n            ProvidedService = default;\n            foreach (var method in Methods)\n            {\n                method.Dispose();\n            }\n            Methods.Clear();\n            ServiceTitle = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/DiscoveredServiceMethod.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class DiscoveredServiceMethod : PooledObject<DiscoveredServiceMethod>\n    {\n        protected override void Cleanup()\n        {\n            MethodId = string.Empty;            \n            InputMessageId = string.Empty;\n            OutputMessageId = string.Empty;\n            MethodTitle = string.Empty;\n            MethodType = default;\n            foreach (var option in Options)\n            {\n                option.Dispose();\n            }\n            Options.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/Empty.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    internal partial class Empty\n    {\n        internal static readonly Empty Instance = new Empty();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationMessageEnvelope.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationMessageEnvelope : PooledObject<InvocationMessageEnvelope>\n    {\n        protected override void Cleanup()\n        {\n            Confirmation?.Dispose();\n            SendCompletion?.Dispose();\n            Message?.Dispose();\n            ClearPayload();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationMessageHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationMessageHeader : PooledObject<InvocationMessageHeader>\n    {\n        protected override void Cleanup()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationMessageReceived.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationMessageReceived : PooledObject<InvocationMessageReceived>\n    {\n        protected override void Cleanup()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationSendCompleted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationSendCompletion : PooledObject<InvocationSendCompletion>\n    {\n        protected override void Cleanup()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationStartRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationStartRequest : PooledObject<InvocationStartRequest>\n    {\n        protected override void Cleanup()\n        {\n            ConsumedMethod?.Dispose();\n            ProvidedMethod?.Dispose();\n            ContextLinkageOptions?.Dispose();\n            ClearTarget();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationStartRequested.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationStartRequested : PooledObject<InvocationStartRequested>\n    {\n        protected override void Cleanup()\n        {\n            ConsumerApplicationId = string.Empty;\n            ConsumerConnectionId = default;\n            MethodId = string.Empty;\n            ServiceAlias = string.Empty;\n            ServiceId = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationStarted.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationStarted : PooledObject<InvocationStarted>\n    {\n        protected override void Cleanup()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/InvocationStarting.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class InvocationStarting : PooledObject<InvocationStarting>\n    {\n        protected override void Cleanup()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/MethodDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class MethodDiscoveryRequest : PooledObject<MethodDiscoveryRequest>\n    {\n        protected override void Cleanup()\n        {\n            DiscoveryMode = default;\n            ConsumedMethod?.Dispose();\n            ConsumedMethod = default;\n            InputMessageId = string.Empty;\n            OutputMessageId = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/MethodDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class MethodDiscoveryResponse : PooledObject<MethodDiscoveryResponse>\n    {\n        protected override void Cleanup()\n        {\n            foreach (var method in Methods)\n            {\n                method.Dispose();\n            }\n            Methods.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/Option.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class Option : PooledObject<Option>, IOption\n    {\n        protected override void Cleanup()\n        {\n            Id = string.Empty;\n            Value = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ProvidedMethodReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ProvidedMethodReference : PooledObject<ProvidedMethodReference>\n    {\n        protected override void Cleanup()\n        {\n            ProvidedService?.Dispose();\n            ProvidedService = default;\n            MethodId = string.Empty;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ProvidedServiceReference.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ProvidedServiceReference : PooledObject<ProvidedServiceReference>\n    {\n        protected override void Cleanup()\n        {\n            ServiceId = string.Empty;\n            ServiceAlias = string.Empty;\n            ApplicationId = string.Empty;\n            ConnectionId = default;\n            ApplicationInstanceId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ServiceDiscoveryRequest.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ServiceDiscoveryRequest : PooledObject<ServiceDiscoveryRequest>\n    {\n        protected override void Cleanup()\n        {\n            ConsumedService?.Dispose();\n            ConsumedService = default;\n            DiscoveryMode = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Internal/ServiceDiscoveryResponse.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ServiceDiscoveryResponse : PooledObject<ServiceDiscoveryResponse>\n    {\n        protected override void Cleanup()\n        {\n            foreach (var service in Services)\n            {\n                service.Dispose();\n            }\n            Services.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/Plexus.Interop.Protocol.Protobuf.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <NUGET_PACKAGES Condition=\" '$(NUGET_PACKAGES)' == '' \">$(USERPROFILE)\\.nuget\\packages</NUGET_PACKAGES>\n    <ProtoCompilerPath>$(NUGET_PACKAGES)\\google.protobuf.tools\\3.20.1\\tools\\windows_x86\\protoc</ProtoCompilerPath>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.20.1\" />\n    <PackageReference Include=\"Google.Protobuf.Tools\" Version=\"3.20.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Protobuf\\Plexus.Interop.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Common.Contracts\\Plexus.Interop.Protocol.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Contracts\\Plexus.Interop.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <ProtoRoot>../../../protocol/</ProtoRoot>\n    <ProtoOutDir>Internal\\</ProtoOutDir>\n    <ProtoOutDirParam>$(ProtoOutDir)</ProtoOutDirParam>\n    <ProtoOutDirParam Condition=\" '$(ProtoOutDirParam)' == '' \">.</ProtoOutDirParam>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Protobuf Include=\"$(ProtoRoot)plexus.interop.proto\" />\n  </ItemGroup>\n\n  <Target Name=\"ProtoCompile\" BeforeTargets=\"CoreCompile\">\n    <PropertyGroup>\n      <ProtoCCommand>$(ProtoCompilerPath) --csharp_out=internal_access:$(ProtoOutDirParam) --csharp_opt=file_extension=.proto.cs -I $(ProtoRoot) @(Protobuf -> '%(Identity)', ' ')</ProtoCCommand>\n    </PropertyGroup>\n    <Message Importance=\"high\" Text=\"$(ProtoCCommand)\" />\n    <Delete Files=\"$(ProtoOutDir)*.proto.cs\" />\n    <Exec Command=\"$(ProtoCCommand)\" WorkingDirectory=\"$(ProjectDir)\" />\n    <ItemGroup>\n      <Generated Include=\"$(ProtoOutDir)*.proto.cs\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Remove=\"@(Generated)\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Include=\"@(Generated)\" />\n    </ItemGroup>\n  </Target>\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/ProtobufProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Protocol.Protobuf\n{\n    using Plexus.Interop.Protobuf;\n    using Plexus.Interop.Protocol.Connect;\n    using Plexus.Interop.Protocol.Discovery;\n    using Plexus.Interop.Protocol.Invocation;\n    using Plexus.Interop.Protocol.Protobuf.Internal;\n    using Plexus.Pools;\n    using System;\n    using System.Linq;\n    using DiscoveryMethodType = Plexus.Interop.Protocol.Discovery.MethodType;\n    using DiscoveryMode = Discovery.DiscoveryMode;\n    using MethodType = Plexus.Interop.Protocol.Protobuf.Internal.MethodType;\n\n    internal sealed class ProtobufProtocolSerializer : IProtocolSerializer\n    {\n        private readonly IProtocolMessageFactory _messageFactory;\n        private readonly ClientToBrokerRequestHandler<IPooledBuffer, Nothing> _clientToBrokerRequestSerializer;\n        private readonly BrokerToClientRequestHandler<IPooledBuffer, Nothing> _brokerToClientRequestSerializer;\n        private readonly InvocationMessageHandler<IPooledBuffer, Nothing> _invocationMessageSerializer;\n        private readonly InvocationTargetHandler<IDisposable, InvocationStartRequest> _setInvocationTargetHandler;\n\n        public ProtobufProtocolSerializer(IProtocolMessageFactory messageFactory)\n        {\n            _messageFactory = messageFactory;\n            _clientToBrokerRequestSerializer = new ClientToBrokerRequestHandler<IPooledBuffer, Nothing>(Serialize, Serialize, Serialize);\n            _brokerToClientRequestSerializer = new BrokerToClientRequestHandler<IPooledBuffer, Nothing>(Serialize);\n            _invocationMessageSerializer = new InvocationMessageHandler<IPooledBuffer, Nothing>(Serialize, Serialize, Serialize);\n            _setInvocationTargetHandler = new InvocationTargetHandler<IDisposable, InvocationStartRequest>(SetTarget, SetTarget);\n        }\n\n        public IConnectRequest DeserializeConnectRequest(IPooledBuffer msg)\n        {\n            using (var obj = ConnectRequest.Rent())\n            {\n                obj.MergeFrom(msg);\n                return _messageFactory.CreateConnectRequest(\n                    obj.ApplicationId,\n                    obj.ApplicationInstanceId.ConvertFromProtoStrict());\n            }\n        }\n\n        public IConnectResponse DeserializeConnectResponse(IPooledBuffer msg)\n        {\n            using (var obj = ConnectResponse.Rent())\n            {\n                obj.MergeFrom(msg);\n                return _messageFactory.CreateConnectResponse(obj.ConnectionId.ConvertFromProtoStrict());\n            }\n        }\n\n        public IPooledBuffer Serialize(IConnectRequest msg)\n        {\n            using (var obj = ConnectRequest.Rent())\n            {\n                obj.ApplicationId = msg.ApplicationId;\n                obj.ApplicationInstanceId = obj.ApplicationInstanceId.MergeFrom(msg.ApplicationInstanceId);\n                return obj.Serialize();\n            }\n        }\n\n        public IPooledBuffer Serialize(IConnectResponse msg)\n        {\n            using (var obj = ConnectResponse.Rent())\n            {\n                obj.ConnectionId = obj.ConnectionId.MergeFrom(msg.ConnectionId);\n                return obj.Serialize();\n            }\n        }\n\n        private IPooledBuffer Serialize(IServiceDiscoveryRequest msg, Nothing _)\n        {\n            using (var envelope = ClientToBrokerRequestEnvelope.Rent())\n            {\n                var proto = ServiceDiscoveryRequest.Rent();\n                proto.DiscoveryMode = ConvertToProto(msg.DiscoveryMode);\n                proto.ConsumedService = ConvertToProto(msg.ConsumedService);\n                proto.ContextLinkageOptions = ConvertToProto(msg.ContextLinkageOptions);\n                envelope.ServiceDiscoveryRequest = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private IPooledBuffer Serialize(IMethodDiscoveryRequest msg, Nothing _)\n        {\n            using (var envelope = ClientToBrokerRequestEnvelope.Rent())\n            {\n                var proto = MethodDiscoveryRequest.Rent();\n                proto.DiscoveryMode = ConvertToProto(msg.DiscoveryMode);\n                proto.InputMessageId = msg.InputMessageId.ConvertToProto();\n                proto.ConsumedMethod = ConvertToProto(msg.ConsumedMethod);\n                proto.OutputMessageId = msg.OutputMessageId.ConvertToProto();\n                envelope.MethodDiscoveryRequest = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private ConsumedMethodReference ConvertToProto(Maybe<IConsumedMethodReference> obj)\n        {\n            return obj.HasValue ? ConvertToProtoStrict(obj.Value) : null;\n        }\n\n        public IInvocationMessage DeserializeInvocationMessage(IPooledBuffer message)\n        {\n            using (var envelope = InvocationMessageEnvelope.Rent())\n            {\n                envelope.MergeFrom(message);\n                switch (envelope.PayloadCase)\n                {\n                    case InvocationMessageEnvelope.PayloadOneofCase.Message:\n                        return _messageFactory.CreateInvocationMessageHeader();\n                    case InvocationMessageEnvelope.PayloadOneofCase.Confirmation:\n                        return _messageFactory.CreateInvocationMessageReceived();\n                    case InvocationMessageEnvelope.PayloadOneofCase.SendCompletion:\n                        return _messageFactory.CreateInvocationSendCompletion();\n                    default:\n                        throw new InvalidOperationException($\"Unexpected payload case: {envelope.PayloadCase}\");\n                }\n            }\n        }\n\n        public IInvocationStarted DeserializeInvocationStarted(IPooledBuffer message)\n        {\n            using (var proto = InvocationStarted.Rent())\n            {\n                proto.MergeFrom(message);\n                return _messageFactory.CreateInvocationStarted();\n            }\n        }\n\n        public IInvocationStarting DeserializeInvocationStarting(IPooledBuffer message)\n        {\n            using (var proto = InvocationStarting.Rent())\n            {\n                proto.MergeFrom(message);\n                return _messageFactory.CreateInvocationStarting();\n            }\n        }\n\n        public IBrokerToClientRequest DeserializeBrokerToClientRequest(IPooledBuffer message)\n        {\n            using (var envelope = BrokerToClientRequestEnvelope.Rent())\n            {\n                envelope.MergeFrom(message);\n                switch (envelope.PayloadCase)\n                {\n                    case BrokerToClientRequestEnvelope.PayloadOneofCase.InvocationStartRequested:\n                        var msg = envelope.InvocationStartRequested;\n                        return _messageFactory.CreateInvocationStartRequested(\n                            msg.ServiceId.ConvertFromProtoStrict(),\n                            msg.MethodId.ConvertFromProtoStrict(),\n                            msg.ServiceAlias.ConvertFromProto(),\n                            msg.ConsumerApplicationId.ConvertFromProtoStrict(),\n                            msg.ConsumerApplicationInstanceId.ConvertFromProtoStrict(),\n                            msg.ConsumerConnectionId.ConvertFromProtoStrict());\n                    default:\n                        throw new InvalidOperationException();\n                }\n            }\n        }\n\n        public IClientToBrokerRequest DeserializeClientToBrokerRequest(IPooledBuffer message)\n        {\n            using (var envelope = ClientToBrokerRequestEnvelope.Rent())\n            {\n                envelope.MergeFrom(message);\n                switch (envelope.PayloadCase)\n                {\n                    case ClientToBrokerRequestEnvelope.PayloadOneofCase.InvocationStartRequest:\n                        var invocationRequest = envelope.InvocationStartRequest;\n                        IInvocationTarget target;\n                        switch (invocationRequest.TargetCase)\n                        {\n                            case InvocationStartRequest.TargetOneofCase.ConsumedMethod:\n                                target = ConvertFromProtoStrict(invocationRequest.ConsumedMethod);\n                                break;\n                            case InvocationStartRequest.TargetOneofCase.ProvidedMethod:\n                                target = ConvertFromProtoStrict(invocationRequest.ProvidedMethod);\n                                break;\n                            default:\n                                throw new InvalidOperationException($\"Unexpected target payload: {invocationRequest.TargetCase}\");\n                        }\n                        var contextLinkageOptions = ConvertFromProtoStrict(invocationRequest.ContextLinkageOptions);\n                        return _messageFactory.CreateInvocationStartRequest(target, contextLinkageOptions);\n                    case ClientToBrokerRequestEnvelope.PayloadOneofCase.ServiceDiscoveryRequest:\n                        return ConvertFromProtoStrict(envelope.ServiceDiscoveryRequest);\n                    case ClientToBrokerRequestEnvelope.PayloadOneofCase.MethodDiscoveryRequest:\n                        return ConvertFromProtoStrict(envelope.MethodDiscoveryRequest);\n                    default:\n                        throw new InvalidOperationException();\n                }\n            }\n        }\n\n        public IPooledBuffer Serialize(IMethodDiscoveryResponse message)\n        {\n            using (var proto = MethodDiscoveryResponse.Rent())\n            {\n                proto.Methods.AddRange(message.Methods.Select(ConvertToProto));\n                return proto.Serialize();\n            }\n        }\n\n        public IServiceDiscoveryResponse DeserializeServiceDiscoveryResponse(IPooledBuffer message)\n        {\n            using (var obj = ServiceDiscoveryResponse.Rent())\n            {\n                obj.MergeFrom(message);\n                return _messageFactory.CreateServiceDiscoveryResponse(obj.Services.Select(ConvertFromProto).ToList());\n            }\n        }\n\n        public IMethodDiscoveryResponse DeserializeMethodDiscoveryResponse(IPooledBuffer message)\n        {\n            using (var proto = MethodDiscoveryResponse.Rent())\n            {\n                proto.MergeFrom(message);\n                return _messageFactory.CreateMethodDiscoveryResponse(proto.Methods.Select(ConvertFromProto).ToList());\n            }\n        }\n\n        public IPooledBuffer Serialize(IClientToBrokerRequest message)\n        {\n            return message.Handle(_clientToBrokerRequestSerializer);\n        }        \n\n        public IPooledBuffer Serialize(IBrokerToClientRequest message)\n        {\n            return message.Handle(_brokerToClientRequestSerializer);\n        }        \n\n        public IPooledBuffer Serialize(IInvocationStarting message)\n        {\n            using (var proto = InvocationStarting.Rent())\n            {\n                return proto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Serialize(IInvocationStarted message)\n        {\n            using (var proto = InvocationStarted.Rent())\n            {\n                return proto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Serialize(IInvocationMessage message)\n        {\n            return message.Handle(_invocationMessageSerializer);\n        }        \n\n        public IPooledBuffer Serialize(IServiceDiscoveryResponse message)\n        {\n            using (var proto = ServiceDiscoveryResponse.Rent())\n            {\n                proto.Services.AddRange(message.Services.Select(ConvertToProto));\n                return proto.Serialize();\n            }\n        }\n\n        private IPooledBuffer Serialize(IInvocationStart message, Nothing _)\n        {\n            using (var envelope = ClientToBrokerRequestEnvelope.Rent())\n            {\n                var proto = InvocationStartRequest.Rent();\n                message.Target.Handle(_setInvocationTargetHandler, proto);\n                proto.ContextLinkageOptions = ConvertToProto(message.ContextLinkageOptions);\n                envelope.InvocationStartRequest = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private static IPooledBuffer Serialize(IInvocationStartRequested message, Nothing _)\n        {\n            using (var envelope = BrokerToClientRequestEnvelope.Rent())\n            {\n                var obj = InvocationStartRequested.Rent();\n                obj.MethodId = message.MethodId.ConvertToProtoStrict();\n                obj.ServiceId = message.ServiceId.ConvertToProtoStrict();\n                obj.ServiceAlias = message.ServiceAlias.ConvertToProto();\n                obj.ConsumerApplicationId = message.ConsumerApplicationId.ConvertToProtoStrict();\n                obj.ConsumerApplicationInstanceId =\n                    obj.ConsumerApplicationInstanceId.MergeFrom(message.ConsumerApplicationInstanceId);\n                obj.ConsumerConnectionId = obj.ConsumerConnectionId.MergeFrom(message.ConsumerConnectionId);\n                envelope.InvocationStartRequested = obj;\n                return envelope.Serialize();\n            }\n        }\n\n        private static IPooledBuffer Serialize(IInvocationMessageReceived message, Nothing _)\n        {\n            using (var envelope = InvocationMessageEnvelope.Rent())\n            {\n                var proto = InvocationMessageReceived.Rent();\n                envelope.Confirmation = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private static IPooledBuffer Serialize(IInvocationMessageHeader message, Nothing _)\n        {\n            using (var envelope = InvocationMessageEnvelope.Rent())\n            {\n                var proto = InvocationMessageHeader.Rent();\n                envelope.Message = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private static IPooledBuffer Serialize(IInvocationSendCompleted message, Nothing _)\n        {\n            using (var envelope = InvocationMessageEnvelope.Rent())\n            {\n                var proto = InvocationSendCompletion.Rent();\n                envelope.SendCompletion = proto;\n                return envelope.Serialize();\n            }\n        }\n\n        private DiscoveredService ConvertToProto(IDiscoveredService service)\n        {\n            var proto = DiscoveredService.Rent();\n            proto.ProvidedService = ConvertToProtoStrict(service.ProvidedService);\n            proto.ConsumedService = ConvertToProtoStrict(service.ConsumedService);\n            proto.ServiceTitle = service.ServiceTitle.ConvertToProto();\n            proto.Methods.AddRange(service.Methods.Select(ConvertToProto));\n            return proto;\n        }\n\n        private DiscoveredServiceMethod ConvertToProto(IDiscoveredServiceMethod method)\n        {\n            var proto = DiscoveredServiceMethod.Rent();\n            proto.MethodType = ConvertToProto(method.MethodType);\n            proto.InputMessageId = method.InputMessageId.ConvertToProtoStrict();\n            proto.OutputMessageId = method.OutputMessageId.ConvertToProtoStrict();\n            proto.MethodId = method.MethodId.ConvertToProtoStrict();\n            proto.MethodTitle = method.MethodTitle.ConvertToProto();\n            proto.Options.AddRange(method.Options.Select(ConvertToProto));\n            return proto;\n        }\n\n        private DiscoveredMethod ConvertToProto(IDiscoveredMethod method)\n        {\n            var proto = DiscoveredMethod.Rent();\n            proto.MethodType = ConvertToProto(method.MethodType);\n            proto.InputMessageId = method.InputMessageId.ConvertToProtoStrict();\n            proto.OutputMessageId = method.OutputMessageId.ConvertToProtoStrict();\n            proto.MethodTitle = method.MethodTitle.ConvertToProto();\n            proto.ProvidedMethod = ConvertToProtoStrict(method.ProvidedMethod);\n            proto.Options.AddRange(method.Options.Select(ConvertToProto));\n            return proto;\n        }\n\n        private static Option ConvertToProto(IOption option)\n        {\n            var proto = Option.Rent();\n            proto.Id = option.Id;\n            proto.Value = option.Value;\n            return proto;\n        }\n\n        private MethodType ConvertToProto(DiscoveryMethodType methodType)\n        {\n            switch (methodType)\n            {\n                case DiscoveryMethodType.Unary:\n                    return MethodType.Unary;\n                case DiscoveryMethodType.ServerStreaming:\n                    return MethodType.ServerStreaming;\n                case DiscoveryMethodType.ClientStreaming:\n                    return MethodType.ClientStreaming;\n                case DiscoveryMethodType.DuplexStreaming:\n                    return MethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(methodType), methodType, null);\n            }\n        }\n\n        private static ConsumedServiceReference ConvertToProto(Maybe<IConsumedServiceReference> obj)\n        {\n            if (!obj.HasValue)\n            {\n                return null;\n            }\n            var proto = ConsumedServiceReference.Rent();\n            proto.ServiceAlias = obj.Value.ServiceAlias.ConvertToProto();\n            proto.ServiceId = obj.Value.ServiceId.ConvertToProtoStrict();\n            return proto;\n        }\n\n        private ContextLinkageOptions ConvertToProto(IContextLinkageOptions obj)\n        {\n            var proto = ContextLinkageOptions.Rent();\n            if (obj != null)\n            {\n                switch (obj.Mode)\n                {\n                    case ContextLinkageDiscoveryMode.None:\n                        proto.ClearMode();\n                        break;\n                    case ContextLinkageDiscoveryMode.SpecificContext:\n                        proto.SpecificContextId = obj.SpecificContext.Value;\n                        break;\n                    case ContextLinkageDiscoveryMode.CurrentContext:\n                        proto.CurrentContext = Empty.Instance;\n                        break;\n                }\n            }\n            return proto;\n        }\n\n        private Internal.DiscoveryMode ConvertToProto(DiscoveryMode discoveryMode)\n        {\n            switch (discoveryMode)\n            {\n                case DiscoveryMode.Offline:\n                    return Internal.DiscoveryMode.Offline;\n                case DiscoveryMode.Online:\n                    return Internal.DiscoveryMode.Online;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(discoveryMode), discoveryMode, null);\n            }\n        }\n\n        private DiscoveryMode ConvertFromProto(Internal.DiscoveryMode discoveryMode)\n        {\n            switch (discoveryMode)\n            {\n                case Internal.DiscoveryMode.Offline:\n                    return DiscoveryMode.Offline;\n                case Internal.DiscoveryMode.Online:\n                    return DiscoveryMode.Online;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(discoveryMode), discoveryMode, null);\n            }\n        }\n\n        private IMethodDiscoveryRequest ConvertFromProtoStrict(MethodDiscoveryRequest proto)\n        {\n            return _messageFactory.CreateMethodDiscoveryRequest(\n                proto.InputMessageId.ConvertFromProto(),\n                proto.OutputMessageId.ConvertFromProto(),\n                ConvertFromProto(proto.ConsumedMethod),\n                ConvertFromProto(proto.DiscoveryMode),\n                ConvertFromProtoStrict(proto.ContextLinkageOptions));\n        }\n\n        private Maybe<IConsumedMethodReference> ConvertFromProto(ConsumedMethodReference proto)\n        {\n            return proto == null\n                ? Maybe<IConsumedMethodReference>.Nothing\n                : new Maybe<IConsumedMethodReference>(ConvertFromProtoStrict(proto));\n        }\n\n        private IServiceDiscoveryRequest ConvertFromProtoStrict(ServiceDiscoveryRequest proto)\n        {\n            return _messageFactory.CreateServiceDiscoveryRequest(\n                ConvertFromProto(proto.ConsumedService),\n                ConvertFromProto(proto.DiscoveryMode),\n                ConvertFromProtoStrict(proto.ContextLinkageOptions));\n        }\n\n        private IProvidedMethodReference ConvertFromProtoStrict(ProvidedMethodReference proto)\n        {\n            return _messageFactory.CreateProvidedMethodReference(\n                ConvertFromProtoStrict(proto.ProvidedService),\n                proto.MethodId.ConvertFromProtoStrict());\n        }\n\n        private IProvidedServiceReference ConvertFromProtoStrict(ProvidedServiceReference proto)\n        {\n            return _messageFactory.CreateProvidedServiceReference(\n                proto.ServiceId.ConvertFromProtoStrict(),\n                proto.ServiceAlias.ConvertFromProto(),\n                proto.ApplicationId.ConvertFromProto(),\n                proto.ConnectionId.ConvertFromProto(),\n                proto.ApplicationInstanceId.ConvertFromProto());\n        }\n\n        private IConsumedMethodReference ConvertFromProtoStrict(ConsumedMethodReference proto)\n        {\n            return _messageFactory.CreateConsumedMethodReference(\n                ConvertFromProtoStrict(proto.ConsumedService),\n                proto.MethodId.ConvertFromProtoStrict());\n        }\n\n        private IConsumedServiceReference ConvertFromProtoStrict(ConsumedServiceReference proto)\n        {\n            return _messageFactory.CreateConsumedServiceReference(\n                proto.ServiceId.ConvertFromProtoStrict(),\n                proto.ServiceAlias.ConvertFromProto());\n        }\n\n        private Maybe<IConsumedServiceReference> ConvertFromProto(ConsumedServiceReference proto)\n        {\n            return proto == null\n                ? Maybe<IConsumedServiceReference>.Nothing\n                : new Maybe<IConsumedServiceReference>(ConvertFromProtoStrict(proto));\n        }\n\n        private IContextLinkageOptions ConvertFromProtoStrict(ContextLinkageOptions proto)\n        {\n            if (proto == null || proto.ModeCase == ContextLinkageOptions.ModeOneofCase.None)\n            {\n                return _messageFactory.CreateContextLinkageOptions(ContextLinkageDiscoveryMode.None, Maybe<string>.Nothing);\n            }\n            return _messageFactory.CreateContextLinkageOptions(\n                ConvertFromProto(proto.ModeCase),\n                proto.ModeCase == ContextLinkageOptions.ModeOneofCase.SpecificContextId \n                    ? new Maybe<string>(proto.SpecificContextId) \n                    : Maybe<string>.Nothing);\n        }\n\n        private IDiscoveredService ConvertFromProto(DiscoveredService proto)\n        {\n            return _messageFactory.CreateDiscoveredService(\n                ConvertFromProtoStrict(proto.ConsumedService),\n                ConvertFromProtoStrict(proto.ProvidedService),\n                proto.ServiceTitle.ConvertFromProto(),\n                proto.Methods.Select(ConvertFromProtoStrict).ToList());\n        }\n\n        private IDiscoveredMethod ConvertFromProto(DiscoveredMethod proto)\n        {\n            return _messageFactory.CreateDiscoveredMethod(\n                ConvertFromProtoStrict(proto.ProvidedMethod),\n                proto.MethodTitle.ConvertFromProto(),\n                proto.InputMessageId.ConvertFromProtoStrict(),\n                proto.OutputMessageId.ConvertFromProtoStrict(),\n                ConvertFromProto(proto.MethodType),\n                proto.Options.Select(ConvertFromProtoStrict).ToList());\n        }\n\n        private IOption ConvertFromProtoStrict(Option proto)\n        {\n            return _messageFactory.CreateOption(proto.Id.ConvertFromProtoStrict(), proto.Value);\n        }\n\n        private IDiscoveredServiceMethod ConvertFromProtoStrict(DiscoveredServiceMethod proto)\n        {\n            return _messageFactory.CreateDiscoveredServiceMethod(\n                proto.MethodId.ConvertFromProtoStrict(),\n                proto.MethodTitle.ConvertFromProto(),\n                proto.InputMessageId.ConvertFromProtoStrict(),\n                proto.OutputMessageId.ConvertFromProtoStrict(),\n                ConvertFromProto(proto.MethodType),\n                proto.Options.Select(ConvertFromProtoStrict).ToList());\n        }\n\n        private DiscoveryMethodType ConvertFromProto(MethodType proto)\n        {\n            switch (proto)\n            {\n                case MethodType.Unary:\n                    return DiscoveryMethodType.Unary;\n                case MethodType.ServerStreaming:\n                    return DiscoveryMethodType.ServerStreaming;\n                case MethodType.ClientStreaming:\n                    return DiscoveryMethodType.ClientStreaming;\n                case MethodType.DuplexStreaming:\n                    return DiscoveryMethodType.DuplexStreaming;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(proto), proto, null);\n            }\n        }\n\n        private ContextLinkageDiscoveryMode ConvertFromProto(ContextLinkageOptions.ModeOneofCase protoModeCase)\n        {\n            switch (protoModeCase)\n            {\n                case ContextLinkageOptions.ModeOneofCase.None:\n                    return ContextLinkageDiscoveryMode.None;\n                case ContextLinkageOptions.ModeOneofCase.SpecificContextId:\n                    return ContextLinkageDiscoveryMode.SpecificContext;\n                case ContextLinkageOptions.ModeOneofCase.CurrentContext:\n                    return ContextLinkageDiscoveryMode.CurrentContext;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(protoModeCase), protoModeCase, null);\n            }\n        }\n\n        private static IDisposable SetTarget(IProvidedMethodReference obj, InvocationStartRequest req)\n        {\n            var proto = ConvertToProtoStrict(obj);\n            req.ProvidedMethod = proto;\n            return proto;\n        }\n\n        private static IDisposable SetTarget(IConsumedMethodReference obj, InvocationStartRequest req)\n        {\n            var proto = ConvertToProtoStrict(obj);\n            req.ConsumedMethod = proto;\n            return proto;\n        }\n\n        private static ConsumedMethodReference ConvertToProtoStrict(IConsumedMethodReference obj)\n        {\n            var proto = ConsumedMethodReference.Rent();\n            proto.ConsumedService = ConvertToProtoStrict(obj.ConsumedService);\n            proto.MethodId = obj.MethodId.ConvertToProtoStrict();\n            return proto;\n        }\n\n        private static ConsumedServiceReference ConvertToProtoStrict(IConsumedServiceReference obj)\n        {\n            var proto = ConsumedServiceReference.Rent();\n            proto.ServiceId = obj.ServiceId.ConvertToProtoStrict();\n            proto.ServiceAlias = obj.ServiceAlias.ConvertToProto();\n            return proto;\n        }\n\n        private static ProvidedMethodReference ConvertToProtoStrict(IProvidedMethodReference obj)\n        {\n            var proto = ProvidedMethodReference.Rent();\n            proto.ProvidedService = ConvertToProtoStrict(obj.ProvidedService);\n            proto.MethodId = obj.MethodId.ConvertToProtoStrict();\n            return proto;\n        }\n\n        private static ProvidedServiceReference ConvertToProtoStrict(IProvidedServiceReference obj)\n        {\n            var proto = ProvidedServiceReference.Rent();\n            proto.ServiceId = obj.ServiceId.ConvertToProtoStrict();\n            proto.ApplicationId = obj.ApplicationId.ConvertToProto();\n            proto.ConnectionId = proto.ConnectionId.MergeFrom(obj.ConnectionId);\n            proto.ServiceAlias = obj.ServiceAlias.ConvertToProto();\n            proto.ApplicationInstanceId = proto.ApplicationInstanceId.MergeFrom(obj.ApplicationInstanceId);\n            return proto;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf/ProtobufProtocolSerializerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Protobuf\n{\n    public sealed class ProtobufProtocolSerializerFactory : IProtocolSerializerFactory\n    {\n        public IProtocolSerializer Create(IProtocolMessageFactory messageFactory)\n        {\n            return new ProtobufProtocolSerializer(messageFactory);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf.Tests/Plexus.Interop.Protocol.Protobuf.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Protocol.Protobuf</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Protobuf\\Plexus.Interop.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol\\Plexus.Interop.Protocol.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf.Tests/ProtobufSerializerTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Protocol.Protobuf\n{\n    using Plexus.Interop.Protocol.Invocation;\n    using System;\n    using Shouldly;\n    using Xunit;\n\n    public sealed class ProtobufSerializerTests : TestsSuite\n    {\n        private static readonly IProtocolMessageFactory MessageFactory = ProtocolMessagePool.Instance;\n\n        private static readonly ProtobufProtocolSerializerFactory SerializerFactory =\n            new ProtobufProtocolSerializerFactory();\n\n        [Fact]\n        public void InvocationStartRequestSerialization()\n        {\n            var serializer = SerializerFactory.Create(MessageFactory);\n            using (var request = MessageFactory.CreateInvocationStartRequest(\"interop.testing.EchoService\", \"Unary\"))\n            using (var serialized = serializer.Serialize(request))\n            using (var deserialized = serializer.DeserializeClientToBrokerRequest(serialized))\n            {\n                deserialized.Handle(new ClientToBrokerRequestHandler<Nothing, Nothing>(\n                    (msg, _) =>\n                    {\n                        return msg.Target.Handle(new InvocationTargetHandler<Nothing, Nothing>(\n                                (target, __) =>\n                                {\n                                    target.MethodId.ShouldBe(\"Unary\");\n                                    target.ConsumedService.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                                    target.ConsumedService.ServiceAlias.ShouldBe(Maybe<string>.Nothing);\n                                    return Nothing.Instance;\n                                },\n                            (target, __) => throw new InvalidOperationException($\"Unexpected target: {target}\")));\n                    },\n                    (msg, _) => throw new InvalidOperationException($\"Unexpected message: {msg}\"),\n                    (msg, _) => throw new InvalidOperationException($\"Unexpected message: {msg}\")));\n            }\n        }\n\n        [Theory]\n        [InlineData(ContextLinkageDiscoveryMode.None)]\n        [InlineData(ContextLinkageDiscoveryMode.CurrentContext)]\n        public void ContextLinkageInfoIsSerializedCorrectly(ContextLinkageDiscoveryMode mode)\n        {\n            var serializer = SerializerFactory.Create(MessageFactory);\n            var serviceReference = MessageFactory.CreateConsumedServiceReference(\"interop.testing.EchoService\", Maybe<string>.Nothing);\n            var methodReference = MessageFactory.CreateConsumedMethodReference(serviceReference, \"Unary\");\n            var contextLinkageOptions = MessageFactory.CreateContextLinkageOptions(mode, Maybe<string>.Nothing);\n            using (var request = MessageFactory.CreateInvocationStartRequest(methodReference, contextLinkageOptions))\n            using (var serialized = serializer.Serialize(request))\n            using (var deserialized = serializer.DeserializeClientToBrokerRequest(serialized))\n            {\n                deserialized.Handle(new ClientToBrokerRequestHandler<Nothing, Nothing>(\n                    (msg, _) =>\n                    {\n                        msg.ContextLinkageOptions.Mode.ShouldBe(mode);\n                        return msg.Target.Handle(new InvocationTargetHandler<Nothing, Nothing>(\n                            (target, __) =>\n                            {\n                                target.MethodId.ShouldBe(\"Unary\");\n                                target.ConsumedService.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                                target.ConsumedService.ServiceAlias.ShouldBe(Maybe<string>.Nothing);\n                                return Nothing.Instance;\n                            },\n                            (target, __) => throw new InvalidOperationException($\"Unexpected target: {target}\")));\n                    },\n                    (msg, _) => throw new InvalidOperationException($\"Unexpected message: {msg}\"),\n                    (msg, _) => throw new InvalidOperationException($\"Unexpected message: {msg}\")));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Protocol.Protobuf.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/CcyPairRateProvider.cmd",
    "content": "CD %~dp0\nstart /wait CcyPairRateProvider.exe"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Generate.cmd",
    "content": "REM Generate code from CcyPairRateProvider interop definitions\n\nset PLEXUS_GEN_PATH=..\\..\\..\\bin\\win-x86\\sdk\\plexusgen.jar\nset INTEROP_METADATA_PATH=..\\..\\..\\samples\\quick-start\\registry\nif not defined NUGET_PACKAGES (\n  set NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\nset PROTOC_PATH=%NUGET_PACKAGES%\\google.protobuf.tools\\3.6.1\\tools\\windows_x86\\protoc.exe\n\nset INTEROP_MANIFEST_PATH=ccy_pair_rate_provider.interop\nset CSHARP_NAMESPACE=Plexus.Interop.Samples.CcyPairRateProvider.Generated\nset CSHARP_OUT=Generated\n\njava -jar %PLEXUS_GEN_PATH% --baseDir=%INTEROP_METADATA_PATH% --input=%INTEROP_MANIFEST_PATH% --type=csharp --out=%CSHARP_OUT% --namespace=%CSHARP_NAMESPACE% --protoc=%PROTOC_PATH%"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Generated/fx/CcyPairRateService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: fx/ccy_pair_rate_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.CcyPairRateProvider.Generated {\n\n  /// <summary>Holder for reflection information generated from fx/ccy_pair_rate_service.proto</summary>\n  public static partial class CcyPairRateServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for fx/ccy_pair_rate_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static CcyPairRateServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch5meC9jY3lfcGFpcl9yYXRlX3NlcnZpY2UucHJvdG8SAmZ4GhVpbnRlcm9w\",\n            \"L29wdGlvbnMucHJvdG8iMAoHQ2N5UGFpchIVCg1jY3lfcGFpcl9uYW1lGAEg\",\n            \"ASgJOg6S2wQKZnguQ2N5UGFpciJGCgtDY3lQYWlyUmF0ZRIVCg1jY3lfcGFp\",\n            \"cl9uYW1lGAEgASgJEgwKBHJhdGUYAiABKAE6EpLbBA5meC5DY3lQYWlyUmF0\",\n            \"ZTJYChJDY3lQYWlyUmF0ZVNlcnZpY2USJwoHR2V0UmF0ZRILLmZ4LkNjeVBh\",\n            \"aXIaDy5meC5DY3lQYWlyUmF0ZRoZktsEFWZ4LkNjeVBhaXJSYXRlU2Vydmlj\",\n            \"ZUI3qgI0UGxleHVzLkludGVyb3AuU2FtcGxlcy5DY3lQYWlyUmF0ZVByb3Zp\",\n            \"ZGVyLkdlbmVyYXRlZGIGcHJvdG8z\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair), global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair.Parser, new[]{ \"CcyPairName\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate), global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate.Parser, new[]{ \"CcyPairName\", \"Rate\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class CcyPair : pb::IMessage<CcyPair> {\n    private static readonly pb::MessageParser<CcyPair> _parser = new pb::MessageParser<CcyPair>(() => new CcyPair());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<CcyPair> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair(CcyPair other) : this() {\n      ccyPairName_ = other.ccyPairName_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair Clone() {\n      return new CcyPair(this);\n    }\n\n    /// <summary>Field number for the \"ccy_pair_name\" field.</summary>\n    public const int CcyPairNameFieldNumber = 1;\n    private string ccyPairName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string CcyPairName {\n      get { return ccyPairName_; }\n      set {\n        ccyPairName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as CcyPair);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(CcyPair other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (CcyPairName != other.CcyPairName) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (CcyPairName.Length != 0) hash ^= CcyPairName.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (CcyPairName.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(CcyPairName);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (CcyPairName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(CcyPairName);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(CcyPair other) {\n      if (other == null) {\n        return;\n      }\n      if (other.CcyPairName.Length != 0) {\n        CcyPairName = other.CcyPairName;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            CcyPairName = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  public sealed partial class CcyPairRate : pb::IMessage<CcyPairRate> {\n    private static readonly pb::MessageParser<CcyPairRate> _parser = new pb::MessageParser<CcyPairRate>(() => new CcyPairRate());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<CcyPairRate> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate(CcyPairRate other) : this() {\n      ccyPairName_ = other.ccyPairName_;\n      rate_ = other.rate_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate Clone() {\n      return new CcyPairRate(this);\n    }\n\n    /// <summary>Field number for the \"ccy_pair_name\" field.</summary>\n    public const int CcyPairNameFieldNumber = 1;\n    private string ccyPairName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string CcyPairName {\n      get { return ccyPairName_; }\n      set {\n        ccyPairName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"rate\" field.</summary>\n    public const int RateFieldNumber = 2;\n    private double rate_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public double Rate {\n      get { return rate_; }\n      set {\n        rate_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as CcyPairRate);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(CcyPairRate other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (CcyPairName != other.CcyPairName) return false;\n      if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Rate, other.Rate)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (CcyPairName.Length != 0) hash ^= CcyPairName.GetHashCode();\n      if (Rate != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Rate);\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (CcyPairName.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(CcyPairName);\n      }\n      if (Rate != 0D) {\n        output.WriteRawTag(17);\n        output.WriteDouble(Rate);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (CcyPairName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(CcyPairName);\n      }\n      if (Rate != 0D) {\n        size += 1 + 8;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(CcyPairRate other) {\n      if (other == null) {\n        return;\n      }\n      if (other.CcyPairName.Length != 0) {\n        CcyPairName = other.CcyPairName;\n      }\n      if (other.Rate != 0D) {\n        Rate = other.Rate;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            CcyPairName = input.ReadString();\n            break;\n          }\n          case 17: {\n            Rate = input.ReadDouble();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Generated/fx/CcyPairRateService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: fx\\ccy_pair_rate_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.CcyPairRateProvider.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class CcyPairRateService {\n\t\t\n\t\tpublic const string Id = \"fx.CcyPairRateService\";\t\t\t\n\t\tpublic const string GetRateMethodId = \"GetRate\";\n\t\t\n\t\tpublic static readonly CcyPairRateService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static CcyPairRateService.Descriptor CreateDescriptor() {\n\t\t\treturn new CcyPairRateService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static CcyPairRateService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new CcyPairRateService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IGetRateProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetRateImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> GetRateMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tGetRateMethod = Method.Unary<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate>(Id, GetRateMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tGetRateMethod = Method.Unary<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate>(Id, alias, GetRateMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.CcyPairRateProvider.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  public static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUI3qgI0UGxleHVzLkludGVyb3AuU2FtcGxlcy5DY3lQYWlyUmF0ZVByb3Zp\",\n            \"ZGVyLkdlbmVyYXRlZGIGcHJvdG8z\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { pbr::FileDescriptor.DescriptorProtoFileDescriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null));\n    }\n    #endregion\n\n  }\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Generated/vendor_a/fx/CcyPairRateProvider.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: vendor_a\\fx\\ccy_pair_rate_provider.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.CcyPairRateProvider.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface ICcyPairRateProviderClient: IClient {\n\t}\n\t\n\tpublic sealed partial class CcyPairRateProviderClient: ClientBase, ICcyPairRateProviderClient {\n\t\t\n\t\tpublic const string Id = \"vendor_a.fx.CcyPairRateProvider\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(CcyPairRateProviderClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic CcyPairRateProviderClient(\n\t\t\tCcyPairRateProviderClient.ICcyPairRateServiceImpl ccyPairRateService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new CcyPairRateProviderClient.ServiceBinder(\n\t\t\tccyPairRateService\n\t\t), setup) { }\n\t\t\n\t\tpublic CcyPairRateProviderClient(CcyPairRateProviderClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tCcyPairRateProviderClient.ICcyPairRateServiceImpl ccyPairRateService\n\t\t\t) {\n\t\t\t\t_ccyPairRateServiceBinder = new CcyPairRateProviderClient.CcyPairRateServiceBinder(ccyPairRateService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate CcyPairRateServiceBinder _ccyPairRateServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _ccyPairRateServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface ICcyPairRateServiceImpl:\n\t\t\tglobal::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateService.IGetRateImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class CcyPairRateServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly ICcyPairRateServiceImpl _impl;\n\t\t\t\n\t\t\tpublic CcyPairRateServiceBinder(ICcyPairRateServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate>(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateService.GetRateMethodId, _impl.GetRate);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class CcyPairRateServiceImpl: ICcyPairRateServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> _getRateHandler;\n\t\t\t\n\t\t\tpublic CcyPairRateServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> getRateHandler\n\t\t\t) {\n\t\t\t\t_getRateHandler = getRateHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair request, MethodCallContext context) {\n\t\t\t\treturn _getRateHandler(request, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class CcyPairRateServiceImpl<T>: ICcyPairRateServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRateService.IGetRateImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic CcyPairRateServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateProvider.Generated.CcyPair request, MethodCallContext context) {\n\t\t\t\treturn _impl.GetRate(request, context);\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Plexus.Interop.Samples.CcyPairRateProvider.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' != ''\">\n    <TargetFramework>net45</TargetFramework>\n    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <TargetFramework>netcoreapp2.1</TargetFramework>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    \n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PlatformTarget>x86</PlatformTarget>\n\n    <ArtifactsDir>../../../bin/$(RuntimeIdentifier)/</ArtifactsDir>\n    <SamplesDir>$(ArtifactsDir)samples/quick-start/</SamplesDir>\n    <PublishDir>$(SamplesDir)apps/CcyPairRateProvider/</PublishDir>    \n\n    <AssemblyName>CcyPairRateProvider</AssemblyName>\n\n    <IsPackable>false</IsPackable>\n    \n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Channels\\Plexus.Channels.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"CcyPairRateProvider.cmd\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Target Name=\"PublishAfterBuild\" AfterTargets=\"Build\" DependsOnTargets=\"Publish\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Program.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Samples.CcyPairRateProvider\n{\n    using Plexus.Interop.Samples.CcyPairRateProvider.Generated;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    public sealed class Program : CcyPairRateProviderClient.ICcyPairRateServiceImpl\n    {\n        private readonly Random _random = new Random();\n\n        public static void Main(string[] args)\n        {\n            new Program().MainAsync(args).GetAwaiter().GetResult();\n        }\n\n        public async Task MainAsync(string[] args)\n        {\n            // Read broker working dir specified either in the first\n            // command line argument or in environment variable, \n            // or just use current working directory.\n            var brokerWorkingDir = args.Length > 0\n                ? args[0]\n                : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n\n            // Creating client and connecting to broker\n            Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n            var client = new CcyPairRateProviderClient(this, setup => setup.WithBrokerWorkingDir(brokerWorkingDir));            \n            await client.ConnectAsync();\n            Console.WriteLine(\"Connected. Waiting for requests. Press CTRL+C to disconnect.\");\n            Console.CancelKeyPress += (sender, eventArgs) =>\n            {\n                eventArgs.Cancel = true;\n                client.Disconnect();\n            };\n\n            // Awaiting completion\n            await client.Completion;\n            Console.WriteLine(\"Disconnected.\");\n        }\n\n\n        // Implementation of unary method GetRate\n        public Task<CcyPairRate> GetRate(CcyPair request, MethodCallContext context)\n        {\n            Console.WriteLine(\"Received request: {0}\", request);\n            var response = GetCcyPairRate(request);\n            Console.WriteLine(\"Sending response: {0}\", response);\n            return Task.FromResult(response);\n        }\n\n        // Implementation of server streaming method GetRateStream\n        public async Task GetRateStream(\n            CcyPair request,\n            IWritableChannel<CcyPairRate> responseStream,\n            MethodCallContext context)\n        {\n            Console.WriteLine(\"Received subscription: {0}\", request);\n            try\n            {\n                do\n                {\n                    var response = GetCcyPairRate(request);\n                    Console.WriteLine(\"Sending response: {0}\", response);\n                    await responseStream.TryWriteAsync(response, context.CancellationToken);\n                    await Task.Delay(_random.Next(1000, 3000), context.CancellationToken);\n                } while (!context.CancellationToken.IsCancellationRequested);\n            }\n            catch (OperationCanceledException) when (context.CancellationToken.IsCancellationRequested)\n            {\n                // Ignoring cancellation exception\n            }\n            Console.WriteLine(\"Subscription completed\");\n        }\n\n        private CcyPairRate GetCcyPairRate(CcyPair request)\n        {\n            CcyPairRate response;\n            switch (request.CcyPairName)\n            {\n                case \"EURUSD\":\n                    response = new CcyPairRate\n                    {\n                        CcyPairName = \"EURUSD\",\n                        Rate = 1.15 + 0.05 * _random.NextDouble()\n                    };\n                    break;\n                case \"EURGBP\":\n                    response = new CcyPairRate\n                    {\n                        CcyPairName = \"EURGBP\",\n                        Rate = 0.87 + 0.05 * _random.NextDouble()\n                    };\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException($\"Unknown currency pair: {request.CcyPairName}\");\n            }\n\n            return response;\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Plexus.Interop.Samples.GreetingClient\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\apps\\\\CcyPairRateProvider\\\\CcyPairRateProvider.exe\",\n      \"workingDirectory\": \"$(SamplesDir)\"\n    }\n  }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/CcyPairRateViewer.cmd",
    "content": "CD %~dp0\nstart /wait CcyPairRateViewer.exe"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Generate.cmd",
    "content": "REM Generate code from CcyPairRateViewer interop definitions\n\nset PLEXUS_GEN_PATH=..\\..\\..\\bin\\win-x86\\sdk\\plexusgen.jar\nset INTEROP_METADATA_PATH=..\\..\\..\\samples\\quick-start\\registry\nif not defined NUGET_PACKAGES (\n  set NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\nset PROTOC_PATH=%NUGET_PACKAGES%\\google.protobuf.tools\\3.6.1\\tools\\windows_x86\\protoc.exe\n\nset INTEROP_MANIFEST_PATH=ccy_pair_rate_viewer.interop\nset CSHARP_NAMESPACE=Plexus.Interop.Samples.CcyPairRateViewer.Generated\nset CSHARP_OUT=Generated\n\njava -jar %PLEXUS_GEN_PATH% --baseDir=%INTEROP_METADATA_PATH% --input=%INTEROP_MANIFEST_PATH% --type=csharp --out=%CSHARP_OUT% --namespace=%CSHARP_NAMESPACE% --protoc=%PROTOC_PATH%"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Generated/fx/CcyPairRateService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: fx/ccy_pair_rate_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.CcyPairRateViewer.Generated {\n\n  /// <summary>Holder for reflection information generated from fx/ccy_pair_rate_service.proto</summary>\n  public static partial class CcyPairRateServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for fx/ccy_pair_rate_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static CcyPairRateServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch5meC9jY3lfcGFpcl9yYXRlX3NlcnZpY2UucHJvdG8SAmZ4GhVpbnRlcm9w\",\n            \"L29wdGlvbnMucHJvdG8iMAoHQ2N5UGFpchIVCg1jY3lfcGFpcl9uYW1lGAEg\",\n            \"ASgJOg6S2wQKZnguQ2N5UGFpciJGCgtDY3lQYWlyUmF0ZRIVCg1jY3lfcGFp\",\n            \"cl9uYW1lGAEgASgJEgwKBHJhdGUYAiABKAE6EpLbBA5meC5DY3lQYWlyUmF0\",\n            \"ZTJYChJDY3lQYWlyUmF0ZVNlcnZpY2USJwoHR2V0UmF0ZRILLmZ4LkNjeVBh\",\n            \"aXIaDy5meC5DY3lQYWlyUmF0ZRoZktsEFWZ4LkNjeVBhaXJSYXRlU2Vydmlj\",\n            \"ZUI1qgIyUGxleHVzLkludGVyb3AuU2FtcGxlcy5DY3lQYWlyUmF0ZVZpZXdl\",\n            \"ci5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair), global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair.Parser, new[]{ \"CcyPairName\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate), global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate.Parser, new[]{ \"CcyPairName\", \"Rate\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class CcyPair : pb::IMessage<CcyPair> {\n    private static readonly pb::MessageParser<CcyPair> _parser = new pb::MessageParser<CcyPair>(() => new CcyPair());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<CcyPair> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRateServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair(CcyPair other) : this() {\n      ccyPairName_ = other.ccyPairName_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPair Clone() {\n      return new CcyPair(this);\n    }\n\n    /// <summary>Field number for the \"ccy_pair_name\" field.</summary>\n    public const int CcyPairNameFieldNumber = 1;\n    private string ccyPairName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string CcyPairName {\n      get { return ccyPairName_; }\n      set {\n        ccyPairName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as CcyPair);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(CcyPair other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (CcyPairName != other.CcyPairName) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (CcyPairName.Length != 0) hash ^= CcyPairName.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (CcyPairName.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(CcyPairName);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (CcyPairName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(CcyPairName);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(CcyPair other) {\n      if (other == null) {\n        return;\n      }\n      if (other.CcyPairName.Length != 0) {\n        CcyPairName = other.CcyPairName;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            CcyPairName = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  public sealed partial class CcyPairRate : pb::IMessage<CcyPairRate> {\n    private static readonly pb::MessageParser<CcyPairRate> _parser = new pb::MessageParser<CcyPairRate>(() => new CcyPairRate());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<CcyPairRate> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRateServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate(CcyPairRate other) : this() {\n      ccyPairName_ = other.ccyPairName_;\n      rate_ = other.rate_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public CcyPairRate Clone() {\n      return new CcyPairRate(this);\n    }\n\n    /// <summary>Field number for the \"ccy_pair_name\" field.</summary>\n    public const int CcyPairNameFieldNumber = 1;\n    private string ccyPairName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string CcyPairName {\n      get { return ccyPairName_; }\n      set {\n        ccyPairName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"rate\" field.</summary>\n    public const int RateFieldNumber = 2;\n    private double rate_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public double Rate {\n      get { return rate_; }\n      set {\n        rate_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as CcyPairRate);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(CcyPairRate other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (CcyPairName != other.CcyPairName) return false;\n      if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Rate, other.Rate)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (CcyPairName.Length != 0) hash ^= CcyPairName.GetHashCode();\n      if (Rate != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Rate);\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (CcyPairName.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(CcyPairName);\n      }\n      if (Rate != 0D) {\n        output.WriteRawTag(17);\n        output.WriteDouble(Rate);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (CcyPairName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(CcyPairName);\n      }\n      if (Rate != 0D) {\n        size += 1 + 8;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(CcyPairRate other) {\n      if (other == null) {\n        return;\n      }\n      if (other.CcyPairName.Length != 0) {\n        CcyPairName = other.CcyPairName;\n      }\n      if (other.Rate != 0D) {\n        Rate = other.Rate;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            CcyPairName = input.ReadString();\n            break;\n          }\n          case 17: {\n            Rate = input.ReadDouble();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Generated/fx/CcyPairRateService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: fx\\ccy_pair_rate_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.CcyPairRateViewer.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class CcyPairRateService {\n\t\t\n\t\tpublic const string Id = \"fx.CcyPairRateService\";\t\t\t\n\t\tpublic const string GetRateMethodId = \"GetRate\";\n\t\t\n\t\tpublic static readonly CcyPairRateService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static CcyPairRateService.Descriptor CreateDescriptor() {\n\t\t\treturn new CcyPairRateService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static CcyPairRateService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new CcyPairRateService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IGetRateProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetRateImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate> GetRateMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tGetRateMethod = Method.Unary<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate>(Id, GetRateMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tGetRateMethod = Method.Unary<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair, global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate>(Id, alias, GetRateMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.CcyPairRateViewer.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  public static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUI1qgIyUGxleHVzLkludGVyb3AuU2FtcGxlcy5DY3lQYWlyUmF0ZVZpZXdl\",\n            \"ci5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { pbr::FileDescriptor.DescriptorProtoFileDescriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null));\n    }\n    #endregion\n\n  }\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Generated/vendor_b/fx/CcyPairRateViewer.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: vendor_b\\fx\\ccy_pair_rate_viewer.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.CcyPairRateViewer.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface ICcyPairRateViewerClient: IClient {\n\t\tCcyPairRateViewerClient.ICcyPairRateServiceProxy CcyPairRateService { get; }\n\t}\n\t\n\tpublic sealed partial class CcyPairRateViewerClient: ClientBase, ICcyPairRateViewerClient {\n\t\t\n\t\tpublic const string Id = \"vendor_b.fx.CcyPairRateViewer\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t}\n\t\t\n\t\tpublic CcyPairRateViewerClient(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t{ \n\t\t\tCcyPairRateService = new CcyPairRateViewerClient.CcyPairRateServiceProxy(this.CallInvoker);\n\t\t}\n\t\t\n\t\tpublic partial interface ICcyPairRateServiceProxy:\n\t\t\tglobal::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRateService.IGetRateProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class CcyPairRateServiceProxy: ICcyPairRateServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRateService.Descriptor Descriptor = global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRateService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic CcyPairRateServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPairRate> GetRate(global::Plexus.Interop.Samples.CcyPairRateViewer.Generated.CcyPair request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetRateMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ICcyPairRateServiceProxy CcyPairRateService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Plexus.Interop.Samples.CcyPairRateViewer.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' != ''\">\n    <TargetFramework>net45</TargetFramework>\n    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <TargetFramework>netcoreapp2.1</TargetFramework>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    \n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PlatformTarget>x86</PlatformTarget>\n\n    <ArtifactsDir>../../../bin/$(RuntimeIdentifier)/</ArtifactsDir>\n    <SamplesDir>$(ArtifactsDir)samples/quick-start/</SamplesDir>\n    <PublishDir>$(SamplesDir)apps/CcyPairRateViewer/</PublishDir>    \n\n    <AssemblyName>CcyPairRateViewer</AssemblyName>\n\n    <IsPackable>false</IsPackable>\n    \n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Channels\\Plexus.Channels.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"CcyPairRateViewer.cmd\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Target Name=\"PublishAfterBuild\" AfterTargets=\"Build\" DependsOnTargets=\"Publish\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Program.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Samples.CcyPairRateViewer\n{\n    using Plexus.Interop.Samples.CcyPairRateViewer.Generated;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    public sealed class Program\n    {\n        public static void Main(string[] args)\n        {\n            new Program().MainAsync(args).GetAwaiter().GetResult();\n        }\n\n        public async Task MainAsync(string[] args)\n        {\n            // Read broker working dir specified either in the first\n            // command line argument or in environment variable, \n            // or just use current working directory.\n            var brokerWorkingDir = args.Length > 0\n                ? args[0]\n                : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n\n            // Creating client and connecting to broker\n            Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n            var client = new CcyPairRateViewerClient(setup => setup.WithBrokerWorkingDir(brokerWorkingDir));\n            await client.ConnectAsync();\n            Console.WriteLine(\"Connected\");\n\n            while (true)\n            {\n                Console.Write(\"Enter currency pair (e.g. \\\"EURUSD\\\") or press Enter to exit: \");\n                var ccyPairName = Console.ReadLine();\n                if (string.IsNullOrEmpty(ccyPairName))\n                {\n                    break;\n                }\n                // Requesting ccy pair rate from another app\n                var request = new CcyPair { CcyPairName = ccyPairName };\n                var response = await client.CcyPairRateService.GetRate(request);\n                Console.WriteLine(\"Response received: \" + response);\n            }\n\n            Console.WriteLine(\"Disconnecting\");\n            await client.DisconnectAsync();\n            Console.WriteLine(\"Disconnected\");\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Plexus.Interop.Samples.GreetingClient\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\apps\\\\CcyPairRateViewer\\\\CcyPairRateViewer.exe\",\n      \"workingDirectory\": \"$(SamplesDir)\"\n    }\n  }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Generate.cmd",
    "content": "REM Generate code from GreetingClient interop definitions\n\nset PLEXUS_GEN_PATH=..\\..\\..\\bin\\win-x86\\sdk\\plexusgen.jar\nset INTEROP_METADATA_PATH=..\\..\\..\\samples\\greeting\\registry\nif not defined NUGET_PACKAGES (\n  set NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\nset PROTOC_PATH=%NUGET_PACKAGES%\\google.protobuf.tools\\3.6.1\\tools\\windows_x86\\protoc.exe\n\nset INTEROP_MANIFEST_PATH=greeting_client.interop\nset CSHARP_NAMESPACE=internal_access:Plexus.Interop.Samples.GreetingClient.Generated\nset CSHARP_OUT=Generated\n\njava -jar %PLEXUS_GEN_PATH% --baseDir=%INTEROP_METADATA_PATH% --input=%INTEROP_MANIFEST_PATH% --type=csharp --out=%CSHARP_OUT% --namespace=%CSHARP_NAMESPACE% --protoc=%PROTOC_PATH%"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.GreetingClient.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  internal static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIyqgIvUGxleHVzLkludGVyb3AuU2FtcGxlcy5HcmVldGluZ0NsaWVudC5H\",\n            \"ZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { pbr::FileDescriptor.DescriptorProtoFileDescriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null));\n    }\n    #endregion\n\n  }\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Generated/interop/samples/GreetingClient.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_client.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.GreetingClient.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tinternal partial interface IGreetingClient: IClient {\n\t\tGreetingClient.IGreetingServiceProxy GreetingService { get; }\n\t}\n\t\n\tinternal sealed partial class GreetingClient: ClientBase, IGreetingClient {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingClient\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t}\n\t\t\n\t\tpublic GreetingClient(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t{ \n\t\t\tGreetingService = new GreetingClient.GreetingServiceProxy(this.CallInvoker);\n\t\t}\n\t\t\n\t\tpublic partial interface IGreetingServiceProxy:\n\t\t\tglobal::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.IUnaryProxy,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.IServerStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.IClientStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.IDuplexStreamingProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class GreetingServiceProxy: IGreetingServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.Descriptor Descriptor = global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic GreetingServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.UnaryMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ServerStreaming(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ServerStreamingMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IClientStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ClientStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ClientStreamingMethod);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDuplexStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> DuplexStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.DuplexStreamingMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IGreetingServiceProxy GreetingService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Generated/interop/samples/GreetingService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/samples/greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.GreetingClient.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/samples/greeting_service.proto</summary>\n  internal static partial class GreetingServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/samples/greeting_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static GreetingServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL3NhbXBsZXMvZ3JlZXRpbmdfc2VydmljZS5wcm90bxIPaW50\",\n            \"ZXJvcC5zYW1wbGVzGhVpbnRlcm9wL29wdGlvbnMucHJvdG8iRAoPR3JlZXRp\",\n            \"bmdSZXF1ZXN0EgwKBG5hbWUYASABKAk6I5LbBB9pbnRlcm9wLnNhbXBsZXMu\",\n            \"R3JlZXRpbmdSZXF1ZXN0IkoKEEdyZWV0aW5nUmVzcG9uc2USEAoIZ3JlZXRp\",\n            \"bmcYASABKAk6JJLbBCBpbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdSZXNwb25z\",\n            \"ZTKUAwoPR3JlZXRpbmdTZXJ2aWNlEkwKBVVuYXJ5EiAuaW50ZXJvcC5zYW1w\",\n            \"bGVzLkdyZWV0aW5nUmVxdWVzdBohLmludGVyb3Auc2FtcGxlcy5HcmVldGlu\",\n            \"Z1Jlc3BvbnNlElgKD1NlcnZlclN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZTABElgKD0NsaWVudFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBEloKD0R1cGxleFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBMAEaI5LbBB9pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdTZXJ2\",\n            \"aWNlQjKqAi9QbGV4dXMuSW50ZXJvcC5TYW1wbGVzLkdyZWV0aW5nQ2xpZW50\",\n            \"LkdlbmVyYXRlZGIGcHJvdG8z\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Samples.GreetingClient.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest), global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest.Parser, new[]{ \"Name\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse), global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse.Parser, new[]{ \"Greeting\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class GreetingRequest : pb::IMessage<GreetingRequest> {\n    private static readonly pb::MessageParser<GreetingRequest> _parser = new pb::MessageParser<GreetingRequest>(() => new GreetingRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest(GreetingRequest other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest Clone() {\n      return new GreetingRequest(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  internal sealed partial class GreetingResponse : pb::IMessage<GreetingResponse> {\n    private static readonly pb::MessageParser<GreetingResponse> _parser = new pb::MessageParser<GreetingResponse>(() => new GreetingResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse(GreetingResponse other) : this() {\n      greeting_ = other.greeting_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse Clone() {\n      return new GreetingResponse(this);\n    }\n\n    /// <summary>Field number for the \"greeting\" field.</summary>\n    public const int GreetingFieldNumber = 1;\n    private string greeting_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Greeting {\n      get { return greeting_; }\n      set {\n        greeting_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Greeting != other.Greeting) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Greeting.Length != 0) hash ^= Greeting.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Greeting.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Greeting);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Greeting.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Greeting);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Greeting.Length != 0) {\n        Greeting = other.Greeting;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Greeting = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Generated/interop/samples/GreetingService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.GreetingClient.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class GreetingService {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingService\";\t\t\t\n\t\tpublic const string UnaryMethodId = \"Unary\";\n\t\tpublic const string ServerStreamingMethodId = \"ServerStreaming\";\n\t\tpublic const string ClientStreamingMethodId = \"ClientStreaming\";\n\t\tpublic const string DuplexStreamingMethodId = \"DuplexStreaming\";\n\t\t\n\t\tpublic static readonly GreetingService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor() {\n\t\t\treturn new GreetingService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new GreetingService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IUnaryProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ServerStreaming(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingProxy {\n\t\t\tIClientStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ClientStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingProxy {\n\t\t\tIDuplexStreamingMethodCall<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> DuplexStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IUnaryImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingImpl {\n\t\t\tTask ServerStreaming(global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest request, IWritableChannel<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ClientStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest> requestStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingImpl {\n\t\t\tTask DuplexStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest> requestStream, IWritableChannel<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> UnaryMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ServerStreamingMethod {get; private set; }\n\t\t\tpublic ClientStreamingMethod<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> ClientStreamingMethod {get; private set; }\n\t\t\tpublic DuplexStreamingMethod<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse> DuplexStreamingMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, DuplexStreamingMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, alias, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, alias, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, alias, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingClient.Generated.GreetingResponse>(Id, alias, DuplexStreamingMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/LaunchGreetingClient.cmd",
    "content": "CD %~dp0\nstart /wait %~dp0apps/GreetingClient/GreetingClient.exe"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Plexus.Interop.Samples.GreetingClient.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' != ''\">\n    <TargetFramework>net45</TargetFramework>\n    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <TargetFramework>netcoreapp2.1</TargetFramework>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    \n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PlatformTarget>x86</PlatformTarget>\n\n    <ArtifactsDir>../../../bin/$(RuntimeIdentifier)/</ArtifactsDir>\n    <SamplesDir>$(ArtifactsDir)samples/greeting/</SamplesDir>\n    <PublishDir>$(SamplesDir)apps/GreetingClient/</PublishDir>    \n\n    <AssemblyName>GreetingClient</AssemblyName>\n\n    <IsPackable>false</IsPackable>\n    \n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Channels\\Plexus.Channels.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Target Name=\"PublishAfterBuild\" AfterTargets=\"Build\" DependsOnTargets=\"Publish\">\n    <Copy SourceFiles=\"LaunchGreetingClient.cmd\" DestinationFolder=\"$(SamplesDir)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Program.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Samples.GreetingClient\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Samples.GreetingClient.Generated;\n    using Plexus.Logging.NLog;\n    using System;\n    using System.IO;\n    using System.Linq;\n    using System.Threading.Tasks;\n\n    public sealed class Program\n    {\n        public static async Task Main(string[] args)\n        {\n            using (new LoggingInitializer())\n            {\n                var log = LogManager.GetLogger<Program>();\n                try\n                {\n                    var brokerWorkingDir = args.Length > 0\n                        ? args[0]\n                        : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n                    Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n                    var client = new GreetingClient(x => x.WithBrokerWorkingDir(brokerWorkingDir));\n                    Console.WriteLine(\"Connecting to {0}\", brokerWorkingDir);\n                    await client.ConnectAsync();\n                    Console.WriteLine(\"Connected\");\n                    var nextCase = true;\n                    while (nextCase)\n                    {\n                        Console.WriteLine(\n                            \"> Select next example:\\n\" +\n                            \"> '1': Unary Call\\n\" +\n                            \"> '2': Server Streaming Call\\n\" +\n                            \"> '3': Client Streaming Call\\n\" +\n                            \"> '4': Duplex Streaming Call\\n\" +\n                            \"> '5': Discovery\\n\" +\n                            \"> '0': Disconnect\");\n                        var c = Console.ReadLine();\n                        switch (c)\n                        {\n                            case \"1\":\n                                await UnaryRequestExampleAsync(client);\n                                break;\n                            case \"2\":\n                                await ServerStreamingRequestExampleAsync(client);\n                                break;\n                            case \"3\":\n                                await ClientStreamingRequestExampleAsync(client);\n                                break;\n                            case \"4\":\n                                await DuplexStreamingRequestExampleAsync(client);\n                                break;\n                            case \"5\":\n                                await DiscoveryExampleAsync(client);\n                                break;\n                            case \"0\":\n                                nextCase = false;\n                                break;\n                            default:\n                                Console.WriteLine(\"Unknown command: {0}\", c);\n                                break;\n                        }\n                    }\n                    Console.WriteLine(\"Disconnecting\");\n                    await client.DisconnectAsync();\n                    Console.WriteLine(\"Disconnected\");\n                }\n                catch (Exception ex)\n                {\n                    Console.WriteLine(\n                        \"Program terminated with exception. See log for details. {0}: {1}\",\n                        ex.GetType(),\n                        ex.Message);\n                    log.Error(ex, \"Program terminated with exception\");\n                }\n            }\n            Console.WriteLine(\"> Press any key to exit...\");\n            Console.ReadKey();\n        }\n\n        internal static async Task UnaryRequestExampleAsync(IGreetingClient client)\n        {\n            Console.Write(\"> Enter name to send: \");\n            var name = Console.ReadLine();\n            var request = new GreetingRequest { Name = name };\n            Console.WriteLine(\"Sending: {0}\", name);\n            var response = await client.GreetingService.Unary(request);\n            Console.WriteLine(\"Received: {0}\", response.Greeting);\n        }\n\n        internal static async Task ServerStreamingRequestExampleAsync(IGreetingClient client)\n        {\n            Console.Write(\"> Enter name to send: \");\n            var name = Console.ReadLine();\n            var request = new GreetingRequest { Name = name };\n            Console.WriteLine(\"Sending: {0}\", name);\n            var responseStream = client.GreetingService.ServerStreaming(request).ResponseStream;\n            while (await responseStream.WaitReadAvailableAsync())\n            {\n                while (responseStream.TryRead(out var response))\n                {\n                    Console.WriteLine(\"Received: {0}\", response.Greeting);                    \n                }\n            }\n            Console.WriteLine(\"Server stream completed\");\n        }\n\n        internal static async Task ClientStreamingRequestExampleAsync(IGreetingClient client)\n        {\n            Console.WriteLine(\"Calling client streaming\");\n            var call = client.GreetingService.ClientStreaming();\n            var requestStream = call.RequestStream;\n            while (true)\n            {\n                Console.Write(\"> Enter next name to send\\n> or empty line to complete request stream: \");\n                var name = Console.ReadLine();\n                if (string.IsNullOrEmpty(name))\n                {\n                    break;\n                }\n                var request = new GreetingRequest {Name = name};\n                Console.WriteLine(\"Sending: {0}\", name);\n                await requestStream.WriteAsync(request);\n            }\n            Console.WriteLine(\"Completing request stream\");\n            requestStream.TryComplete();\n            var response = await call.ResponseAsync;\n            Console.WriteLine(\"Received response: {0}\", response.Greeting);\n        }\n\n        internal static async Task DuplexStreamingRequestExampleAsync(IGreetingClient client)\n        {\n            Console.WriteLine(\"Calling duplex streaming\");\n            var call = client.GreetingService.DuplexStreaming();\n            var requestStream = call.RequestStream;\n            var responseStream = call.ResponseStream;\n            var response = await responseStream.ReadAsync();\n            Console.WriteLine(\"Received: {0}\", response.Greeting);\n            while (true)\n            {\n                Console.Write(\"> Enter next name to send\\n> or empty line to complete request stream: \");\n                var name = Console.ReadLine();\n                if (string.IsNullOrEmpty(name))\n                {\n                    break;\n                }\n                var request = new GreetingRequest { Name = name };\n                Console.WriteLine(\"Sending: {0}\", name);\n                await requestStream.WriteAsync(request);\n                response = await responseStream.ReadAsync();\n                Console.WriteLine(\"Received: {0}\", response.Greeting);                \n            }\n            Console.WriteLine(\"Completing request stream\");\n            requestStream.TryComplete();\n            while (await responseStream.WaitReadAvailableAsync())\n            {\n                while (responseStream.TryRead(out response))\n                {\n                    Console.WriteLine(\"Received: {0}\", response.Greeting);\n                }\n            }\n            Console.WriteLine(\"Response stream completed\");\n        }\n\n        internal static async Task DiscoveryExampleAsync(IGreetingClient client)\n        {            \n            Console.WriteLine(\"Calling discovery for method {0}\", GreetingService.DefaultDescriptor.UnaryMethod);\n            var discoveredProviders = (await client.DiscoveryInvoker.DiscoverAsync(GreetingService.DefaultDescriptor.UnaryMethod)).ToArray();\n            Console.WriteLine(\"Discovered {0} actions:\", discoveredProviders.Length);\n            for (var i=0; i<discoveredProviders.Length; i++)\n            {                       \n                Console.WriteLine(\"  {0}: {1} ({2})\", i, discoveredProviders[i].Title, discoveredProviders[i].ProvidedMethod.ProvidedService.ApplicationId);\n            }            \n            while (true)\n            {\n                Console.WriteLine(\"> Please choose which one to invoke\\n> or empty line to skip invocation: \");\n                var s = Console.ReadLine();\n                if (string.IsNullOrEmpty(s))\n                {\n                    break;\n                }\n                if (!int.TryParse(s, out var index) || index < 0 || index > discoveredProviders.Length)\n                {\n                    Console.WriteLine(\"Invalid input. Please try again.\");\n                }\n                var provider = discoveredProviders[index];\n                Console.WriteLine(\"Invoking {0} ({1})\", provider.Title, provider.ProvidedMethod.ProvidedService.ApplicationId);\n                Console.Write(\"> Enter name to send: \");\n                var name = Console.ReadLine();\n                var request = new GreetingRequest { Name = name };\n                Console.WriteLine(\"Sending: {0}\", name);\n                var response = await client.CallInvoker.Call(provider, request);\n                Console.WriteLine(\"Received: {0}\", response.Greeting);\n                break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Plexus.Interop.Samples.GreetingClient\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\LaunchGreetingClient.cmd\",\n      \"workingDirectory\": \"$(SamplesDir)\"\n    }\n  }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingClient/nlog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"false\">\n\n  <extensions>\n    <add assembly=\"Plexus.Logging.NLog\"/>\n  </extensions>\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception:${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${workDir}/logs/\"/>\n\n  <targets async=\"true\">\n    <target xsi:type=\"File\"\n            name=\"FileTarget\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/GreetingClient.log\"\n            keepFileOpen=\"false\"\n            archiveFileName=\"${logsDir}/GreetingClient.{##}.log\"\n            archiveNumbering=\"Sequence\"\n            archiveAboveSize=\"2097152\"\n            maxArchiveFiles=\"5\"\n            />\n  </targets>\n  <rules>\n    <logger name=\"*\" writeTo=\"FileTarget\" minlevel=\"Debug\" />    \n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Generate.cmd",
    "content": "REM Generate code from GreetingServer interop definitions\n\nset PLEXUS_GEN_PATH=..\\..\\..\\bin\\win-x86\\sdk\\plexusgen.jar\nset INTEROP_METADATA_PATH=..\\..\\..\\samples\\greeting\\registry\nif not defined NUGET_PACKAGES (\n  set NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages\n)\nset PROTOC_PATH=%NUGET_PACKAGES%\\google.protobuf.tools\\3.6.1\\tools\\windows_x86\\protoc.exe\n\nset INTEROP_MANIFEST_PATH=greeting_server.interop\nset CSHARP_NAMESPACE=internal_access:Plexus.Interop.Samples.GreetingServer.Generated\nset CSHARP_OUT=Generated\n\njava -jar %PLEXUS_GEN_PATH% --baseDir=%INTEROP_METADATA_PATH% --input=%INTEROP_MANIFEST_PATH% --type=csharp --out=%CSHARP_OUT% --namespace=%CSHARP_NAMESPACE% --protoc=%PROTOC_PATH%"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.GreetingServer.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  internal static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIyqgIvUGxleHVzLkludGVyb3AuU2FtcGxlcy5HcmVldGluZ1NlcnZlci5H\",\n            \"ZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { pbr::FileDescriptor.DescriptorProtoFileDescriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null));\n    }\n    #endregion\n\n  }\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Generated/interop/samples/GreetingServer.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_server.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.GreetingServer.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tinternal partial interface IGreetingServerClient: IClient {\n\t}\n\t\n\tinternal sealed partial class GreetingServerClient: ClientBase, IGreetingServerClient {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingServer\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(GreetingServerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic GreetingServerClient(\n\t\t\tGreetingServerClient.IGreetingServiceImpl greetingService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new GreetingServerClient.ServiceBinder(\n\t\t\tgreetingService\n\t\t), setup) { }\n\t\t\n\t\tpublic GreetingServerClient(GreetingServerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tGreetingServerClient.IGreetingServiceImpl greetingService\n\t\t\t) {\n\t\t\t\t_greetingServiceBinder = new GreetingServerClient.GreetingServiceBinder(greetingService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate GreetingServiceBinder _greetingServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _greetingServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface IGreetingServiceImpl:\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IUnaryImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IServerStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IClientStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IDuplexStreamingImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class GreetingServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IGreetingServiceImpl _impl;\n\t\t\t\n\t\t\tpublic GreetingServiceBinder(IGreetingServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.UnaryMethodId, _impl.Unary);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.ServerStreamingMethodId, _impl.ServerStreaming);\n\t\t\t\tbuilder = builder.WithClientStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.ClientStreamingMethodId, _impl.ClientStreaming);\n\t\t\t\tbuilder = builder.WithDuplexStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.DuplexStreamingMethodId, _impl.DuplexStreaming);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class GreetingServiceImpl: IGreetingServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> _unaryHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> _serverStreamingHandler;\n\t\t\tprivate readonly ClientStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> _clientStreamingHandler;\n\t\t\tprivate readonly DuplexStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> _duplexStreamingHandler;\n\t\t\t\n\t\t\tpublic GreetingServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> unaryHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> serverStreamingHandler,\n\t\t\t\tClientStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> clientStreamingHandler,\n\t\t\t\tDuplexStreamingMethodHandler<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> duplexStreamingHandler\n\t\t\t) {\n\t\t\t\t_unaryHandler = unaryHandler;\n\t\t\t\t_serverStreamingHandler = serverStreamingHandler;\n\t\t\t\t_clientStreamingHandler = clientStreamingHandler;\n\t\t\t\t_duplexStreamingHandler = duplexStreamingHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, MethodCallContext context) {\n\t\t\t\treturn _unaryHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ServerStreaming(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context) {\n\t\t\t\treturn _serverStreamingHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ClientStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, MethodCallContext context) {\n\t\t\t\treturn _clientStreamingHandler(requestStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task DuplexStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context) {\n\t\t\t\treturn _duplexStreamingHandler(requestStream, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class GreetingServiceImpl<T>: IGreetingServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IUnaryImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IServerStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IClientStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Samples.GreetingServer.Generated.GreetingService.IDuplexStreamingImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic GreetingServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.Unary(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ServerStreaming(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.ServerStreaming(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ClientStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, MethodCallContext context) {\n\t\t\t\treturn _impl.ClientStreaming(requestStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task DuplexStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.DuplexStreaming(requestStream, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Generated/interop/samples/GreetingService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/samples/greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Samples.GreetingServer.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/samples/greeting_service.proto</summary>\n  internal static partial class GreetingServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/samples/greeting_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static GreetingServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL3NhbXBsZXMvZ3JlZXRpbmdfc2VydmljZS5wcm90bxIPaW50\",\n            \"ZXJvcC5zYW1wbGVzGhVpbnRlcm9wL29wdGlvbnMucHJvdG8iRAoPR3JlZXRp\",\n            \"bmdSZXF1ZXN0EgwKBG5hbWUYASABKAk6I5LbBB9pbnRlcm9wLnNhbXBsZXMu\",\n            \"R3JlZXRpbmdSZXF1ZXN0IkoKEEdyZWV0aW5nUmVzcG9uc2USEAoIZ3JlZXRp\",\n            \"bmcYASABKAk6JJLbBCBpbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdSZXNwb25z\",\n            \"ZTKUAwoPR3JlZXRpbmdTZXJ2aWNlEkwKBVVuYXJ5EiAuaW50ZXJvcC5zYW1w\",\n            \"bGVzLkdyZWV0aW5nUmVxdWVzdBohLmludGVyb3Auc2FtcGxlcy5HcmVldGlu\",\n            \"Z1Jlc3BvbnNlElgKD1NlcnZlclN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZTABElgKD0NsaWVudFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBEloKD0R1cGxleFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBMAEaI5LbBB9pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdTZXJ2\",\n            \"aWNlQjKqAi9QbGV4dXMuSW50ZXJvcC5TYW1wbGVzLkdyZWV0aW5nU2VydmVy\",\n            \"LkdlbmVyYXRlZGIGcHJvdG8z\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Samples.GreetingServer.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest), global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest.Parser, new[]{ \"Name\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse), global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse.Parser, new[]{ \"Greeting\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  internal sealed partial class GreetingRequest : pb::IMessage<GreetingRequest> {\n    private static readonly pb::MessageParser<GreetingRequest> _parser = new pb::MessageParser<GreetingRequest>(() => new GreetingRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest(GreetingRequest other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest Clone() {\n      return new GreetingRequest(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  internal sealed partial class GreetingResponse : pb::IMessage<GreetingResponse> {\n    private static readonly pb::MessageParser<GreetingResponse> _parser = new pb::MessageParser<GreetingResponse>(() => new GreetingResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse(GreetingResponse other) : this() {\n      greeting_ = other.greeting_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse Clone() {\n      return new GreetingResponse(this);\n    }\n\n    /// <summary>Field number for the \"greeting\" field.</summary>\n    public const int GreetingFieldNumber = 1;\n    private string greeting_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Greeting {\n      get { return greeting_; }\n      set {\n        greeting_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Greeting != other.Greeting) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Greeting.Length != 0) hash ^= Greeting.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Greeting.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Greeting);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Greeting.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Greeting);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Greeting.Length != 0) {\n        Greeting = other.Greeting;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Greeting = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Generated/interop/samples/GreetingService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Samples.GreetingServer.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tinternal static partial class GreetingService {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingService\";\t\t\t\n\t\tpublic const string UnaryMethodId = \"Unary\";\n\t\tpublic const string ServerStreamingMethodId = \"ServerStreaming\";\n\t\tpublic const string ClientStreamingMethodId = \"ClientStreaming\";\n\t\tpublic const string DuplexStreamingMethodId = \"DuplexStreaming\";\n\t\t\n\t\tpublic static readonly GreetingService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor() {\n\t\t\treturn new GreetingService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new GreetingService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IUnaryProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ServerStreaming(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingProxy {\n\t\t\tIClientStreamingMethodCall<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ClientStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingProxy {\n\t\t\tIDuplexStreamingMethodCall<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> DuplexStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IUnaryImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> Unary(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingImpl {\n\t\t\tTask ServerStreaming(global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest request, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingImpl {\n\t\t\tTask<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ClientStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingImpl {\n\t\t\tTask DuplexStreaming(IReadableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest> requestStream, IWritableChannel<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> UnaryMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ServerStreamingMethod {get; private set; }\n\t\t\tpublic ClientStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> ClientStreamingMethod {get; private set; }\n\t\t\tpublic DuplexStreamingMethod<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse> DuplexStreamingMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, DuplexStreamingMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, alias, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, alias, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, alias, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingRequest, global::Plexus.Interop.Samples.GreetingServer.Generated.GreetingResponse>(Id, alias, DuplexStreamingMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/LaunchGreetingServer.cmd",
    "content": "CD %~dp0\nstart /wait %~dp0apps/GreetingServer/GreetingServer.exe"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Plexus.Interop.Samples.GreetingServer.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' != ''\">\n    <TargetFramework>net45</TargetFramework>\n    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <TargetFramework>netcoreapp2.1</TargetFramework>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n\n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PlatformTarget>x86</PlatformTarget>\n\n    <ArtifactsDir>../../../bin/$(RuntimeIdentifier)/</ArtifactsDir>\n    <SamplesDir>$(ArtifactsDir)samples/greeting/</SamplesDir>\n    <PublishDir>$(SamplesDir)apps/GreetingServer/</PublishDir>\n\n    <AssemblyName>GreetingServer</AssemblyName>\n\n    <IsPackable>false</IsPackable>\n    \n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Channels\\Plexus.Channels.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Target Name=\"PublishAfterBuild\" AfterTargets=\"Build\" DependsOnTargets=\"Publish\">\n    <Copy SourceFiles=\"LaunchGreetingServer.cmd\" DestinationFolder=\"$(SamplesDir)\" />\n  </Target>\n  \n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Program.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Samples.GreetingServer\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Samples.GreetingServer.Generated;\n    using Plexus.Logging.NLog;\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    internal sealed class Program : GreetingServerClient.IGreetingServiceImpl\n    {\n        public static async Task Main(string[] args)\n        {\n            using (new LoggingInitializer())\n            {\n                var log = LogManager.GetLogger<Program>();\n                try\n                {\n                    var brokerWorkingDir = args.Length > 0\n                        ? args[0]\n                        : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n                    Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n                    var client = new GreetingServerClient(new Program(), x => x.WithBrokerWorkingDir(brokerWorkingDir));\n                    Console.CancelKeyPress += (sender, eventArgs) =>\n                    {\n                        eventArgs.Cancel = true;\n                        Console.WriteLine(\"Disconnecting\");\n                        client.Disconnect();\n                    };\n                    await client.ConnectAsync().ConfigureAwait(false);\n                    Console.WriteLine(\"Connected\");\n                    await client.Completion;\n                    Console.WriteLine(\"Disconnected\");\n                }\n                catch (Exception ex)\n                {\n                    Console.WriteLine(\"Program terminated with exception. See log for details. {0}: {1}\", ex.GetType(),\n                        ex.Message);\n                    log.Error(ex, \"Program terminated with exception\");\n                }\n            }\n            Console.WriteLine(\"Press any key to exit...\");\n            Console.ReadKey();\n        }\n\n        public Task<GreetingResponse> Unary(GreetingRequest request, MethodCallContext context)\n        {\n            Console.WriteLine(\"Received unary request from {{{0}}}\", context);\n            Console.WriteLine(\"Received: {0}\", request.Name);\n            var greeting = $\"Hello, {request.Name}! This is .NET app.\";\n            Console.WriteLine(\"Sending response: {0}\", greeting);\n            return Task.FromResult(new GreetingResponse { Greeting = greeting });\n        }\n\n        public async Task ServerStreaming(GreetingRequest request, IWritableChannel<GreetingResponse> responseStream, MethodCallContext context)\n        {\n            Console.WriteLine(\"Received server streaming request from {{{0}}}\", context);\n            Console.WriteLine(\"Received: {0}\", request.Name);\n            var greeting = $\"Hello, {request.Name}!\";\n            await responseStream\n                .WriteAsync(new GreetingResponse { Greeting = greeting })\n                .ConfigureAwait(false);\n            Console.WriteLine(\"Sent: {0}\", greeting);\n            await Task.Delay(500).ConfigureAwait(false);\n            greeting = $\"Hello again, {request.Name}!\";\n            await responseStream\n                .WriteAsync(new GreetingResponse { Greeting = greeting })\n                .ConfigureAwait(false);\n            Console.WriteLine(\"Sent: {0}\", greeting);\n            Console.WriteLine(\"Completed\");\n        }\n\n        public async Task<GreetingResponse> ClientStreaming(IReadableChannel<GreetingRequest> requestStream, MethodCallContext context)\n        {\n            Console.WriteLine(\"Received client streaming request from {{{0}}}\", context);\n            var names = new List<string>();\n            while (await requestStream.WaitReadAvailableAsync().ConfigureAwait(false))\n            {\n                while (requestStream.TryRead(out var request))\n                {\n                    Console.WriteLine(\"Received: {0}\", request.Name);\n                    names.Add(request.Name);\n                }\n            }\n            Console.WriteLine(\"Request stream completed\");\n            var greeting = $\"Hello, {string.Join(\", \", names)}!\";\n            Console.WriteLine(\"Sending response: {0}\", greeting);\n            return new GreetingResponse { Greeting = greeting };\n        }\n        \n        public async Task DuplexStreaming(IReadableChannel<GreetingRequest> requestStream, IWritableChannel<GreetingResponse> responseStream, MethodCallContext context)\n        {\n            Console.WriteLine(\"Received duplex streaming request from {{{0}}}\", context);\n            var greeting = \"Hello!\";\n            await responseStream.WriteAsync(new GreetingResponse { Greeting = greeting }).ConfigureAwait(false);\n            Console.WriteLine(\"Sent: {0}\", greeting);\n            while (await requestStream.WaitReadAvailableAsync().ConfigureAwait(false))\n            {\n                while (requestStream.TryRead(out var request))\n                {\n                    Console.WriteLine(\"Received: {0}\", request.Name);\n                    greeting = $\"Hello, {request.Name}!\";\n                    await responseStream\n                        .WriteAsync(new GreetingResponse { Greeting = greeting })\n                        .ConfigureAwait(false);\n                    Console.WriteLine(\"Sent: {0}\", greeting);\n                }\n            }\n            Console.WriteLine(\"Request stream completed\");\n            greeting = \"Good Bye!\";\n            await responseStream\n                .WriteAsync(new GreetingResponse { Greeting = greeting })\n                .ConfigureAwait(false);\n            Console.WriteLine(\"Sent: {0}\", greeting);\n            greeting = \"See you again!\";\n            await responseStream\n                .WriteAsync(new GreetingResponse { Greeting = greeting })\n                .ConfigureAwait(false);\n            Console.WriteLine(\"Sent: {0}\", greeting);\n            Console.WriteLine(\"Completed\");\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Plexus.Interop.Samples.GreetingServer\": {\n      \"commandName\": \"Executable\",\n      \"executablePath\": \".\\\\LaunchGreetingServer.cmd\",\n      \"workingDirectory\": \"$(SamplesDir)\"\n    }\n  }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.GreetingServer/nlog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"false\">\n\n  <extensions>\n    <add assembly=\"Plexus.Logging.NLog\"/>\n  </extensions>\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception:${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${workDir}/logs/\"/>\n\n  <targets async=\"true\">\n    <target xsi:type=\"File\"\n            name=\"FileTarget\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/GreetingServer.log\"\n            keepFileOpen=\"false\"\n            archiveFileName=\"${logsDir}/GreetingServer.{##}.log\"\n            archiveNumbering=\"Sequence\"\n            archiveAboveSize=\"2097152\"\n            maxArchiveFiles=\"5\"\n            />\n  </targets>\n  <rules>\n    <logger name=\"*\" writeTo=\"FileTarget\" minlevel=\"Debug\" />    \n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Samples.Metadata/Plexus.Interop.Samples.Metadata.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n\n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PlatformTarget>x86</PlatformTarget>\n\n    <RepoRootDir>../../../</RepoRootDir>\n    <ArtifactsDir>$(RepoRootDir)bin/$(RuntimeIdentifier)/</ArtifactsDir>\n    <ArtifactsSamplesDir>$(ArtifactsDir)samples/greeting/</ArtifactsSamplesDir>\n    <ArtifactsQuickStartDir>$(ArtifactsDir)samples/quick-start/</ArtifactsQuickStartDir>\n\n    <IsPackable>false</IsPackable>\n\n  </PropertyGroup>\n\n  <ItemGroup>\n    <None Include=\"$(RepoRootDir)samples/**/*.*\" />    \n  </ItemGroup>\n\n  <ItemGroup>\n    <SamplesMetadata Include=\"$(RepoRootDir)samples/greeting/metadata/**/*.*\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <SamplesRegistry Include=\"$(RepoRootDir)samples/greeting/registry/**/*.*\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <QuickStartMetadata Include=\"$(RepoRootDir)samples/quick-start/metadata/**/*.*\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <QuickStartRegistry Include=\"$(RepoRootDir)samples/quick-start/registry/**/*.*\" />\n  </ItemGroup>\n  \n  <Target Name=\"PublishOnBuild\" DependsOnTargets=\"CoreBuild\" BeforeTargets=\"AfterBuild\">\n    <Copy SourceFiles=\"@(SamplesMetadata)\" DestinationFolder=\"$(ArtifactsSamplesDir)metadata/%(RecursiveDir)\" />\n    <Copy SourceFiles=\"@(SamplesRegistry)\" DestinationFolder=\"$(ArtifactsSamplesDir)registry/%(RecursiveDir)\" />\n\n    <Copy SourceFiles=\"@(QuickStartMetadata)\" DestinationFolder=\"$(ArtifactsQuickStartDir)metadata/%(RecursiveDir)\" />\n    <Copy SourceFiles=\"@(QuickStartRegistry)\" DestinationFolder=\"$(ArtifactsQuickStartDir)registry/%(RecursiveDir)\" />\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generate.cmd",
    "content": "call plexus gen-json-meta -b ..\\..\\..\\dsl\\interop-lang\\src\\main\\resources -o TestBrokerConfig\\metadata --verbose\ncall plexus gen-csharp -b ..\\..\\..\\dsl\\interop-lang\\src\\main\\resources -o Generated -i {echo_client.interop,echo_server.interop,test_app_launcher.interop} -n Plexus.Interop.Testing.Generated --verbose"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppConnectionDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_connection_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_connection_descriptor.proto</summary>\n  public static partial class AppConnectionDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_connection_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppConnectionDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0b3IucHJvdG8SB2lu\",\n            \"dGVyb3AaF2ludGVyb3AvdW5pcXVlX2lkLnByb3RvGhVpbnRlcm9wL29wdGlv\",\n            \"bnMucHJvdG8i1AEKF0FwcENvbm5lY3Rpb25EZXNjcmlwdG9yEigKDWNvbm5l\",\n            \"Y3Rpb25faWQYASABKAsyES5pbnRlcm9wLlVuaXF1ZUlkEg4KBmFwcF9pZBgC\",\n            \"IAEoCRIqCg9hcHBfaW5zdGFuY2VfaWQYAyABKAsyES5pbnRlcm9wLlVuaXF1\",\n            \"ZUlkEi4KDnRyYW5zcG9ydF90eXBlGAQgASgOMhYuaW50ZXJvcC5UcmFuc3Bv\",\n            \"cnRUeXBlOiOS2wQfaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcio3\",\n            \"Cg1UcmFuc3BvcnRUeXBlEgsKB1Vua25vd24QABIICgRQaXBlEAESBgoCV3MQ\",\n            \"AhIHCgNXc3MQA0IjqgIgUGxleHVzLkludGVyb3AuVGVzdGluZy5HZW5lcmF0\",\n            \"ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Testing.Generated.TransportType), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor), global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor.Parser, new[]{ \"ConnectionId\", \"AppId\", \"AppInstanceId\", \"TransportType\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  public enum TransportType {\n    [pbr::OriginalName(\"Unknown\")] Unknown = 0,\n    [pbr::OriginalName(\"Pipe\")] Pipe = 1,\n    [pbr::OriginalName(\"Ws\")] Ws = 2,\n    [pbr::OriginalName(\"Wss\")] Wss = 3,\n  }\n\n  #endregion\n\n  #region Messages\n  public sealed partial class AppConnectionDescriptor : pb::IMessage<AppConnectionDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionDescriptor> _parser = new pb::MessageParser<AppConnectionDescriptor>(() => new AppConnectionDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppConnectionDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor(AppConnectionDescriptor other) : this() {\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      appId_ = other.appId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      transportType_ = other.transportType_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionDescriptor Clone() {\n      return new AppConnectionDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 2;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"transport_type\" field.</summary>\n    public const int TransportTypeFieldNumber = 4;\n    private global::Plexus.Interop.Testing.Generated.TransportType transportType_ = global::Plexus.Interop.Testing.Generated.TransportType.Unknown;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.TransportType TransportType {\n      get { return transportType_; }\n      set {\n        transportType_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      if (AppId != other.AppId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (TransportType != other.TransportType) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (TransportType != global::Plexus.Interop.Testing.Generated.TransportType.Unknown) hash ^= TransportType.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Testing.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Testing.Generated.TransportType.Unknown) {\n        output.WriteRawTag(32);\n        output.WriteEnum((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (TransportType != global::Plexus.Interop.Testing.Generated.TransportType.Unknown) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TransportType);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.TransportType != global::Plexus.Interop.Testing.Generated.TransportType.Unknown) {\n        TransportType = other.TransportType;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Interop.Testing.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n          case 18: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 26: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 32: {\n            TransportType = (global::Plexus.Interop.Testing.Generated.TransportType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppLaunchMode.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_launch_mode.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_launch_mode.proto</summary>\n  public static partial class AppLaunchModeReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_launch_mode.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLaunchModeReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch1pbnRlcm9wL2FwcF9sYXVuY2hfbW9kZS5wcm90bxIHaW50ZXJvcBoVaW50\",\n            \"ZXJvcC9vcHRpb25zLnByb3RvKjgKDUFwcExhdW5jaE1vZGUSEwoPU0lOR0xF\",\n            \"X0lOU1RBTkNFEAASEgoOTVVMVElfSU5TVEFOQ0UQAUIjqgIgUGxleHVzLklu\",\n            \"dGVyb3AuVGVzdGluZy5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Testing.Generated.AppLaunchMode), }, null, null));\n    }\n    #endregion\n\n  }\n  #region Enums\n  public enum AppLaunchMode {\n    [pbr::OriginalName(\"SINGLE_INSTANCE\")] SingleInstance = 0,\n    [pbr::OriginalName(\"MULTI_INSTANCE\")] MultiInstance = 1,\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppLauncherService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_launcher_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_launcher_service.proto</summary>\n  public static partial class AppLauncherServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_launcher_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLauncherServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiJpbnRlcm9wL2FwcF9sYXVuY2hlcl9zZXJ2aWNlLnByb3RvEgdpbnRlcm9w\",\n            \"Ghtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aF2ludGVyb3AvdW5pcXVl\",\n            \"X2lkLnByb3RvGh1pbnRlcm9wL2FwcF9sYXVuY2hfbW9kZS5wcm90bxoVaW50\",\n            \"ZXJvcC9vcHRpb25zLnByb3RvIu0BChBBcHBMYXVuY2hSZXF1ZXN0Eg4KBmFw\",\n            \"cF9pZBgBIAEoCRIaChJsYXVuY2hfcGFyYW1zX2pzb24YAiABKAkSKwoLbGF1\",\n            \"bmNoX21vZGUYAyABKA4yFi5pbnRlcm9wLkFwcExhdW5jaE1vZGUSNAoZc3Vn\",\n            \"Z2VzdGVkX2FwcF9pbnN0YW5jZV9pZBgEIAEoCzIRLmludGVyb3AuVW5pcXVl\",\n            \"SWQSLAoIcmVmZXJyZXIYBSABKAsyGi5pbnRlcm9wLkFwcExhdW5jaFJlZmVy\",\n            \"cmVyOhyS2wQYaW50ZXJvcC5BcHBMYXVuY2hSZXF1ZXN0IpgBChFBcHBMYXVu\",\n            \"Y2hSZWZlcnJlchIOCgZhcHBfaWQYASABKAkSKgoPYXBwX2luc3RhbmNlX2lk\",\n            \"GAIgASgLMhEuaW50ZXJvcC5VbmlxdWVJZBIoCg1jb25uZWN0aW9uX2lkGAMg\",\n            \"ASgLMhEuaW50ZXJvcC5VbmlxdWVJZDodktsEGWludGVyb3AuQXBwTGF1bmNo\",\n            \"UmVmZXJyZXIiXgoRQXBwTGF1bmNoUmVzcG9uc2USKgoPYXBwX2luc3RhbmNl\",\n            \"X2lkGAEgASgLMhEuaW50ZXJvcC5VbmlxdWVJZDodktsEGWludGVyb3AuQXBw\",\n            \"TGF1bmNoUmVzcG9uc2UimwEKEEFwcExhdW5jaGVkRXZlbnQSKgoPYXBwX2lu\",\n            \"c3RhbmNlX2lkGAEgASgLMhEuaW50ZXJvcC5VbmlxdWVJZBIPCgdhcHBfaWRz\",\n            \"GAIgAygJEiwKCHJlZmVycmVyGAMgASgLMhouaW50ZXJvcC5BcHBMYXVuY2hS\",\n            \"ZWZlcnJlcjocktsEGGludGVyb3AuQXBwTGF1bmNoZWRFdmVudDLEAQoSQXBw\",\n            \"TGF1bmNoZXJTZXJ2aWNlEj8KBkxhdW5jaBIZLmludGVyb3AuQXBwTGF1bmNo\",\n            \"UmVxdWVzdBoaLmludGVyb3AuQXBwTGF1bmNoUmVzcG9uc2USTQoWQXBwTGF1\",\n            \"bmNoZWRFdmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoZLmlu\",\n            \"dGVyb3AuQXBwTGF1bmNoZWRFdmVudDABGh6S2wQaaW50ZXJvcC5BcHBMYXVu\",\n            \"Y2hlclNlcnZpY2VCI6oCIFBsZXh1cy5JbnRlcm9wLlRlc3RpbmcuR2VuZXJh\",\n            \"dGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppLaunchRequest), global::Plexus.Interop.Testing.Generated.AppLaunchRequest.Parser, new[]{ \"AppId\", \"LaunchParamsJson\", \"LaunchMode\", \"SuggestedAppInstanceId\", \"Referrer\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppLaunchReferrer), global::Plexus.Interop.Testing.Generated.AppLaunchReferrer.Parser, new[]{ \"AppId\", \"AppInstanceId\", \"ConnectionId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppLaunchResponse), global::Plexus.Interop.Testing.Generated.AppLaunchResponse.Parser, new[]{ \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppLaunchedEvent), global::Plexus.Interop.Testing.Generated.AppLaunchedEvent.Parser, new[]{ \"AppInstanceId\", \"AppIds\", \"Referrer\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class AppLaunchRequest : pb::IMessage<AppLaunchRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchRequest> _parser = new pb::MessageParser<AppLaunchRequest>(() => new AppLaunchRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest(AppLaunchRequest other) : this() {\n      appId_ = other.appId_;\n      launchParamsJson_ = other.launchParamsJson_;\n      launchMode_ = other.launchMode_;\n      suggestedAppInstanceId_ = other.suggestedAppInstanceId_ != null ? other.suggestedAppInstanceId_.Clone() : null;\n      referrer_ = other.referrer_ != null ? other.referrer_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchRequest Clone() {\n      return new AppLaunchRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_params_json\" field.</summary>\n    public const int LaunchParamsJsonFieldNumber = 2;\n    private string launchParamsJson_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string LaunchParamsJson {\n      get { return launchParamsJson_; }\n      set {\n        launchParamsJson_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_mode\" field.</summary>\n    public const int LaunchModeFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.AppLaunchMode launchMode_ = global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppLaunchMode LaunchMode {\n      get { return launchMode_; }\n      set {\n        launchMode_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"suggested_app_instance_id\" field.</summary>\n    public const int SuggestedAppInstanceIdFieldNumber = 4;\n    private global::Plexus.Interop.Testing.Generated.UniqueId suggestedAppInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId SuggestedAppInstanceId {\n      get { return suggestedAppInstanceId_; }\n      set {\n        suggestedAppInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"referrer\" field.</summary>\n    public const int ReferrerFieldNumber = 5;\n    private global::Plexus.Interop.Testing.Generated.AppLaunchReferrer referrer_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppLaunchReferrer Referrer {\n      get { return referrer_; }\n      set {\n        referrer_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (LaunchParamsJson != other.LaunchParamsJson) return false;\n      if (LaunchMode != other.LaunchMode) return false;\n      if (!object.Equals(SuggestedAppInstanceId, other.SuggestedAppInstanceId)) return false;\n      if (!object.Equals(Referrer, other.Referrer)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (LaunchParamsJson.Length != 0) hash ^= LaunchParamsJson.GetHashCode();\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) hash ^= LaunchMode.GetHashCode();\n      if (suggestedAppInstanceId_ != null) hash ^= SuggestedAppInstanceId.GetHashCode();\n      if (referrer_ != null) hash ^= Referrer.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (LaunchParamsJson.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(LaunchParamsJson);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LaunchMode);\n      }\n      if (suggestedAppInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(SuggestedAppInstanceId);\n      }\n      if (referrer_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Referrer);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.LaunchParamsJson.Length != 0) {\n        LaunchParamsJson = other.LaunchParamsJson;\n      }\n      if (other.LaunchMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        LaunchMode = other.LaunchMode;\n      }\n      if (other.suggestedAppInstanceId_ != null) {\n        if (suggestedAppInstanceId_ == null) {\n          SuggestedAppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        SuggestedAppInstanceId.MergeFrom(other.SuggestedAppInstanceId);\n      }\n      if (other.referrer_ != null) {\n        if (referrer_ == null) {\n          Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n        }\n        Referrer.MergeFrom(other.Referrer);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            LaunchParamsJson = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Testing.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 34: {\n            if (suggestedAppInstanceId_ == null) {\n              SuggestedAppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(SuggestedAppInstanceId);\n            break;\n          }\n          case 42: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            LaunchParamsJson = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Testing.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 34: {\n            if (suggestedAppInstanceId_ == null) {\n              SuggestedAppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(SuggestedAppInstanceId);\n            break;\n          }\n          case 42: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppLaunchReferrer : pb::IMessage<AppLaunchReferrer>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchReferrer> _parser = new pb::MessageParser<AppLaunchReferrer>(() => new AppLaunchReferrer());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchReferrer> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer(AppLaunchReferrer other) : this() {\n      appId_ = other.appId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchReferrer Clone() {\n      return new AppLaunchReferrer(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchReferrer);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchReferrer other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchReferrer other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppLaunchResponse : pb::IMessage<AppLaunchResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchResponse> _parser = new pb::MessageParser<AppLaunchResponse>(() => new AppLaunchResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse(AppLaunchResponse other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchResponse Clone() {\n      return new AppLaunchResponse(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppLaunchedEvent : pb::IMessage<AppLaunchedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLaunchedEvent> _parser = new pb::MessageParser<AppLaunchedEvent>(() => new AppLaunchedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLaunchedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLauncherServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent(AppLaunchedEvent other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appIds_ = other.appIds_.Clone();\n      referrer_ = other.referrer_ != null ? other.referrer_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLaunchedEvent Clone() {\n      return new AppLaunchedEvent(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_ids\" field.</summary>\n    public const int AppIdsFieldNumber = 2;\n    private static readonly pb::FieldCodec<string> _repeated_appIds_codec\n        = pb::FieldCodec.ForString(18);\n    private readonly pbc::RepeatedField<string> appIds_ = new pbc::RepeatedField<string>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> AppIds {\n      get { return appIds_; }\n    }\n\n    /// <summary>Field number for the \"referrer\" field.</summary>\n    public const int ReferrerFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.AppLaunchReferrer referrer_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppLaunchReferrer Referrer {\n      get { return referrer_; }\n      set {\n        referrer_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLaunchedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLaunchedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if(!appIds_.Equals(other.appIds_)) return false;\n      if (!object.Equals(Referrer, other.Referrer)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      hash ^= appIds_.GetHashCode();\n      if (referrer_ != null) hash ^= Referrer.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(output, _repeated_appIds_codec);\n      if (referrer_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(ref output, _repeated_appIds_codec);\n      if (referrer_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Referrer);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      size += appIds_.CalculateSize(_repeated_appIds_codec);\n      if (referrer_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Referrer);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLaunchedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      appIds_.Add(other.appIds_);\n      if (other.referrer_ != null) {\n        if (referrer_ == null) {\n          Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n        }\n        Referrer.MergeFrom(other.Referrer);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(ref input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            if (referrer_ == null) {\n              Referrer = new global::Plexus.Interop.Testing.Generated.AppLaunchReferrer();\n            }\n            input.ReadMessage(Referrer);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppLauncherService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_launcher_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class AppLauncherService {\n\t\t\n\t\tpublic const string Id = \"interop.AppLauncherService\";\t\t\t\n\t\tpublic const string LaunchMethodId = \"Launch\";\n\t\tpublic const string AppLaunchedEventStreamMethodId = \"AppLaunchedEventStream\";\n\t\t\n\t\tpublic static readonly AppLauncherService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppLauncherService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppLauncherService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppLauncherService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppLauncherService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface ILaunchProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Testing.Generated.AppLaunchRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLaunchedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface ILaunchImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Testing.Generated.AppLaunchRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppLaunchedEventStreamImpl {\n\t\t\tTask AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse> LaunchMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> AppLaunchedEventStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tLaunchMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse>(Id, LaunchMethodId);\n\t\t\t\tAppLaunchedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent>(Id, AppLaunchedEventStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tLaunchMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse>(Id, alias, LaunchMethodId);\n\t\t\t\tAppLaunchedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent>(Id, alias, AppLaunchedEventStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppLifecycleService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_lifecycle_service.proto</summary>\n  public static partial class AppLifecycleServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_lifecycle_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppLifecycleServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2FwcF9saWZlY3ljbGVfc2VydmljZS5wcm90bxIHaW50ZXJv\",\n            \"cBoXaW50ZXJvcC91bmlxdWVfaWQucHJvdG8aHWludGVyb3AvYXBwX2xhdW5j\",\n            \"aF9tb2RlLnByb3RvGidpbnRlcm9wL2FwcF9jb25uZWN0aW9uX2Rlc2NyaXB0\",\n            \"b3IucHJvdG8aI2ludGVyb3AvaW52b2NhdGlvbl9kZXNjcmlwdG9yLnByb3Rv\",\n            \"Ghtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aFWludGVyb3Avb3B0aW9u\",\n            \"cy5wcm90byJ0ChFSZXNvbHZlQXBwUmVxdWVzdBIOCgZhcHBfaWQYASABKAkS\",\n            \"MAoQYXBwX3Jlc29sdmVfbW9kZRgCIAEoDjIWLmludGVyb3AuQXBwTGF1bmNo\",\n            \"TW9kZTodktsEGWludGVyb3AuUmVzb2x2ZUFwcFJlcXVlc3QisAEKElJlc29s\",\n            \"dmVBcHBSZXNwb25zZRIqCg9hcHBfaW5zdGFuY2VfaWQYASABKAsyES5pbnRl\",\n            \"cm9wLlVuaXF1ZUlkEiwKEWFwcF9jb25uZWN0aW9uX2lkGAIgASgLMhEuaW50\",\n            \"ZXJvcC5VbmlxdWVJZBIgChhpc19uZXdfaW5zdGFuY2VfbGF1bmNoZWQYAyAB\",\n            \"KAg6HpLbBBppbnRlcm9wLlJlc29sdmVBcHBSZXNwb25zZSLWAQoRQXBwTGlm\",\n            \"ZWN5Y2xlRXZlbnQSLwoJY29ubmVjdGVkGAEgASgLMhouaW50ZXJvcC5BcHBD\",\n            \"b25uZWN0ZWRFdmVudEgAEjUKDGRpc2Nvbm5lY3RlZBgCIAEoCzIdLmludGVy\",\n            \"b3AuQXBwRGlzY29ubmVjdGVkRXZlbnRIABIxCgVlcnJvchgDIAEoCzIgLmlu\",\n            \"dGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnRIADodktsEGWludGVyb3Au\",\n            \"QXBwTGlmZWN5Y2xlRXZlbnRCBwoFZXZlbnQitwEKD0ludm9jYXRpb25FdmVu\",\n            \"dBI9ChJpbnZvY2F0aW9uX3N0YXJ0ZWQYASABKAsyHy5pbnRlcm9wLkludm9j\",\n            \"YXRpb25TdGFydGVkRXZlbnRIABI/ChNpbnZvY2F0aW9uX2ZpbmlzaGVkGAIg\",\n            \"ASgLMiAuaW50ZXJvcC5JbnZvY2F0aW9uRmluaXNoZWRFdmVudEgAOhuS2wQX\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uRXZlbnRCBwoFZXZlbnQicwoRQXBwQ29ubmVj\",\n            \"dGVkRXZlbnQSPwoVY29ubmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50\",\n            \"ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcjodktsEGWludGVyb3AuQXBw\",\n            \"Q29ubmVjdGVkRXZlbnQieQoUQXBwRGlzY29ubmVjdGVkRXZlbnQSPwoVY29u\",\n            \"bmVjdGlvbl9kZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0\",\n            \"aW9uRGVzY3JpcHRvcjogktsEHGludGVyb3AuQXBwRGlzY29ubmVjdGVkRXZl\",\n            \"bnQifwoXQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQSPwoVY29ubmVjdGlvbl9k\",\n            \"ZXNjcmlwdG9yGAEgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3Jp\",\n            \"cHRvcjojktsEH2ludGVyb3AuQXBwQ29ubmVjdGlvbkVycm9yRXZlbnQiegoW\",\n            \"SW52b2NhdGlvblN0YXJ0ZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0\",\n            \"b3IYASABKAsyHS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yOiKS2wQe\",\n            \"aW50ZXJvcC5JbnZvY2F0aW9uU3RhcnRlZEV2ZW50IrwBChdJbnZvY2F0aW9u\",\n            \"RmluaXNoZWRFdmVudBI8ChVpbnZvY2F0aW9uX2Rlc2NyaXB0b3IYASABKAsy\",\n            \"HS5pbnRlcm9wLkludm9jYXRpb25EZXNjcmlwdG9yEikKBnJlc3VsdBgCIAEo\",\n            \"DjIZLmludGVyb3AuSW52b2NhdGlvblJlc3VsdBITCgtkdXJhdGlvbl9tcxgD\",\n            \"IAEoAzojktsEH2ludGVyb3AuSW52b2NhdGlvbkZpbmlzaGVkRXZlbnQiqAEK\",\n            \"FUdldENvbm5lY3Rpb25zUmVxdWVzdBIWCg5hcHBsaWNhdGlvbl9pZBgBIAEo\",\n            \"CRIqCg9hcHBfaW5zdGFuY2VfaWQYAiABKAsyES5pbnRlcm9wLlVuaXF1ZUlk\",\n            \"EigKDWNvbm5lY3Rpb25faWQYAyABKAsyES5pbnRlcm9wLlVuaXF1ZUlkOiGS\",\n            \"2wQdaW50ZXJvcC5HZXRDb25uZWN0aW9uc1JlcXVlc3QicwoWR2V0Q29ubmVj\",\n            \"dGlvbnNSZXNwb25zZRI1Cgtjb25uZWN0aW9ucxgBIAMoCzIgLmludGVyb3Au\",\n            \"QXBwQ29ubmVjdGlvbkRlc2NyaXB0b3I6IpLbBB5pbnRlcm9wLkdldENvbm5l\",\n            \"Y3Rpb25zUmVzcG9uc2Ui8QEKE0dldENvbm5lY3Rpb25zRXZlbnQSNQoLY29u\",\n            \"bmVjdGlvbnMYASADKAsyIC5pbnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlw\",\n            \"dG9yEjoKDm5ld19jb25uZWN0aW9uGAIgASgLMiAuaW50ZXJvcC5BcHBDb25u\",\n            \"ZWN0aW9uRGVzY3JpcHRvckgAEj0KEWNsb3NlZF9jb25uZWN0aW9uGAMgASgL\",\n            \"MiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvckgAOh+S2wQbaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50QgcKBWV2ZW50KjsKEEludm9jYXRp\",\n            \"b25SZXN1bHQSDQoJU3VjY2VlZGVkEAASDAoIQ2FuY2VsZWQQARIKCgZGYWls\",\n            \"ZWQQAjLJAwoTQXBwTGlmZWN5Y2xlU2VydmljZRJFCgpSZXNvbHZlQXBwEhou\",\n            \"aW50ZXJvcC5SZXNvbHZlQXBwUmVxdWVzdBobLmludGVyb3AuUmVzb2x2ZUFw\",\n            \"cFJlc3BvbnNlEk8KF0dldExpZmVjeWNsZUV2ZW50U3RyZWFtEhYuZ29vZ2xl\",\n            \"LnByb3RvYnVmLkVtcHR5GhouaW50ZXJvcC5BcHBMaWZlY3ljbGVFdmVudDAB\",\n            \"Ek4KGEdldEludm9jYXRpb25FdmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1\",\n            \"Zi5FbXB0eRoYLmludGVyb3AuSW52b2NhdGlvbkV2ZW50MAESUQoOR2V0Q29u\",\n            \"bmVjdGlvbnMSHi5pbnRlcm9wLkdldENvbm5lY3Rpb25zUmVxdWVzdBofLmlu\",\n            \"dGVyb3AuR2V0Q29ubmVjdGlvbnNSZXNwb25zZRJWChRHZXRDb25uZWN0aW9u\",\n            \"c1N0cmVhbRIeLmludGVyb3AuR2V0Q29ubmVjdGlvbnNSZXF1ZXN0GhwuaW50\",\n            \"ZXJvcC5HZXRDb25uZWN0aW9uc0V2ZW50MAEaH5LbBBtpbnRlcm9wLkFwcExp\",\n            \"ZmVjeWNsZVNlcnZpY2VCI6oCIFBsZXh1cy5JbnRlcm9wLlRlc3RpbmcuR2Vu\",\n            \"ZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Testing.Generated.InvocationDescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Testing.Generated.InvocationResult), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ResolveAppRequest), global::Plexus.Interop.Testing.Generated.ResolveAppRequest.Parser, new[]{ \"AppId\", \"AppResolveMode\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ResolveAppResponse), global::Plexus.Interop.Testing.Generated.ResolveAppResponse.Parser, new[]{ \"AppInstanceId\", \"AppConnectionId\", \"IsNewInstanceLaunched\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppLifecycleEvent), global::Plexus.Interop.Testing.Generated.AppLifecycleEvent.Parser, new[]{ \"Connected\", \"Disconnected\", \"Error\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationEvent), global::Plexus.Interop.Testing.Generated.InvocationEvent.Parser, new[]{ \"InvocationStarted\", \"InvocationFinished\" }, new[]{ \"Event\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppConnectedEvent), global::Plexus.Interop.Testing.Generated.AppConnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent), global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent), global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent.Parser, new[]{ \"ConnectionDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationStartedEvent), global::Plexus.Interop.Testing.Generated.InvocationStartedEvent.Parser, new[]{ \"InvocationDescriptor\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent), global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent.Parser, new[]{ \"InvocationDescriptor\", \"Result\", \"DurationMs\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest), global::Plexus.Interop.Testing.Generated.GetConnectionsRequest.Parser, new[]{ \"ApplicationId\", \"AppInstanceId\", \"ConnectionId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.GetConnectionsResponse), global::Plexus.Interop.Testing.Generated.GetConnectionsResponse.Parser, new[]{ \"Connections\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.GetConnectionsEvent), global::Plexus.Interop.Testing.Generated.GetConnectionsEvent.Parser, new[]{ \"Connections\", \"NewConnection\", \"ClosedConnection\" }, new[]{ \"Event\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  public enum InvocationResult {\n    [pbr::OriginalName(\"Succeeded\")] Succeeded = 0,\n    [pbr::OriginalName(\"Canceled\")] Canceled = 1,\n    [pbr::OriginalName(\"Failed\")] Failed = 2,\n  }\n\n  #endregion\n\n  #region Messages\n  public sealed partial class ResolveAppRequest : pb::IMessage<ResolveAppRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppRequest> _parser = new pb::MessageParser<ResolveAppRequest>(() => new ResolveAppRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest(ResolveAppRequest other) : this() {\n      appId_ = other.appId_;\n      appResolveMode_ = other.appResolveMode_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppRequest Clone() {\n      return new ResolveAppRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_id\" field.</summary>\n    public const int AppIdFieldNumber = 1;\n    private string appId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string AppId {\n      get { return appId_; }\n      set {\n        appId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_resolve_mode\" field.</summary>\n    public const int AppResolveModeFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.AppLaunchMode appResolveMode_ = global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppLaunchMode AppResolveMode {\n      get { return appResolveMode_; }\n      set {\n        appResolveMode_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (AppId != other.AppId) return false;\n      if (AppResolveMode != other.AppResolveMode) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (AppId.Length != 0) hash ^= AppId.GetHashCode();\n      if (AppResolveMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) hash ^= AppResolveMode.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (AppId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (AppId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId);\n      }\n      if (AppResolveMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) AppResolveMode);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.AppId.Length != 0) {\n        AppId = other.AppId;\n      }\n      if (other.AppResolveMode != global::Plexus.Interop.Testing.Generated.AppLaunchMode.SingleInstance) {\n        AppResolveMode = other.AppResolveMode;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Interop.Testing.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            AppId = input.ReadString();\n            break;\n          }\n          case 16: {\n            AppResolveMode = (global::Plexus.Interop.Testing.Generated.AppLaunchMode) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ResolveAppResponse : pb::IMessage<ResolveAppResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ResolveAppResponse> _parser = new pb::MessageParser<ResolveAppResponse>(() => new ResolveAppResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ResolveAppResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse(ResolveAppResponse other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appConnectionId_ = other.appConnectionId_ != null ? other.appConnectionId_.Clone() : null;\n      isNewInstanceLaunched_ = other.isNewInstanceLaunched_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ResolveAppResponse Clone() {\n      return new ResolveAppResponse(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_connection_id\" field.</summary>\n    public const int AppConnectionIdFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appConnectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppConnectionId {\n      get { return appConnectionId_; }\n      set {\n        appConnectionId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"is_new_instance_launched\" field.</summary>\n    public const int IsNewInstanceLaunchedFieldNumber = 3;\n    private bool isNewInstanceLaunched_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool IsNewInstanceLaunched {\n      get { return isNewInstanceLaunched_; }\n      set {\n        isNewInstanceLaunched_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ResolveAppResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ResolveAppResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(AppConnectionId, other.AppConnectionId)) return false;\n      if (IsNewInstanceLaunched != other.IsNewInstanceLaunched) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (appConnectionId_ != null) hash ^= AppConnectionId.GetHashCode();\n      if (IsNewInstanceLaunched != false) hash ^= IsNewInstanceLaunched.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        output.WriteRawTag(24);\n        output.WriteBool(IsNewInstanceLaunched);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (appConnectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppConnectionId);\n      }\n      if (IsNewInstanceLaunched != false) {\n        size += 1 + 1;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ResolveAppResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.appConnectionId_ != null) {\n        if (appConnectionId_ == null) {\n          AppConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppConnectionId.MergeFrom(other.AppConnectionId);\n      }\n      if (other.IsNewInstanceLaunched != false) {\n        IsNewInstanceLaunched = other.IsNewInstanceLaunched;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            if (appConnectionId_ == null) {\n              AppConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppConnectionId);\n            break;\n          }\n          case 24: {\n            IsNewInstanceLaunched = input.ReadBool();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppLifecycleEvent : pb::IMessage<AppLifecycleEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppLifecycleEvent> _parser = new pb::MessageParser<AppLifecycleEvent>(() => new AppLifecycleEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppLifecycleEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent(AppLifecycleEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          Connected = other.Connected.Clone();\n          break;\n        case EventOneofCase.Disconnected:\n          Disconnected = other.Disconnected.Clone();\n          break;\n        case EventOneofCase.Error:\n          Error = other.Error.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppLifecycleEvent Clone() {\n      return new AppLifecycleEvent(this);\n    }\n\n    /// <summary>Field number for the \"connected\" field.</summary>\n    public const int ConnectedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectedEvent Connected {\n      get { return eventCase_ == EventOneofCase.Connected ? (global::Plexus.Interop.Testing.Generated.AppConnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Connected;\n      }\n    }\n\n    /// <summary>Field number for the \"disconnected\" field.</summary>\n    public const int DisconnectedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent Disconnected {\n      get { return eventCase_ == EventOneofCase.Disconnected ? (global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Disconnected;\n      }\n    }\n\n    /// <summary>Field number for the \"error\" field.</summary>\n    public const int ErrorFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent Error {\n      get { return eventCase_ == EventOneofCase.Error ? (global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.Error;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      Connected = 1,\n      Disconnected = 2,\n      Error = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppLifecycleEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppLifecycleEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Connected, other.Connected)) return false;\n      if (!object.Equals(Disconnected, other.Disconnected)) return false;\n      if (!object.Equals(Error, other.Error)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.Connected) hash ^= Connected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Disconnected) hash ^= Disconnected.GetHashCode();\n      if (eventCase_ == EventOneofCase.Error) hash ^= Error.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.Connected) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        output.WriteRawTag(26);\n        output.WriteMessage(Error);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.Connected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connected);\n      }\n      if (eventCase_ == EventOneofCase.Disconnected) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Disconnected);\n      }\n      if (eventCase_ == EventOneofCase.Error) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Error);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppLifecycleEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.Connected:\n          if (Connected == null) {\n            Connected = new global::Plexus.Interop.Testing.Generated.AppConnectedEvent();\n          }\n          Connected.MergeFrom(other.Connected);\n          break;\n        case EventOneofCase.Disconnected:\n          if (Disconnected == null) {\n            Disconnected = new global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent();\n          }\n          Disconnected.MergeFrom(other.Disconnected);\n          break;\n        case EventOneofCase.Error:\n          if (Error == null) {\n            Error = new global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent();\n          }\n          Error.MergeFrom(other.Error);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Testing.Generated.AppConnectedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Testing.Generated.AppConnectedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectedEvent();\n            if (eventCase_ == EventOneofCase.Connected) {\n              subBuilder.MergeFrom(Connected);\n            }\n            input.ReadMessage(subBuilder);\n            Connected = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppDisconnectedEvent();\n            if (eventCase_ == EventOneofCase.Disconnected) {\n              subBuilder.MergeFrom(Disconnected);\n            }\n            input.ReadMessage(subBuilder);\n            Disconnected = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionErrorEvent();\n            if (eventCase_ == EventOneofCase.Error) {\n              subBuilder.MergeFrom(Error);\n            }\n            input.ReadMessage(subBuilder);\n            Error = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class InvocationEvent : pb::IMessage<InvocationEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationEvent> _parser = new pb::MessageParser<InvocationEvent>(() => new InvocationEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent(InvocationEvent other) : this() {\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          InvocationStarted = other.InvocationStarted.Clone();\n          break;\n        case EventOneofCase.InvocationFinished:\n          InvocationFinished = other.InvocationFinished.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationEvent Clone() {\n      return new InvocationEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_started\" field.</summary>\n    public const int InvocationStartedFieldNumber = 1;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationStartedEvent InvocationStarted {\n      get { return eventCase_ == EventOneofCase.InvocationStarted ? (global::Plexus.Interop.Testing.Generated.InvocationStartedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationStarted;\n      }\n    }\n\n    /// <summary>Field number for the \"invocation_finished\" field.</summary>\n    public const int InvocationFinishedFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent InvocationFinished {\n      get { return eventCase_ == EventOneofCase.InvocationFinished ? (global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.InvocationFinished;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      InvocationStarted = 1,\n      InvocationFinished = 2,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationStarted, other.InvocationStarted)) return false;\n      if (!object.Equals(InvocationFinished, other.InvocationFinished)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (eventCase_ == EventOneofCase.InvocationStarted) hash ^= InvocationStarted.GetHashCode();\n      if (eventCase_ == EventOneofCase.InvocationFinished) hash ^= InvocationFinished.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        output.WriteRawTag(18);\n        output.WriteMessage(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (eventCase_ == EventOneofCase.InvocationStarted) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationStarted);\n      }\n      if (eventCase_ == EventOneofCase.InvocationFinished) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationFinished);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationEvent other) {\n      if (other == null) {\n        return;\n      }\n      switch (other.EventCase) {\n        case EventOneofCase.InvocationStarted:\n          if (InvocationStarted == null) {\n            InvocationStarted = new global::Plexus.Interop.Testing.Generated.InvocationStartedEvent();\n          }\n          InvocationStarted.MergeFrom(other.InvocationStarted);\n          break;\n        case EventOneofCase.InvocationFinished:\n          if (InvocationFinished == null) {\n            InvocationFinished = new global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent();\n          }\n          InvocationFinished.MergeFrom(other.InvocationFinished);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Testing.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            global::Plexus.Interop.Testing.Generated.InvocationStartedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.InvocationStartedEvent();\n            if (eventCase_ == EventOneofCase.InvocationStarted) {\n              subBuilder.MergeFrom(InvocationStarted);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationStarted = subBuilder;\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent subBuilder = new global::Plexus.Interop.Testing.Generated.InvocationFinishedEvent();\n            if (eventCase_ == EventOneofCase.InvocationFinished) {\n              subBuilder.MergeFrom(InvocationFinished);\n            }\n            input.ReadMessage(subBuilder);\n            InvocationFinished = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppConnectedEvent : pb::IMessage<AppConnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectedEvent> _parser = new pb::MessageParser<AppConnectedEvent>(() => new AppConnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent(AppConnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectedEvent Clone() {\n      return new AppConnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppDisconnectedEvent : pb::IMessage<AppDisconnectedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppDisconnectedEvent> _parser = new pb::MessageParser<AppDisconnectedEvent>(() => new AppDisconnectedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppDisconnectedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent(AppDisconnectedEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppDisconnectedEvent Clone() {\n      return new AppDisconnectedEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppDisconnectedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppDisconnectedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppDisconnectedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppConnectionErrorEvent : pb::IMessage<AppConnectionErrorEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppConnectionErrorEvent> _parser = new pb::MessageParser<AppConnectionErrorEvent>(() => new AppConnectionErrorEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppConnectionErrorEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent(AppConnectionErrorEvent other) : this() {\n      connectionDescriptor_ = other.connectionDescriptor_ != null ? other.connectionDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppConnectionErrorEvent Clone() {\n      return new AppConnectionErrorEvent(this);\n    }\n\n    /// <summary>Field number for the \"connection_descriptor\" field.</summary>\n    public const int ConnectionDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor connectionDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor ConnectionDescriptor {\n      get { return connectionDescriptor_; }\n      set {\n        connectionDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppConnectionErrorEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppConnectionErrorEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(ConnectionDescriptor, other.ConnectionDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (connectionDescriptor_ != null) hash ^= ConnectionDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (connectionDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (connectionDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppConnectionErrorEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.connectionDescriptor_ != null) {\n        if (connectionDescriptor_ == null) {\n          ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        ConnectionDescriptor.MergeFrom(other.ConnectionDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (connectionDescriptor_ == null) {\n              ConnectionDescriptor = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(ConnectionDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class InvocationStartedEvent : pb::IMessage<InvocationStartedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationStartedEvent> _parser = new pb::MessageParser<InvocationStartedEvent>(() => new InvocationStartedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationStartedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent(InvocationStartedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationStartedEvent Clone() {\n      return new InvocationStartedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationStartedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationStartedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationStartedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class InvocationFinishedEvent : pb::IMessage<InvocationFinishedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationFinishedEvent> _parser = new pb::MessageParser<InvocationFinishedEvent>(() => new InvocationFinishedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationFinishedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent(InvocationFinishedEvent other) : this() {\n      invocationDescriptor_ = other.invocationDescriptor_ != null ? other.invocationDescriptor_.Clone() : null;\n      result_ = other.result_;\n      durationMs_ = other.durationMs_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationFinishedEvent Clone() {\n      return new InvocationFinishedEvent(this);\n    }\n\n    /// <summary>Field number for the \"invocation_descriptor\" field.</summary>\n    public const int InvocationDescriptorFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.InvocationDescriptor invocationDescriptor_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationDescriptor InvocationDescriptor {\n      get { return invocationDescriptor_; }\n      set {\n        invocationDescriptor_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"result\" field.</summary>\n    public const int ResultFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.InvocationResult result_ = global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationResult Result {\n      get { return result_; }\n      set {\n        result_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"duration_ms\" field.</summary>\n    public const int DurationMsFieldNumber = 3;\n    private long durationMs_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public long DurationMs {\n      get { return durationMs_; }\n      set {\n        durationMs_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationFinishedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationFinishedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(InvocationDescriptor, other.InvocationDescriptor)) return false;\n      if (Result != other.Result) return false;\n      if (DurationMs != other.DurationMs) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (invocationDescriptor_ != null) hash ^= InvocationDescriptor.GetHashCode();\n      if (Result != global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded) hash ^= Result.GetHashCode();\n      if (DurationMs != 0L) hash ^= DurationMs.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (invocationDescriptor_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded) {\n        output.WriteRawTag(16);\n        output.WriteEnum((int) Result);\n      }\n      if (DurationMs != 0L) {\n        output.WriteRawTag(24);\n        output.WriteInt64(DurationMs);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (invocationDescriptor_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(InvocationDescriptor);\n      }\n      if (Result != global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result);\n      }\n      if (DurationMs != 0L) {\n        size += 1 + pb::CodedOutputStream.ComputeInt64Size(DurationMs);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationFinishedEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.invocationDescriptor_ != null) {\n        if (invocationDescriptor_ == null) {\n          InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n        }\n        InvocationDescriptor.MergeFrom(other.InvocationDescriptor);\n      }\n      if (other.Result != global::Plexus.Interop.Testing.Generated.InvocationResult.Succeeded) {\n        Result = other.Result;\n      }\n      if (other.DurationMs != 0L) {\n        DurationMs = other.DurationMs;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Interop.Testing.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (invocationDescriptor_ == null) {\n              InvocationDescriptor = new global::Plexus.Interop.Testing.Generated.InvocationDescriptor();\n            }\n            input.ReadMessage(InvocationDescriptor);\n            break;\n          }\n          case 16: {\n            Result = (global::Plexus.Interop.Testing.Generated.InvocationResult) input.ReadEnum();\n            break;\n          }\n          case 24: {\n            DurationMs = input.ReadInt64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class GetConnectionsRequest : pb::IMessage<GetConnectionsRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsRequest> _parser = new pb::MessageParser<GetConnectionsRequest>(() => new GetConnectionsRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest(GetConnectionsRequest other) : this() {\n      applicationId_ = other.applicationId_;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      connectionId_ = other.connectionId_ != null ? other.connectionId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsRequest Clone() {\n      return new GetConnectionsRequest(this);\n    }\n\n    /// <summary>Field number for the \"application_id\" field.</summary>\n    public const int ApplicationIdFieldNumber = 1;\n    private string applicationId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ApplicationId {\n      get { return applicationId_; }\n      set {\n        applicationId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"connection_id\" field.</summary>\n    public const int ConnectionIdFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.UniqueId connectionId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId ConnectionId {\n      get { return connectionId_; }\n      set {\n        connectionId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ApplicationId != other.ApplicationId) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if (!object.Equals(ConnectionId, other.ConnectionId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ApplicationId.Length != 0) hash ^= ApplicationId.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (connectionId_ != null) hash ^= ConnectionId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ApplicationId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ApplicationId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ApplicationId);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (connectionId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ApplicationId.Length != 0) {\n        ApplicationId = other.ApplicationId;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      if (other.connectionId_ != null) {\n        if (connectionId_ == null) {\n          ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        ConnectionId.MergeFrom(other.ConnectionId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ApplicationId = input.ReadString();\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 26: {\n            if (connectionId_ == null) {\n              ConnectionId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(ConnectionId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class GetConnectionsResponse : pb::IMessage<GetConnectionsResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsResponse> _parser = new pb::MessageParser<GetConnectionsResponse>(() => new GetConnectionsResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse(GetConnectionsResponse other) : this() {\n      connections_ = other.connections_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsResponse Clone() {\n      return new GetConnectionsResponse(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsResponse other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class GetConnectionsEvent : pb::IMessage<GetConnectionsEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GetConnectionsEvent> _parser = new pb::MessageParser<GetConnectionsEvent>(() => new GetConnectionsEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GetConnectionsEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppLifecycleServiceReflection.Descriptor.MessageTypes[11]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent(GetConnectionsEvent other) : this() {\n      connections_ = other.connections_.Clone();\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          NewConnection = other.NewConnection.Clone();\n          break;\n        case EventOneofCase.ClosedConnection:\n          ClosedConnection = other.ClosedConnection.Clone();\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GetConnectionsEvent Clone() {\n      return new GetConnectionsEvent(this);\n    }\n\n    /// <summary>Field number for the \"connections\" field.</summary>\n    public const int ConnectionsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> _repeated_connections_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> connections_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> Connections {\n      get { return connections_; }\n    }\n\n    /// <summary>Field number for the \"new_connection\" field.</summary>\n    public const int NewConnectionFieldNumber = 2;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor NewConnection {\n      get { return eventCase_ == EventOneofCase.NewConnection ? (global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.NewConnection;\n      }\n    }\n\n    /// <summary>Field number for the \"closed_connection\" field.</summary>\n    public const int ClosedConnectionFieldNumber = 3;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor ClosedConnection {\n      get { return eventCase_ == EventOneofCase.ClosedConnection ? (global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor) event_ : null; }\n      set {\n        event_ = value;\n        eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.ClosedConnection;\n      }\n    }\n\n    private object event_;\n    /// <summary>Enum of possible cases for the \"event\" oneof.</summary>\n    public enum EventOneofCase {\n      None = 0,\n      NewConnection = 2,\n      ClosedConnection = 3,\n    }\n    private EventOneofCase eventCase_ = EventOneofCase.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EventOneofCase EventCase {\n      get { return eventCase_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void ClearEvent() {\n      eventCase_ = EventOneofCase.None;\n      event_ = null;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GetConnectionsEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GetConnectionsEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!connections_.Equals(other.connections_)) return false;\n      if (!object.Equals(NewConnection, other.NewConnection)) return false;\n      if (!object.Equals(ClosedConnection, other.ClosedConnection)) return false;\n      if (EventCase != other.EventCase) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= connections_.GetHashCode();\n      if (eventCase_ == EventOneofCase.NewConnection) hash ^= NewConnection.GetHashCode();\n      if (eventCase_ == EventOneofCase.ClosedConnection) hash ^= ClosedConnection.GetHashCode();\n      hash ^= (int) eventCase_;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      connections_.WriteTo(output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      connections_.WriteTo(ref output, _repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        output.WriteRawTag(18);\n        output.WriteMessage(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        output.WriteRawTag(26);\n        output.WriteMessage(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += connections_.CalculateSize(_repeated_connections_codec);\n      if (eventCase_ == EventOneofCase.NewConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(NewConnection);\n      }\n      if (eventCase_ == EventOneofCase.ClosedConnection) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClosedConnection);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GetConnectionsEvent other) {\n      if (other == null) {\n        return;\n      }\n      connections_.Add(other.connections_);\n      switch (other.EventCase) {\n        case EventOneofCase.NewConnection:\n          if (NewConnection == null) {\n            NewConnection = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n          }\n          NewConnection.MergeFrom(other.NewConnection);\n          break;\n        case EventOneofCase.ClosedConnection:\n          if (ClosedConnection == null) {\n            ClosedConnection = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n          }\n          ClosedConnection.MergeFrom(other.ClosedConnection);\n          break;\n      }\n\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            connections_.AddEntriesFrom(ref input, _repeated_connections_codec);\n            break;\n          }\n          case 18: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.NewConnection) {\n              subBuilder.MergeFrom(NewConnection);\n            }\n            input.ReadMessage(subBuilder);\n            NewConnection = subBuilder;\n            break;\n          }\n          case 26: {\n            global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor subBuilder = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            if (eventCase_ == EventOneofCase.ClosedConnection) {\n              subBuilder.MergeFrom(ClosedConnection);\n            }\n            input.ReadMessage(subBuilder);\n            ClosedConnection = subBuilder;\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppLifecycleService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_lifecycle_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class AppLifecycleService {\n\t\t\n\t\tpublic const string Id = \"interop.AppLifecycleService\";\t\t\t\n\t\tpublic const string ResolveAppMethodId = \"ResolveApp\";\n\t\tpublic const string GetLifecycleEventStreamMethodId = \"GetLifecycleEventStream\";\n\t\tpublic const string GetInvocationEventStreamMethodId = \"GetInvocationEventStream\";\n\t\tpublic const string GetConnectionsMethodId = \"GetConnections\";\n\t\tpublic const string GetConnectionsStreamMethodId = \"GetConnectionsStream\";\n\t\t\n\t\tpublic static readonly AppLifecycleService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppLifecycleService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppLifecycleService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppLifecycleService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IResolveAppProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Testing.Generated.ResolveAppRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.AppLifecycleEvent> GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.InvocationEvent> GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.GetConnectionsEvent> GetConnectionsStream(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IResolveAppImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.ResolveAppResponse> ResolveApp(global::Plexus.Interop.Testing.Generated.ResolveAppRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLifecycleEventStreamImpl {\n\t\t\tTask GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppLifecycleEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetInvocationEventStreamImpl {\n\t\t\tTask GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.InvocationEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetConnectionsStreamImpl {\n\t\t\tTask GetConnectionsStream(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request, IWritableChannel<global::Plexus.Interop.Testing.Generated.GetConnectionsEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.ResolveAppRequest, global::Plexus.Interop.Testing.Generated.ResolveAppResponse> ResolveAppMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLifecycleEvent> GetLifecycleEventStreamMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.InvocationEvent> GetInvocationEventStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsResponse> GetConnectionsMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsEvent> GetConnectionsStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.ResolveAppRequest, global::Plexus.Interop.Testing.Generated.ResolveAppResponse>(Id, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLifecycleEvent>(Id, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.InvocationEvent>(Id, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsResponse>(Id, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsEvent>(Id, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tResolveAppMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.ResolveAppRequest, global::Plexus.Interop.Testing.Generated.ResolveAppResponse>(Id, alias, ResolveAppMethodId);\n\t\t\t\tGetLifecycleEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLifecycleEvent>(Id, alias, GetLifecycleEventStreamMethodId);\n\t\t\t\tGetInvocationEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.InvocationEvent>(Id, alias, GetInvocationEventStreamMethodId);\n\t\t\t\tGetConnectionsMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsResponse>(Id, alias, GetConnectionsMethodId);\n\t\t\t\tGetConnectionsStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.GetConnectionsRequest, global::Plexus.Interop.Testing.Generated.GetConnectionsEvent>(Id, alias, GetConnectionsStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppMetadataService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_metadata_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_metadata_service.proto</summary>\n  public static partial class AppMetadataServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_metadata_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppMetadataServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiJpbnRlcm9wL2FwcF9tZXRhZGF0YV9zZXJ2aWNlLnByb3RvEgdpbnRlcm9w\",\n            \"GhdpbnRlcm9wL3VuaXF1ZV9pZC5wcm90bxodaW50ZXJvcC9hcHBfbGF1bmNo\",\n            \"X21vZGUucHJvdG8aJ2ludGVyb3AvYXBwX2Nvbm5lY3Rpb25fZGVzY3JpcHRv\",\n            \"ci5wcm90bxojaW50ZXJvcC9pbnZvY2F0aW9uX2Rlc2NyaXB0b3IucHJvdG8a\",\n            \"G2dvb2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90bxoVaW50ZXJvcC9vcHRpb25z\",\n            \"LnByb3RvImYKF0FwcE1ldGFkYXRhQ2hhbmdlZEV2ZW50EiYKBGFwcHMYASAD\",\n            \"KAsyGC5pbnRlcm9wLkFwcE1ldGFkYXRhSW5mbzojktsEH2ludGVyb3AuQXBw\",\n            \"TWV0YWRhdGFDaGFuZ2VkRXZlbnQimAEKD0FwcE1ldGFkYXRhSW5mbxIKCgJp\",\n            \"ZBgBIAEoCRIUCgxkaXNwbGF5X25hbWUYAiABKAkSEwoLbGF1bmNoZXJfaWQY\",\n            \"AyABKAkSMQoPbGF1bmNoZXJfcGFyYW1zGAQgAygLMhguaW50ZXJvcC5PcHRp\",\n            \"b25QYXJhbWV0ZXI6G5LbBBdpbnRlcm9wLkFwcE1ldGFkYXRhSW5mbyKPAQoV\",\n            \"TWV0YW1vZGVsQ2hhbmdlZEV2ZW50Ei8KDGFwcGxpY2F0aW9ucxgBIAMoCzIZ\",\n            \"LmludGVyb3AuQXBwTWV0YW1vZGVsSW5mbxIiCghzZXJ2aWNlcxgCIAMoCzIQ\",\n            \"LmludGVyb3AuU2VydmljZTohktsEHWludGVyb3AuTWV0YW1vZGVsQ2hhbmdl\",\n            \"ZEV2ZW50IqYBChBBcHBNZXRhbW9kZWxJbmZvEgoKAmlkGAEgASgJEjMKEWNv\",\n            \"bnN1bWVkX3NlcnZpY2VzGAIgAygLMhguaW50ZXJvcC5Db25zdW1lZFNlcnZp\",\n            \"Y2USMwoRcHJvdmlkZWRfc2VydmljZXMYAyADKAsyGC5pbnRlcm9wLlByb3Zp\",\n            \"ZGVkU2VydmljZTocktsEGGludGVyb3AuQXBwTWV0YW1vZGVsSW5mbyJ7Cg9Q\",\n            \"cm92aWRlZFNlcnZpY2USEgoKc2VydmljZV9pZBgBIAEoCRINCgVhbGlhcxgC\",\n            \"IAEoCRIoCgdtZXRob2RzGAMgAygLMhcuaW50ZXJvcC5Qcm92aWRlZE1ldGhv\",\n            \"ZDobktsEF2ludGVyb3AuUHJvdmlkZWRTZXJ2aWNlInsKD0NvbnN1bWVkU2Vy\",\n            \"dmljZRISCgpzZXJ2aWNlX2lkGAEgASgJEg0KBWFsaWFzGAIgASgJEigKB21l\",\n            \"dGhvZHMYAyADKAsyFy5pbnRlcm9wLkNvbnN1bWVkTWV0aG9kOhuS2wQXaW50\",\n            \"ZXJvcC5Db25zdW1lZFNlcnZpY2UiOgoOQ29uc3VtZWRNZXRob2QSDAoEbmFt\",\n            \"ZRgBIAEoCToaktsEFmludGVyb3AuQ29uc3VtZWRNZXRob2QikgIKDlByb3Zp\",\n            \"ZGVkTWV0aG9kEgwKBG5hbWUYASABKAkSDQoFdGl0bGUYAiABKAkSQAoLbGF1\",\n            \"bmNoX21vZGUYAyABKA4yKy5pbnRlcm9wLlByb3ZpZGVkTWV0aG9kLk1ldGFt\",\n            \"b2RlbExhdW5jaE1vZGUSEgoKdGltZW91dF9tcxgEIAEoBRIpCgdvcHRpb25z\",\n            \"GAUgAygLMhguaW50ZXJvcC5PcHRpb25QYXJhbWV0ZXIiRgoTTWV0YW1vZGVs\",\n            \"TGF1bmNoTW9kZRIICgROb25lEAASEgoOU2luZ2xlSW5zdGFuY2UQARIRCg1N\",\n            \"dWx0aUluc3RhbmNlEAI6GpLbBBZpbnRlcm9wLlByb3ZpZGVkTWV0aG9kInsK\",\n            \"B1NlcnZpY2USCgoCaWQYASABKAkSJAoHbWV0aG9kcxgCIAMoCzITLmludGVy\",\n            \"b3AuTWV0aG9kSW5mbxIpCgdvcHRpb25zGAMgAygLMhguaW50ZXJvcC5PcHRp\",\n            \"b25QYXJhbWV0ZXI6E5LbBA9pbnRlcm9wLlNlcnZpY2Ui8QEKCk1ldGhvZElu\",\n            \"Zm8SDAoEbmFtZRgBIAEoCRIaChJyZXF1ZXN0X21lc3NhZ2VfaWQYAyABKAkS\",\n            \"GwoTcmVzcG9uc2VfbWVzc2FnZV9pZBgEIAEoCRIsCgR0eXBlGAUgASgOMh4u\",\n            \"aW50ZXJvcC5NZXRob2RJbmZvLk1ldGhvZFR5cGUiVgoKTWV0aG9kVHlwZRIJ\",\n            \"CgVVbmFyeRAAEhMKD1NlcnZlclN0cmVhbWluZxABEhMKD0NsaWVudFN0cmVh\",\n            \"bWluZxACEhMKD0R1cGxleFN0cmVhbWluZxADOhaS2wQSaW50ZXJvcC5NZXRo\",\n            \"b2RJbmZvIkoKD09wdGlvblBhcmFtZXRlchILCgNrZXkYASABKAkSDQoFdmFs\",\n            \"dWUYAiABKAk6G5LbBBdpbnRlcm9wLk9wdGlvblBhcmFtZXRlcjLwAQoSQXBw\",\n            \"TWV0YWRhdGFTZXJ2aWNlEl4KIEdldEFwcE1ldGFkYXRhQ2hhbmdlZEV2ZW50\",\n            \"U3RyZWFtEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GiAuaW50ZXJvcC5BcHBN\",\n            \"ZXRhZGF0YUNoYW5nZWRFdmVudDABEloKHkdldE1ldGFtb2RlbENoYW5nZWRF\",\n            \"dmVudFN0cmVhbRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoeLmludGVyb3Au\",\n            \"TWV0YW1vZGVsQ2hhbmdlZEV2ZW50MAEaHpLbBBppbnRlcm9wLkFwcE1ldGFk\",\n            \"YXRhU2VydmljZUIjqgIgUGxleHVzLkludGVyb3AuVGVzdGluZy5HZW5lcmF0\",\n            \"ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppLaunchModeReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Testing.Generated.InvocationDescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent), global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent.Parser, new[]{ \"Apps\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppMetadataInfo), global::Plexus.Interop.Testing.Generated.AppMetadataInfo.Parser, new[]{ \"Id\", \"DisplayName\", \"LauncherId\", \"LauncherParams\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent), global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent.Parser, new[]{ \"Applications\", \"Services\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppMetamodelInfo), global::Plexus.Interop.Testing.Generated.AppMetamodelInfo.Parser, new[]{ \"Id\", \"ConsumedServices\", \"ProvidedServices\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ProvidedService), global::Plexus.Interop.Testing.Generated.ProvidedService.Parser, new[]{ \"ServiceId\", \"Alias\", \"Methods\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ConsumedService), global::Plexus.Interop.Testing.Generated.ConsumedService.Parser, new[]{ \"ServiceId\", \"Alias\", \"Methods\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ConsumedMethod), global::Plexus.Interop.Testing.Generated.ConsumedMethod.Parser, new[]{ \"Name\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ProvidedMethod), global::Plexus.Interop.Testing.Generated.ProvidedMethod.Parser, new[]{ \"Name\", \"Title\", \"LaunchMode\", \"TimeoutMs\", \"Options\" }, null, new[]{ typeof(global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode) }, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.Service), global::Plexus.Interop.Testing.Generated.Service.Parser, new[]{ \"Id\", \"Methods\", \"Options\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.MethodInfo), global::Plexus.Interop.Testing.Generated.MethodInfo.Parser, new[]{ \"Name\", \"RequestMessageId\", \"ResponseMessageId\", \"Type\" }, null, new[]{ typeof(global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType) }, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.OptionParameter), global::Plexus.Interop.Testing.Generated.OptionParameter.Parser, new[]{ \"Key\", \"Value\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class AppMetadataChangedEvent : pb::IMessage<AppMetadataChangedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetadataChangedEvent> _parser = new pb::MessageParser<AppMetadataChangedEvent>(() => new AppMetadataChangedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetadataChangedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent(AppMetadataChangedEvent other) : this() {\n      apps_ = other.apps_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataChangedEvent Clone() {\n      return new AppMetadataChangedEvent(this);\n    }\n\n    /// <summary>Field number for the \"apps\" field.</summary>\n    public const int AppsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppMetadataInfo> _repeated_apps_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.AppMetadataInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetadataInfo> apps_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetadataInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetadataInfo> Apps {\n      get { return apps_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetadataChangedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetadataChangedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!apps_.Equals(other.apps_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= apps_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      apps_.WriteTo(output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      apps_.WriteTo(ref output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += apps_.CalculateSize(_repeated_apps_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetadataChangedEvent other) {\n      if (other == null) {\n        return;\n      }\n      apps_.Add(other.apps_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(ref input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppMetadataInfo : pb::IMessage<AppMetadataInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetadataInfo> _parser = new pb::MessageParser<AppMetadataInfo>(() => new AppMetadataInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetadataInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo(AppMetadataInfo other) : this() {\n      id_ = other.id_;\n      displayName_ = other.displayName_;\n      launcherId_ = other.launcherId_;\n      launcherParams_ = other.launcherParams_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetadataInfo Clone() {\n      return new AppMetadataInfo(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"display_name\" field.</summary>\n    public const int DisplayNameFieldNumber = 2;\n    private string displayName_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string DisplayName {\n      get { return displayName_; }\n      set {\n        displayName_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launcher_id\" field.</summary>\n    public const int LauncherIdFieldNumber = 3;\n    private string launcherId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string LauncherId {\n      get { return launcherId_; }\n      set {\n        launcherId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launcher_params\" field.</summary>\n    public const int LauncherParamsFieldNumber = 4;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.OptionParameter> _repeated_launcherParams_codec\n        = pb::FieldCodec.ForMessage(34, global::Plexus.Interop.Testing.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> launcherParams_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> LauncherParams {\n      get { return launcherParams_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetadataInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetadataInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if (DisplayName != other.DisplayName) return false;\n      if (LauncherId != other.LauncherId) return false;\n      if(!launcherParams_.Equals(other.launcherParams_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      if (DisplayName.Length != 0) hash ^= DisplayName.GetHashCode();\n      if (LauncherId.Length != 0) hash ^= LauncherId.GetHashCode();\n      hash ^= launcherParams_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (DisplayName.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(LauncherId);\n      }\n      launcherParams_.WriteTo(output, _repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (DisplayName.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(LauncherId);\n      }\n      launcherParams_.WriteTo(ref output, _repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      if (DisplayName.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName);\n      }\n      if (LauncherId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(LauncherId);\n      }\n      size += launcherParams_.CalculateSize(_repeated_launcherParams_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetadataInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      if (other.DisplayName.Length != 0) {\n        DisplayName = other.DisplayName;\n      }\n      if (other.LauncherId.Length != 0) {\n        LauncherId = other.LauncherId;\n      }\n      launcherParams_.Add(other.launcherParams_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            DisplayName = input.ReadString();\n            break;\n          }\n          case 26: {\n            LauncherId = input.ReadString();\n            break;\n          }\n          case 34: {\n            launcherParams_.AddEntriesFrom(input, _repeated_launcherParams_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            DisplayName = input.ReadString();\n            break;\n          }\n          case 26: {\n            LauncherId = input.ReadString();\n            break;\n          }\n          case 34: {\n            launcherParams_.AddEntriesFrom(ref input, _repeated_launcherParams_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class MetamodelChangedEvent : pb::IMessage<MetamodelChangedEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<MetamodelChangedEvent> _parser = new pb::MessageParser<MetamodelChangedEvent>(() => new MetamodelChangedEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<MetamodelChangedEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent(MetamodelChangedEvent other) : this() {\n      applications_ = other.applications_.Clone();\n      services_ = other.services_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MetamodelChangedEvent Clone() {\n      return new MetamodelChangedEvent(this);\n    }\n\n    /// <summary>Field number for the \"applications\" field.</summary>\n    public const int ApplicationsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppMetamodelInfo> _repeated_applications_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.AppMetamodelInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetamodelInfo> applications_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetamodelInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppMetamodelInfo> Applications {\n      get { return applications_; }\n    }\n\n    /// <summary>Field number for the \"services\" field.</summary>\n    public const int ServicesFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.Service> _repeated_services_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Testing.Generated.Service.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Service> services_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Service>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Service> Services {\n      get { return services_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as MetamodelChangedEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(MetamodelChangedEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!applications_.Equals(other.applications_)) return false;\n      if(!services_.Equals(other.services_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= applications_.GetHashCode();\n      hash ^= services_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      applications_.WriteTo(output, _repeated_applications_codec);\n      services_.WriteTo(output, _repeated_services_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      applications_.WriteTo(ref output, _repeated_applications_codec);\n      services_.WriteTo(ref output, _repeated_services_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += applications_.CalculateSize(_repeated_applications_codec);\n      size += services_.CalculateSize(_repeated_services_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(MetamodelChangedEvent other) {\n      if (other == null) {\n        return;\n      }\n      applications_.Add(other.applications_);\n      services_.Add(other.services_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            applications_.AddEntriesFrom(input, _repeated_applications_codec);\n            break;\n          }\n          case 18: {\n            services_.AddEntriesFrom(input, _repeated_services_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            applications_.AddEntriesFrom(ref input, _repeated_applications_codec);\n            break;\n          }\n          case 18: {\n            services_.AddEntriesFrom(ref input, _repeated_services_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppMetamodelInfo : pb::IMessage<AppMetamodelInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppMetamodelInfo> _parser = new pb::MessageParser<AppMetamodelInfo>(() => new AppMetamodelInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppMetamodelInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo(AppMetamodelInfo other) : this() {\n      id_ = other.id_;\n      consumedServices_ = other.consumedServices_.Clone();\n      providedServices_ = other.providedServices_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppMetamodelInfo Clone() {\n      return new AppMetamodelInfo(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"consumed_services\" field.</summary>\n    public const int ConsumedServicesFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.ConsumedService> _repeated_consumedServices_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Testing.Generated.ConsumedService.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedService> consumedServices_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedService>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedService> ConsumedServices {\n      get { return consumedServices_; }\n    }\n\n    /// <summary>Field number for the \"provided_services\" field.</summary>\n    public const int ProvidedServicesFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.ProvidedService> _repeated_providedServices_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Testing.Generated.ProvidedService.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedService> providedServices_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedService>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedService> ProvidedServices {\n      get { return providedServices_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppMetamodelInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppMetamodelInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if(!consumedServices_.Equals(other.consumedServices_)) return false;\n      if(!providedServices_.Equals(other.providedServices_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      hash ^= consumedServices_.GetHashCode();\n      hash ^= providedServices_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      consumedServices_.WriteTo(output, _repeated_consumedServices_codec);\n      providedServices_.WriteTo(output, _repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      consumedServices_.WriteTo(ref output, _repeated_consumedServices_codec);\n      providedServices_.WriteTo(ref output, _repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      size += consumedServices_.CalculateSize(_repeated_consumedServices_codec);\n      size += providedServices_.CalculateSize(_repeated_providedServices_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppMetamodelInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      consumedServices_.Add(other.consumedServices_);\n      providedServices_.Add(other.providedServices_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            consumedServices_.AddEntriesFrom(input, _repeated_consumedServices_codec);\n            break;\n          }\n          case 26: {\n            providedServices_.AddEntriesFrom(input, _repeated_providedServices_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            consumedServices_.AddEntriesFrom(ref input, _repeated_consumedServices_codec);\n            break;\n          }\n          case 26: {\n            providedServices_.AddEntriesFrom(ref input, _repeated_providedServices_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ProvidedService : pb::IMessage<ProvidedService>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ProvidedService> _parser = new pb::MessageParser<ProvidedService>(() => new ProvidedService());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ProvidedService> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService(ProvidedService other) : this() {\n      serviceId_ = other.serviceId_;\n      alias_ = other.alias_;\n      methods_ = other.methods_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedService Clone() {\n      return new ProvidedService(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"alias\" field.</summary>\n    public const int AliasFieldNumber = 2;\n    private string alias_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Alias {\n      get { return alias_; }\n      set {\n        alias_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.ProvidedMethod> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Testing.Generated.ProvidedMethod.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedMethod> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedMethod>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ProvidedMethod> Methods {\n      get { return methods_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ProvidedService);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ProvidedService other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (Alias != other.Alias) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (Alias.Length != 0) hash ^= Alias.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Alias);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ProvidedService other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.Alias.Length != 0) {\n        Alias = other.Alias;\n      }\n      methods_.Add(other.methods_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ConsumedService : pb::IMessage<ConsumedService>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ConsumedService> _parser = new pb::MessageParser<ConsumedService>(() => new ConsumedService());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ConsumedService> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService(ConsumedService other) : this() {\n      serviceId_ = other.serviceId_;\n      alias_ = other.alias_;\n      methods_ = other.methods_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedService Clone() {\n      return new ConsumedService(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"alias\" field.</summary>\n    public const int AliasFieldNumber = 2;\n    private string alias_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Alias {\n      get { return alias_; }\n      set {\n        alias_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.ConsumedMethod> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Testing.Generated.ConsumedMethod.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedMethod> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedMethod>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ConsumedMethod> Methods {\n      get { return methods_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ConsumedService);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ConsumedService other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (Alias != other.Alias) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (Alias.Length != 0) hash ^= Alias.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Alias);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (Alias.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Alias);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ConsumedService other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.Alias.Length != 0) {\n        Alias = other.Alias;\n      }\n      methods_.Add(other.methods_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            Alias = input.ReadString();\n            break;\n          }\n          case 26: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ConsumedMethod : pb::IMessage<ConsumedMethod>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ConsumedMethod> _parser = new pb::MessageParser<ConsumedMethod>(() => new ConsumedMethod());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ConsumedMethod> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod(ConsumedMethod other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ConsumedMethod Clone() {\n      return new ConsumedMethod(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ConsumedMethod);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ConsumedMethod other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ConsumedMethod other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ProvidedMethod : pb::IMessage<ProvidedMethod>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ProvidedMethod> _parser = new pb::MessageParser<ProvidedMethod>(() => new ProvidedMethod());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ProvidedMethod> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod(ProvidedMethod other) : this() {\n      name_ = other.name_;\n      title_ = other.title_;\n      launchMode_ = other.launchMode_;\n      timeoutMs_ = other.timeoutMs_;\n      options_ = other.options_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ProvidedMethod Clone() {\n      return new ProvidedMethod(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"title\" field.</summary>\n    public const int TitleFieldNumber = 2;\n    private string title_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Title {\n      get { return title_; }\n      set {\n        title_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"launch_mode\" field.</summary>\n    public const int LaunchModeFieldNumber = 3;\n    private global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode launchMode_ = global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode LaunchMode {\n      get { return launchMode_; }\n      set {\n        launchMode_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"timeout_ms\" field.</summary>\n    public const int TimeoutMsFieldNumber = 4;\n    private int timeoutMs_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int TimeoutMs {\n      get { return timeoutMs_; }\n      set {\n        timeoutMs_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"options\" field.</summary>\n    public const int OptionsFieldNumber = 5;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.OptionParameter> _repeated_options_codec\n        = pb::FieldCodec.ForMessage(42, global::Plexus.Interop.Testing.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> options_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> Options {\n      get { return options_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ProvidedMethod);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ProvidedMethod other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      if (Title != other.Title) return false;\n      if (LaunchMode != other.LaunchMode) return false;\n      if (TimeoutMs != other.TimeoutMs) return false;\n      if(!options_.Equals(other.options_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (Title.Length != 0) hash ^= Title.GetHashCode();\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) hash ^= LaunchMode.GetHashCode();\n      if (TimeoutMs != 0) hash ^= TimeoutMs.GetHashCode();\n      hash ^= options_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (Title.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        output.WriteRawTag(32);\n        output.WriteInt32(TimeoutMs);\n      }\n      options_.WriteTo(output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (Title.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        output.WriteRawTag(24);\n        output.WriteEnum((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        output.WriteRawTag(32);\n        output.WriteInt32(TimeoutMs);\n      }\n      options_.WriteTo(ref output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (Title.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Title);\n      }\n      if (LaunchMode != global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LaunchMode);\n      }\n      if (TimeoutMs != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeInt32Size(TimeoutMs);\n      }\n      size += options_.CalculateSize(_repeated_options_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ProvidedMethod other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      if (other.Title.Length != 0) {\n        Title = other.Title;\n      }\n      if (other.LaunchMode != global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode.None) {\n        LaunchMode = other.LaunchMode;\n      }\n      if (other.TimeoutMs != 0) {\n        TimeoutMs = other.TimeoutMs;\n      }\n      options_.Add(other.options_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 18: {\n            Title = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 32: {\n            TimeoutMs = input.ReadInt32();\n            break;\n          }\n          case 42: {\n            options_.AddEntriesFrom(input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 18: {\n            Title = input.ReadString();\n            break;\n          }\n          case 24: {\n            LaunchMode = (global::Plexus.Interop.Testing.Generated.ProvidedMethod.Types.MetamodelLaunchMode) input.ReadEnum();\n            break;\n          }\n          case 32: {\n            TimeoutMs = input.ReadInt32();\n            break;\n          }\n          case 42: {\n            options_.AddEntriesFrom(ref input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n    #region Nested types\n    /// <summary>Container for nested types declared in the ProvidedMethod message type.</summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static partial class Types {\n      public enum MetamodelLaunchMode {\n        [pbr::OriginalName(\"None\")] None = 0,\n        [pbr::OriginalName(\"SingleInstance\")] SingleInstance = 1,\n        [pbr::OriginalName(\"MultiInstance\")] MultiInstance = 2,\n      }\n\n    }\n    #endregion\n\n  }\n\n  public sealed partial class Service : pb::IMessage<Service>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<Service> _parser = new pb::MessageParser<Service>(() => new Service());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<Service> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service(Service other) : this() {\n      id_ = other.id_;\n      methods_ = other.methods_.Clone();\n      options_ = other.options_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Service Clone() {\n      return new Service(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"methods\" field.</summary>\n    public const int MethodsFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.MethodInfo> _repeated_methods_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Testing.Generated.MethodInfo.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.MethodInfo> methods_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.MethodInfo>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.MethodInfo> Methods {\n      get { return methods_; }\n    }\n\n    /// <summary>Field number for the \"options\" field.</summary>\n    public const int OptionsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.OptionParameter> _repeated_options_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Testing.Generated.OptionParameter.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> options_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.OptionParameter> Options {\n      get { return options_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as Service);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(Service other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if(!methods_.Equals(other.methods_)) return false;\n      if(!options_.Equals(other.options_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      hash ^= methods_.GetHashCode();\n      hash ^= options_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      methods_.WriteTo(output, _repeated_methods_codec);\n      options_.WriteTo(output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      methods_.WriteTo(ref output, _repeated_methods_codec);\n      options_.WriteTo(ref output, _repeated_options_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      size += methods_.CalculateSize(_repeated_methods_codec);\n      size += options_.CalculateSize(_repeated_options_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(Service other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      methods_.Add(other.methods_);\n      options_.Add(other.options_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            methods_.AddEntriesFrom(input, _repeated_methods_codec);\n            break;\n          }\n          case 26: {\n            options_.AddEntriesFrom(input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 18: {\n            methods_.AddEntriesFrom(ref input, _repeated_methods_codec);\n            break;\n          }\n          case 26: {\n            options_.AddEntriesFrom(ref input, _repeated_options_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class MethodInfo : pb::IMessage<MethodInfo>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<MethodInfo> _parser = new pb::MessageParser<MethodInfo>(() => new MethodInfo());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<MethodInfo> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo(MethodInfo other) : this() {\n      name_ = other.name_;\n      requestMessageId_ = other.requestMessageId_;\n      responseMessageId_ = other.responseMessageId_;\n      type_ = other.type_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public MethodInfo Clone() {\n      return new MethodInfo(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"request_message_id\" field.</summary>\n    public const int RequestMessageIdFieldNumber = 3;\n    private string requestMessageId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string RequestMessageId {\n      get { return requestMessageId_; }\n      set {\n        requestMessageId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"response_message_id\" field.</summary>\n    public const int ResponseMessageIdFieldNumber = 4;\n    private string responseMessageId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ResponseMessageId {\n      get { return responseMessageId_; }\n      set {\n        responseMessageId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"type\" field.</summary>\n    public const int TypeFieldNumber = 5;\n    private global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType type_ = global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType Type {\n      get { return type_; }\n      set {\n        type_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as MethodInfo);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(MethodInfo other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      if (RequestMessageId != other.RequestMessageId) return false;\n      if (ResponseMessageId != other.ResponseMessageId) return false;\n      if (Type != other.Type) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (RequestMessageId.Length != 0) hash ^= RequestMessageId.GetHashCode();\n      if (ResponseMessageId.Length != 0) hash ^= ResponseMessageId.GetHashCode();\n      if (Type != global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary) hash ^= Type.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        output.WriteRawTag(34);\n        output.WriteString(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) Type);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        output.WriteRawTag(34);\n        output.WriteString(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) Type);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (RequestMessageId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestMessageId);\n      }\n      if (ResponseMessageId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ResponseMessageId);\n      }\n      if (Type != global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(MethodInfo other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      if (other.RequestMessageId.Length != 0) {\n        RequestMessageId = other.RequestMessageId;\n      }\n      if (other.ResponseMessageId.Length != 0) {\n        ResponseMessageId = other.ResponseMessageId;\n      }\n      if (other.Type != global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType.Unary) {\n        Type = other.Type;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 26: {\n            RequestMessageId = input.ReadString();\n            break;\n          }\n          case 34: {\n            ResponseMessageId = input.ReadString();\n            break;\n          }\n          case 40: {\n            Type = (global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n          case 26: {\n            RequestMessageId = input.ReadString();\n            break;\n          }\n          case 34: {\n            ResponseMessageId = input.ReadString();\n            break;\n          }\n          case 40: {\n            Type = (global::Plexus.Interop.Testing.Generated.MethodInfo.Types.MethodType) input.ReadEnum();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n    #region Nested types\n    /// <summary>Container for nested types declared in the MethodInfo message type.</summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static partial class Types {\n      public enum MethodType {\n        [pbr::OriginalName(\"Unary\")] Unary = 0,\n        [pbr::OriginalName(\"ServerStreaming\")] ServerStreaming = 1,\n        [pbr::OriginalName(\"ClientStreaming\")] ClientStreaming = 2,\n        [pbr::OriginalName(\"DuplexStreaming\")] DuplexStreaming = 3,\n      }\n\n    }\n    #endregion\n\n  }\n\n  public sealed partial class OptionParameter : pb::IMessage<OptionParameter>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<OptionParameter> _parser = new pb::MessageParser<OptionParameter>(() => new OptionParameter());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<OptionParameter> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter(OptionParameter other) : this() {\n      key_ = other.key_;\n      value_ = other.value_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public OptionParameter Clone() {\n      return new OptionParameter(this);\n    }\n\n    /// <summary>Field number for the \"key\" field.</summary>\n    public const int KeyFieldNumber = 1;\n    private string key_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Key {\n      get { return key_; }\n      set {\n        key_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"value\" field.</summary>\n    public const int ValueFieldNumber = 2;\n    private string value_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Value {\n      get { return value_; }\n      set {\n        value_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as OptionParameter);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(OptionParameter other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Key != other.Key) return false;\n      if (Value != other.Value) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Key.Length != 0) hash ^= Key.GetHashCode();\n      if (Value.Length != 0) hash ^= Value.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Key.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Key);\n      }\n      if (Value.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Value);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Key.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Key);\n      }\n      if (Value.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(Value);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Key.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Key);\n      }\n      if (Value.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Value);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(OptionParameter other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Key.Length != 0) {\n        Key = other.Key;\n      }\n      if (other.Value.Length != 0) {\n        Value = other.Value;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Key = input.ReadString();\n            break;\n          }\n          case 18: {\n            Value = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Key = input.ReadString();\n            break;\n          }\n          case 18: {\n            Value = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppMetadataService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_metadata_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class AppMetadataService {\n\t\t\n\t\tpublic const string Id = \"interop.AppMetadataService\";\t\t\t\n\t\tpublic const string GetAppMetadataChangedEventStreamMethodId = \"GetAppMetadataChangedEventStream\";\n\t\tpublic const string GetMetamodelChangedEventStreamMethodId = \"GetMetamodelChangedEventStream\";\n\t\t\n\t\tpublic static readonly AppMetadataService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppMetadataService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppMetadataService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppMetadataService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppMetadataService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IGetAppMetadataChangedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent> GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetMetamodelChangedEventStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent> GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAppMetadataChangedEventStreamImpl {\n\t\t\tTask GetAppMetadataChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetMetamodelChangedEventStreamImpl {\n\t\t\tTask GetMetamodelChangedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent> GetAppMetadataChangedEventStreamMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent> GetMetamodelChangedEventStreamMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tGetAppMetadataChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent>(Id, GetAppMetadataChangedEventStreamMethodId);\n\t\t\t\tGetMetamodelChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent>(Id, GetMetamodelChangedEventStreamMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tGetAppMetadataChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppMetadataChangedEvent>(Id, alias, GetAppMetadataChangedEventStreamMethodId);\n\t\t\t\tGetMetamodelChangedEventStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.MetamodelChangedEvent>(Id, alias, GetMetamodelChangedEventStreamMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppRegistrationService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/app_registration_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/app_registration_service.proto</summary>\n  public static partial class AppRegistrationServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/app_registration_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static AppRegistrationServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL2FwcF9yZWdpc3RyYXRpb25fc2VydmljZS5wcm90bxIHaW50\",\n            \"ZXJvcBoXaW50ZXJvcC91bmlxdWVfaWQucHJvdG8aFWludGVyb3Avb3B0aW9u\",\n            \"cy5wcm90byJAChhSZXF1ZXN0SW5zdGFuY2VJZFJlcXVlc3Q6JJLbBCBpbnRl\",\n            \"cm9wLlJlcXVlc3RJbnN0YW5jZUlkUmVxdWVzdCJuChlSZWdpc3Rlckluc3Rh\",\n            \"bmNlSWRSZXF1ZXN0EioKD2FwcF9pbnN0YW5jZV9pZBgBIAEoCzIRLmludGVy\",\n            \"b3AuVW5pcXVlSWQ6JZLbBCFpbnRlcm9wLlJlZ2lzdGVySW5zdGFuY2VJZFJl\",\n            \"cXVlc3QiRAoaUmVnaXN0ZXJJbnN0YW5jZUlkUmVzcG9uc2U6JpLbBCJpbnRl\",\n            \"cm9wLlJlZ2lzdGVySW5zdGFuY2VJZFJlc3BvbnNlMuYBChZBcHBSZWdpc3Ry\",\n            \"YXRpb25TZXJ2aWNlEkkKEVJlcXVlc3RJbnN0YW5jZUlkEiEuaW50ZXJvcC5S\",\n            \"ZXF1ZXN0SW5zdGFuY2VJZFJlcXVlc3QaES5pbnRlcm9wLlVuaXF1ZUlkEl0K\",\n            \"ElJlZ2lzdGVySW5zdGFuY2VJZBIiLmludGVyb3AuUmVnaXN0ZXJJbnN0YW5j\",\n            \"ZUlkUmVxdWVzdBojLmludGVyb3AuUmVnaXN0ZXJJbnN0YW5jZUlkUmVzcG9u\",\n            \"c2UaIpLbBB5pbnRlcm9wLkFwcFJlZ2lzdHJhdGlvblNlcnZpY2VCI6oCIFBs\",\n            \"ZXh1cy5JbnRlcm9wLlRlc3RpbmcuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest), global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest.Parser, null, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest), global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest.Parser, new[]{ \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse), global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse.Parser, null, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class RequestInstanceIdRequest : pb::IMessage<RequestInstanceIdRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RequestInstanceIdRequest> _parser = new pb::MessageParser<RequestInstanceIdRequest>(() => new RequestInstanceIdRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RequestInstanceIdRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest(RequestInstanceIdRequest other) : this() {\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RequestInstanceIdRequest Clone() {\n      return new RequestInstanceIdRequest(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RequestInstanceIdRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RequestInstanceIdRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RequestInstanceIdRequest other) {\n      if (other == null) {\n        return;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class RegisterInstanceIdRequest : pb::IMessage<RegisterInstanceIdRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RegisterInstanceIdRequest> _parser = new pb::MessageParser<RegisterInstanceIdRequest>(() => new RegisterInstanceIdRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RegisterInstanceIdRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest(RegisterInstanceIdRequest other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdRequest Clone() {\n      return new RegisterInstanceIdRequest(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RegisterInstanceIdRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RegisterInstanceIdRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RegisterInstanceIdRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class RegisterInstanceIdResponse : pb::IMessage<RegisterInstanceIdResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RegisterInstanceIdResponse> _parser = new pb::MessageParser<RegisterInstanceIdResponse>(() => new RegisterInstanceIdResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RegisterInstanceIdResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.AppRegistrationServiceReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse(RegisterInstanceIdResponse other) : this() {\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RegisterInstanceIdResponse Clone() {\n      return new RegisterInstanceIdResponse(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RegisterInstanceIdResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RegisterInstanceIdResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RegisterInstanceIdResponse other) {\n      if (other == null) {\n        return;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/AppRegistrationService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\app_registration_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class AppRegistrationService {\n\t\t\n\t\tpublic const string Id = \"interop.AppRegistrationService\";\t\t\t\n\t\tpublic const string RequestInstanceIdMethodId = \"RequestInstanceId\";\n\t\tpublic const string RegisterInstanceIdMethodId = \"RegisterInstanceId\";\n\t\t\n\t\tpublic static readonly AppRegistrationService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static AppRegistrationService.Descriptor CreateDescriptor() {\n\t\t\treturn new AppRegistrationService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static AppRegistrationService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new AppRegistrationService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IRequestInstanceIdProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRegisterInstanceIdProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRequestInstanceIdImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IRegisterInstanceIdImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Testing.Generated.UniqueId> RequestInstanceIdMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse> RegisterInstanceIdMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tRequestInstanceIdMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Testing.Generated.UniqueId>(Id, RequestInstanceIdMethodId);\n\t\t\t\tRegisterInstanceIdMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse>(Id, RegisterInstanceIdMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tRequestInstanceIdMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest, global::Plexus.Interop.Testing.Generated.UniqueId>(Id, alias, RequestInstanceIdMethodId);\n\t\t\t\tRegisterInstanceIdMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest, global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse>(Id, alias, RegisterInstanceIdMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/ContextLinkage.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/context_linkage.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/context_linkage.proto</summary>\n  public static partial class ContextLinkageReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/context_linkage.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static ContextLinkageReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"Ch1pbnRlcm9wL2NvbnRleHRfbGlua2FnZS5wcm90bxIHaW50ZXJvcBobZ29v\",\n            \"Z2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGhdpbnRlcm9wL3VuaXF1ZV9pZC5w\",\n            \"cm90bxonaW50ZXJvcC9hcHBfY29ubmVjdGlvbl9kZXNjcmlwdG9yLnByb3Rv\",\n            \"GiJpbnRlcm9wL2FwcF9tZXRhZGF0YV9zZXJ2aWNlLnByb3RvGhVpbnRlcm9w\",\n            \"L29wdGlvbnMucHJvdG8iRQoHQ29udGV4dBIKCgJpZBgBIAEoCRILCgNvd24Y\",\n            \"AiABKAgSDAoEa2luZBgDIAEoCToTktsED2ludGVyb3AuQ29udGV4dCJMCgxD\",\n            \"b250ZXh0c0xpc3QSIgoIY29udGV4dHMYASADKAsyEC5pbnRlcm9wLkNvbnRl\",\n            \"eHQ6GJLbBBRpbnRlcm9wLkNvbnRleHRzTGlzdCJGChRDcmVhdGVDb250ZXh0\",\n            \"UmVxdWVzdBIMCgRraW5kGAEgASgJOiCS2wQcaW50ZXJvcC5DcmVhdGVDb250\",\n            \"ZXh0UmVxdWVzdCLrAQoUQ29udGV4dExvYWRpbmdVcGRhdGUSLQoGc3RhdHVz\",\n            \"GAEgASgOMh0uaW50ZXJvcC5Db250ZXh0TG9hZGluZ1N0YXR1cxJAChZsb2Fk\",\n            \"ZWRfYXBwX2Rlc2NyaXB0b3JzGAIgAygLMiAuaW50ZXJvcC5BcHBDb25uZWN0\",\n            \"aW9uRGVzY3JpcHRvchJAChZmYWlsZWRfYXBwX2Rlc2NyaXB0b3JzGAMgAygL\",\n            \"MiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvcjogktsEHGludGVy\",\n            \"b3AuQ29udGV4dExvYWRpbmdVcGRhdGUiiQEKDUludm9jYXRpb25SZWYSKwoI\",\n            \"YXBwX2luZm8YASABKAsyGS5pbnRlcm9wLkFwcE1ldGFtb2RlbEluZm8SMAoG\",\n            \"dGFyZ2V0GAIgASgLMiAuaW50ZXJvcC5BcHBDb25uZWN0aW9uRGVzY3JpcHRv\",\n            \"cjoZktsEFWludGVyb3AuSW52b2NhdGlvblJlZiJbCg9JbnZvY2F0aW9uc0xp\",\n            \"c3QSKwoLaW52b2NhdGlvbnMYASADKAsyFi5pbnRlcm9wLkludm9jYXRpb25S\",\n            \"ZWY6G5LbBBdpbnRlcm9wLkludm9jYXRpb25zTGlzdCKKAQoUQ29udGV4dFRv\",\n            \"SW52b2NhdGlvbnMSIQoHY29udGV4dBgBIAEoCzIQLmludGVyb3AuQ29udGV4\",\n            \"dBItCgtpbnZvY2F0aW9ucxgCIAEoCzIYLmludGVyb3AuSW52b2NhdGlvbnNM\",\n            \"aXN0OiCS2wQcaW50ZXJvcC5Db250ZXh0VG9JbnZvY2F0aW9ucyJxChhDb250\",\n            \"ZXh0VG9JbnZvY2F0aW9uc0xpc3QSLwoIY29udGV4dHMYASADKAsyHS5pbnRl\",\n            \"cm9wLkNvbnRleHRUb0ludm9jYXRpb25zOiSS2wQgaW50ZXJvcC5Db250ZXh0\",\n            \"VG9JbnZvY2F0aW9uc0xpc3QiiQEKFUFwcEpvaW5lZENvbnRleHRFdmVudBIh\",\n            \"Cgdjb250ZXh0GAEgASgLMhAuaW50ZXJvcC5Db250ZXh0EioKD2FwcF9pbnN0\",\n            \"YW5jZV9pZBgCIAEoCzIRLmludGVyb3AuVW5pcXVlSWQ6IZLbBB1pbnRlcm9w\",\n            \"LkFwcEpvaW5lZENvbnRleHRFdmVudCJ3Ch1SZXN0b3JlQ29udGV4dHNMaW5r\",\n            \"YWdlUmVxdWVzdBIrCgRhcHBzGAEgAygLMh0uaW50ZXJvcC5SZXN0b3JpbmdB\",\n            \"cHBJbnN0YW5jZTopktsEJWludGVyb3AuUmVzdG9yZUNvbnRleHRzTGlua2Fn\",\n            \"ZVJlcXVlc3QisgEKFFJlc3RvcmluZ0FwcEluc3RhbmNlEioKD2FwcF9pbnN0\",\n            \"YW5jZV9pZBgBIAEoCzIRLmludGVyb3AuVW5pcXVlSWQSDwoHYXBwX2lkcxgC\",\n            \"IAMoCRIXCgtjb250ZXh0X2lkcxgDIAMoCUICGAESIgoIY29udGV4dHMYBCAD\",\n            \"KAsyEC5pbnRlcm9wLkNvbnRleHQ6IJLbBBxpbnRlcm9wLlJlc3RvcmluZ0Fw\",\n            \"cEluc3RhbmNlIvgBCh5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2US\",\n            \"XQoUY3JlYXRlZF9jb250ZXh0c19tYXAYASADKAsyPy5pbnRlcm9wLlJlc3Rv\",\n            \"cmVDb250ZXh0c0xpbmthZ2VSZXNwb25zZS5DcmVhdGVkQ29udGV4dHNNYXBF\",\n            \"bnRyeRpLChdDcmVhdGVkQ29udGV4dHNNYXBFbnRyeRILCgNrZXkYASABKAkS\",\n            \"HwoFdmFsdWUYAiABKAsyEC5pbnRlcm9wLkNvbnRleHQ6AjgBOiqS2wQmaW50\",\n            \"ZXJvcC5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2UqQQoUQ29udGV4\",\n            \"dExvYWRpbmdTdGF0dXMSDwoLSU5fUFJPR1JFU1MQABIKCgZGQUlMRUQQARIM\",\n            \"CghGSU5JU0hFRBACMtcFChVDb250ZXh0TGlua2FnZVNlcnZpY2USSAoTQ29u\",\n            \"dGV4dExvYWRlZFN0cmVhbRIQLmludGVyb3AuQ29udGV4dBodLmludGVyb3Au\",\n            \"Q29udGV4dExvYWRpbmdVcGRhdGUwARI+Cg1DcmVhdGVDb250ZXh0EhYuZ29v\",\n            \"Z2xlLnByb3RvYnVmLkVtcHR5GhAuaW50ZXJvcC5Db250ZXh0IgOIAgESQQoO\",\n            \"Q3JlYXRlQ29udGV4dDISHS5pbnRlcm9wLkNyZWF0ZUNvbnRleHRSZXF1ZXN0\",\n            \"GhAuaW50ZXJvcC5Db250ZXh0EjcKC0pvaW5Db250ZXh0EhAuaW50ZXJvcC5D\",\n            \"b250ZXh0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5EjwKC0dldENvbnRleHRz\",\n            \"EhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhUuaW50ZXJvcC5Db250ZXh0c0xp\",\n            \"c3QSQgoUR2V0TGlua2VkSW52b2NhdGlvbnMSEC5pbnRlcm9wLkNvbnRleHQa\",\n            \"GC5pbnRlcm9wLkludm9jYXRpb25zTGlzdBJUChdHZXRBbGxMaW5rZWRJbnZv\",\n            \"Y2F0aW9ucxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRohLmludGVyb3AuQ29u\",\n            \"dGV4dFRvSW52b2NhdGlvbnNMaXN0ElIKFkFwcEpvaW5lZENvbnRleHRTdHJl\",\n            \"YW0SFi5nb29nbGUucHJvdG9idWYuRW1wdHkaHi5pbnRlcm9wLkFwcEpvaW5l\",\n            \"ZENvbnRleHRFdmVudDABEmkKFlJlc3RvcmVDb250ZXh0c0xpbmthZ2USJi5p\",\n            \"bnRlcm9wLlJlc3RvcmVDb250ZXh0c0xpbmthZ2VSZXF1ZXN0GicuaW50ZXJv\",\n            \"cC5SZXN0b3JlQ29udGV4dHNMaW5rYWdlUmVzcG9uc2UaIZLbBB1pbnRlcm9w\",\n            \"LkNvbnRleHRMaW5rYWdlU2VydmljZUIjqgIgUGxleHVzLkludGVyb3AuVGVz\",\n            \"dGluZy5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Testing.Generated.AppMetadataServiceReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Plexus.Interop.Testing.Generated.ContextLoadingStatus), }, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.Context), global::Plexus.Interop.Testing.Generated.Context.Parser, new[]{ \"Id\", \"Own\", \"Kind\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ContextsList), global::Plexus.Interop.Testing.Generated.ContextsList.Parser, new[]{ \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.CreateContextRequest), global::Plexus.Interop.Testing.Generated.CreateContextRequest.Parser, new[]{ \"Kind\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate), global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate.Parser, new[]{ \"Status\", \"LoadedAppDescriptors\", \"FailedAppDescriptors\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationRef), global::Plexus.Interop.Testing.Generated.InvocationRef.Parser, new[]{ \"AppInfo\", \"Target\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationsList), global::Plexus.Interop.Testing.Generated.InvocationsList.Parser, new[]{ \"Invocations\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ContextToInvocations), global::Plexus.Interop.Testing.Generated.ContextToInvocations.Parser, new[]{ \"Context\", \"Invocations\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.ContextToInvocationsList), global::Plexus.Interop.Testing.Generated.ContextToInvocationsList.Parser, new[]{ \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent), global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent.Parser, new[]{ \"Context\", \"AppInstanceId\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest), global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest.Parser, new[]{ \"Apps\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RestoringAppInstance), global::Plexus.Interop.Testing.Generated.RestoringAppInstance.Parser, new[]{ \"AppInstanceId\", \"AppIds\", \"ContextIds\", \"Contexts\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse), global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse.Parser, new[]{ \"CreatedContextsMap\" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, })\n          }));\n    }\n    #endregion\n\n  }\n  #region Enums\n  public enum ContextLoadingStatus {\n    /// <summary>\n    /// intermediate state, some of apps within context already loaded\n    /// </summary>\n    [pbr::OriginalName(\"IN_PROGRESS\")] InProgress = 0,\n    /// <summary>\n    /// termination state, some of apps failed to start/connect to plexus, no more apps \"in progress\"\n    /// </summary>\n    [pbr::OriginalName(\"FAILED\")] Failed = 1,\n    /// <summary>\n    /// termination state, all apps within context are loaded\n    /// </summary>\n    [pbr::OriginalName(\"FINISHED\")] Finished = 2,\n  }\n\n  #endregion\n\n  #region Messages\n  public sealed partial class Context : pb::IMessage<Context>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<Context> _parser = new pb::MessageParser<Context>(() => new Context());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<Context> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context(Context other) : this() {\n      id_ = other.id_;\n      own_ = other.own_;\n      kind_ = other.kind_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public Context Clone() {\n      return new Context(this);\n    }\n\n    /// <summary>Field number for the \"id\" field.</summary>\n    public const int IdFieldNumber = 1;\n    private string id_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Id {\n      get { return id_; }\n      set {\n        id_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"own\" field.</summary>\n    public const int OwnFieldNumber = 2;\n    private bool own_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Own {\n      get { return own_; }\n      set {\n        own_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"kind\" field.</summary>\n    public const int KindFieldNumber = 3;\n    private string kind_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Kind {\n      get { return kind_; }\n      set {\n        kind_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as Context);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(Context other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Id != other.Id) return false;\n      if (Own != other.Own) return false;\n      if (Kind != other.Kind) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Id.Length != 0) hash ^= Id.GetHashCode();\n      if (Own != false) hash ^= Own.GetHashCode();\n      if (Kind.Length != 0) hash ^= Kind.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (Own != false) {\n        output.WriteRawTag(16);\n        output.WriteBool(Own);\n      }\n      if (Kind.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Id.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Id);\n      }\n      if (Own != false) {\n        output.WriteRawTag(16);\n        output.WriteBool(Own);\n      }\n      if (Kind.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Id.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);\n      }\n      if (Own != false) {\n        size += 1 + 1;\n      }\n      if (Kind.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(Context other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Id.Length != 0) {\n        Id = other.Id;\n      }\n      if (other.Own != false) {\n        Own = other.Own;\n      }\n      if (other.Kind.Length != 0) {\n        Kind = other.Kind;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 16: {\n            Own = input.ReadBool();\n            break;\n          }\n          case 26: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Id = input.ReadString();\n            break;\n          }\n          case 16: {\n            Own = input.ReadBool();\n            break;\n          }\n          case 26: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ContextsList : pb::IMessage<ContextsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextsList> _parser = new pb::MessageParser<ContextsList>(() => new ContextsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList(ContextsList other) : this() {\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextsList Clone() {\n      return new ContextsList(this);\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.Context> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.Context.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextsList other) {\n      if (other == null) {\n        return;\n      }\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class CreateContextRequest : pb::IMessage<CreateContextRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<CreateContextRequest> _parser = new pb::MessageParser<CreateContextRequest>(() => new CreateContextRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<CreateContextRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[2]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest(CreateContextRequest other) : this() {\n      kind_ = other.kind_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public CreateContextRequest Clone() {\n      return new CreateContextRequest(this);\n    }\n\n    /// <summary>Field number for the \"kind\" field.</summary>\n    public const int KindFieldNumber = 1;\n    private string kind_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Kind {\n      get { return kind_; }\n      set {\n        kind_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as CreateContextRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(CreateContextRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Kind != other.Kind) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Kind.Length != 0) hash ^= Kind.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Kind.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Kind.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Kind);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Kind.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(CreateContextRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Kind.Length != 0) {\n        Kind = other.Kind;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Kind = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ContextLoadingUpdate : pb::IMessage<ContextLoadingUpdate>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextLoadingUpdate> _parser = new pb::MessageParser<ContextLoadingUpdate>(() => new ContextLoadingUpdate());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextLoadingUpdate> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[3]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate(ContextLoadingUpdate other) : this() {\n      status_ = other.status_;\n      loadedAppDescriptors_ = other.loadedAppDescriptors_.Clone();\n      failedAppDescriptors_ = other.failedAppDescriptors_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextLoadingUpdate Clone() {\n      return new ContextLoadingUpdate(this);\n    }\n\n    /// <summary>Field number for the \"status\" field.</summary>\n    public const int StatusFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.ContextLoadingStatus status_ = global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.ContextLoadingStatus Status {\n      get { return status_; }\n      set {\n        status_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"loaded_app_descriptors\" field.</summary>\n    public const int LoadedAppDescriptorsFieldNumber = 2;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> _repeated_loadedAppDescriptors_codec\n        = pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> loadedAppDescriptors_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor>();\n    /// <summary>\n    /// loaded apps within context at this moment of time\n    /// </summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> LoadedAppDescriptors {\n      get { return loadedAppDescriptors_; }\n    }\n\n    /// <summary>Field number for the \"failed_app_descriptors\" field.</summary>\n    public const int FailedAppDescriptorsFieldNumber = 3;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> _repeated_failedAppDescriptors_codec\n        = pb::FieldCodec.ForMessage(26, global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> failedAppDescriptors_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor>();\n    /// <summary>\n    /// apps registered in context, but failed to load\n    /// </summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor> FailedAppDescriptors {\n      get { return failedAppDescriptors_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextLoadingUpdate);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextLoadingUpdate other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Status != other.Status) return false;\n      if(!loadedAppDescriptors_.Equals(other.loadedAppDescriptors_)) return false;\n      if(!failedAppDescriptors_.Equals(other.failedAppDescriptors_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Status != global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress) hash ^= Status.GetHashCode();\n      hash ^= loadedAppDescriptors_.GetHashCode();\n      hash ^= failedAppDescriptors_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Status != global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress) {\n        output.WriteRawTag(8);\n        output.WriteEnum((int) Status);\n      }\n      loadedAppDescriptors_.WriteTo(output, _repeated_loadedAppDescriptors_codec);\n      failedAppDescriptors_.WriteTo(output, _repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Status != global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress) {\n        output.WriteRawTag(8);\n        output.WriteEnum((int) Status);\n      }\n      loadedAppDescriptors_.WriteTo(ref output, _repeated_loadedAppDescriptors_codec);\n      failedAppDescriptors_.WriteTo(ref output, _repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Status != global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);\n      }\n      size += loadedAppDescriptors_.CalculateSize(_repeated_loadedAppDescriptors_codec);\n      size += failedAppDescriptors_.CalculateSize(_repeated_failedAppDescriptors_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextLoadingUpdate other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Status != global::Plexus.Interop.Testing.Generated.ContextLoadingStatus.InProgress) {\n        Status = other.Status;\n      }\n      loadedAppDescriptors_.Add(other.loadedAppDescriptors_);\n      failedAppDescriptors_.Add(other.failedAppDescriptors_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 8: {\n            Status = (global::Plexus.Interop.Testing.Generated.ContextLoadingStatus) input.ReadEnum();\n            break;\n          }\n          case 18: {\n            loadedAppDescriptors_.AddEntriesFrom(input, _repeated_loadedAppDescriptors_codec);\n            break;\n          }\n          case 26: {\n            failedAppDescriptors_.AddEntriesFrom(input, _repeated_failedAppDescriptors_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 8: {\n            Status = (global::Plexus.Interop.Testing.Generated.ContextLoadingStatus) input.ReadEnum();\n            break;\n          }\n          case 18: {\n            loadedAppDescriptors_.AddEntriesFrom(ref input, _repeated_loadedAppDescriptors_codec);\n            break;\n          }\n          case 26: {\n            failedAppDescriptors_.AddEntriesFrom(ref input, _repeated_failedAppDescriptors_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class InvocationRef : pb::IMessage<InvocationRef>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationRef> _parser = new pb::MessageParser<InvocationRef>(() => new InvocationRef());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationRef> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[4]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef(InvocationRef other) : this() {\n      appInfo_ = other.appInfo_ != null ? other.appInfo_.Clone() : null;\n      target_ = other.target_ != null ? other.target_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationRef Clone() {\n      return new InvocationRef(this);\n    }\n\n    /// <summary>Field number for the \"app_info\" field.</summary>\n    public const int AppInfoFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.AppMetamodelInfo appInfo_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppMetamodelInfo AppInfo {\n      get { return appInfo_; }\n      set {\n        appInfo_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"target\" field.</summary>\n    public const int TargetFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor target_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor Target {\n      get { return target_; }\n      set {\n        target_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationRef);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationRef other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInfo, other.AppInfo)) return false;\n      if (!object.Equals(Target, other.Target)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInfo_ != null) hash ^= AppInfo.GetHashCode();\n      if (target_ != null) hash ^= Target.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInfo_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInfo);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInfo_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInfo);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInfo_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInfo);\n      }\n      if (target_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationRef other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInfo_ != null) {\n        if (appInfo_ == null) {\n          AppInfo = new global::Plexus.Interop.Testing.Generated.AppMetamodelInfo();\n        }\n        AppInfo.MergeFrom(other.AppInfo);\n      }\n      if (other.target_ != null) {\n        if (target_ == null) {\n          Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        Target.MergeFrom(other.Target);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInfo_ == null) {\n              AppInfo = new global::Plexus.Interop.Testing.Generated.AppMetamodelInfo();\n            }\n            input.ReadMessage(AppInfo);\n            break;\n          }\n          case 18: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInfo_ == null) {\n              AppInfo = new global::Plexus.Interop.Testing.Generated.AppMetamodelInfo();\n            }\n            input.ReadMessage(AppInfo);\n            break;\n          }\n          case 18: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class InvocationsList : pb::IMessage<InvocationsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationsList> _parser = new pb::MessageParser<InvocationsList>(() => new InvocationsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[5]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList(InvocationsList other) : this() {\n      invocations_ = other.invocations_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationsList Clone() {\n      return new InvocationsList(this);\n    }\n\n    /// <summary>Field number for the \"invocations\" field.</summary>\n    public const int InvocationsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.InvocationRef> _repeated_invocations_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.InvocationRef.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.InvocationRef> invocations_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.InvocationRef>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.InvocationRef> Invocations {\n      get { return invocations_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!invocations_.Equals(other.invocations_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= invocations_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      invocations_.WriteTo(output, _repeated_invocations_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      invocations_.WriteTo(ref output, _repeated_invocations_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += invocations_.CalculateSize(_repeated_invocations_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationsList other) {\n      if (other == null) {\n        return;\n      }\n      invocations_.Add(other.invocations_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            invocations_.AddEntriesFrom(input, _repeated_invocations_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            invocations_.AddEntriesFrom(ref input, _repeated_invocations_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ContextToInvocations : pb::IMessage<ContextToInvocations>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextToInvocations> _parser = new pb::MessageParser<ContextToInvocations>(() => new ContextToInvocations());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextToInvocations> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[6]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations(ContextToInvocations other) : this() {\n      context_ = other.context_ != null ? other.context_.Clone() : null;\n      invocations_ = other.invocations_ != null ? other.invocations_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocations Clone() {\n      return new ContextToInvocations(this);\n    }\n\n    /// <summary>Field number for the \"context\" field.</summary>\n    public const int ContextFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.Context context_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.Context Context {\n      get { return context_; }\n      set {\n        context_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"invocations\" field.</summary>\n    public const int InvocationsFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.InvocationsList invocations_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.InvocationsList Invocations {\n      get { return invocations_; }\n      set {\n        invocations_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextToInvocations);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextToInvocations other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Context, other.Context)) return false;\n      if (!object.Equals(Invocations, other.Invocations)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (context_ != null) hash ^= Context.GetHashCode();\n      if (invocations_ != null) hash ^= Invocations.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (invocations_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Invocations);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (invocations_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(Invocations);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (context_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);\n      }\n      if (invocations_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Invocations);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextToInvocations other) {\n      if (other == null) {\n        return;\n      }\n      if (other.context_ != null) {\n        if (context_ == null) {\n          Context = new global::Plexus.Interop.Testing.Generated.Context();\n        }\n        Context.MergeFrom(other.Context);\n      }\n      if (other.invocations_ != null) {\n        if (invocations_ == null) {\n          Invocations = new global::Plexus.Interop.Testing.Generated.InvocationsList();\n        }\n        Invocations.MergeFrom(other.Invocations);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Testing.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (invocations_ == null) {\n              Invocations = new global::Plexus.Interop.Testing.Generated.InvocationsList();\n            }\n            input.ReadMessage(Invocations);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Testing.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (invocations_ == null) {\n              Invocations = new global::Plexus.Interop.Testing.Generated.InvocationsList();\n            }\n            input.ReadMessage(Invocations);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class ContextToInvocationsList : pb::IMessage<ContextToInvocationsList>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<ContextToInvocationsList> _parser = new pb::MessageParser<ContextToInvocationsList>(() => new ContextToInvocationsList());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<ContextToInvocationsList> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[7]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList(ContextToInvocationsList other) : this() {\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ContextToInvocationsList Clone() {\n      return new ContextToInvocationsList(this);\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.ContextToInvocations> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.ContextToInvocations.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ContextToInvocations> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ContextToInvocations>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.ContextToInvocations> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as ContextToInvocationsList);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(ContextToInvocationsList other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(ContextToInvocationsList other) {\n      if (other == null) {\n        return;\n      }\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class AppJoinedContextEvent : pb::IMessage<AppJoinedContextEvent>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<AppJoinedContextEvent> _parser = new pb::MessageParser<AppJoinedContextEvent>(() => new AppJoinedContextEvent());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<AppJoinedContextEvent> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[8]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent(AppJoinedContextEvent other) : this() {\n      context_ = other.context_ != null ? other.context_.Clone() : null;\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public AppJoinedContextEvent Clone() {\n      return new AppJoinedContextEvent(this);\n    }\n\n    /// <summary>Field number for the \"context\" field.</summary>\n    public const int ContextFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.Context context_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.Context Context {\n      get { return context_; }\n      set {\n        context_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 2;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as AppJoinedContextEvent);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(AppJoinedContextEvent other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(Context, other.Context)) return false;\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (context_ != null) hash ^= Context.GetHashCode();\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (context_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(Context);\n      }\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(18);\n        output.WriteMessage(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (context_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Context);\n      }\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(AppJoinedContextEvent other) {\n      if (other == null) {\n        return;\n      }\n      if (other.context_ != null) {\n        if (context_ == null) {\n          Context = new global::Plexus.Interop.Testing.Generated.Context();\n        }\n        Context.MergeFrom(other.Context);\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Testing.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (context_ == null) {\n              Context = new global::Plexus.Interop.Testing.Generated.Context();\n            }\n            input.ReadMessage(Context);\n            break;\n          }\n          case 18: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class RestoreContextsLinkageRequest : pb::IMessage<RestoreContextsLinkageRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoreContextsLinkageRequest> _parser = new pb::MessageParser<RestoreContextsLinkageRequest>(() => new RestoreContextsLinkageRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoreContextsLinkageRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[9]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest(RestoreContextsLinkageRequest other) : this() {\n      apps_ = other.apps_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageRequest Clone() {\n      return new RestoreContextsLinkageRequest(this);\n    }\n\n    /// <summary>Field number for the \"apps\" field.</summary>\n    public const int AppsFieldNumber = 1;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.RestoringAppInstance> _repeated_apps_codec\n        = pb::FieldCodec.ForMessage(10, global::Plexus.Interop.Testing.Generated.RestoringAppInstance.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.RestoringAppInstance> apps_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.RestoringAppInstance>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.RestoringAppInstance> Apps {\n      get { return apps_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoreContextsLinkageRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoreContextsLinkageRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if(!apps_.Equals(other.apps_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= apps_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      apps_.WriteTo(output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      apps_.WriteTo(ref output, _repeated_apps_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += apps_.CalculateSize(_repeated_apps_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoreContextsLinkageRequest other) {\n      if (other == null) {\n        return;\n      }\n      apps_.Add(other.apps_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            apps_.AddEntriesFrom(ref input, _repeated_apps_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class RestoringAppInstance : pb::IMessage<RestoringAppInstance>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoringAppInstance> _parser = new pb::MessageParser<RestoringAppInstance>(() => new RestoringAppInstance());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoringAppInstance> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[10]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance(RestoringAppInstance other) : this() {\n      appInstanceId_ = other.appInstanceId_ != null ? other.appInstanceId_.Clone() : null;\n      appIds_ = other.appIds_.Clone();\n      contextIds_ = other.contextIds_.Clone();\n      contexts_ = other.contexts_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoringAppInstance Clone() {\n      return new RestoringAppInstance(this);\n    }\n\n    /// <summary>Field number for the \"app_instance_id\" field.</summary>\n    public const int AppInstanceIdFieldNumber = 1;\n    private global::Plexus.Interop.Testing.Generated.UniqueId appInstanceId_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.UniqueId AppInstanceId {\n      get { return appInstanceId_; }\n      set {\n        appInstanceId_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"app_ids\" field.</summary>\n    public const int AppIdsFieldNumber = 2;\n    private static readonly pb::FieldCodec<string> _repeated_appIds_codec\n        = pb::FieldCodec.ForString(18);\n    private readonly pbc::RepeatedField<string> appIds_ = new pbc::RepeatedField<string>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> AppIds {\n      get { return appIds_; }\n    }\n\n    /// <summary>Field number for the \"context_ids\" field.</summary>\n    public const int ContextIdsFieldNumber = 3;\n    private static readonly pb::FieldCodec<string> _repeated_contextIds_codec\n        = pb::FieldCodec.ForString(26);\n    private readonly pbc::RepeatedField<string> contextIds_ = new pbc::RepeatedField<string>();\n    [global::System.ObsoleteAttribute]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<string> ContextIds {\n      get { return contextIds_; }\n    }\n\n    /// <summary>Field number for the \"contexts\" field.</summary>\n    public const int ContextsFieldNumber = 4;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.Context> _repeated_contexts_codec\n        = pb::FieldCodec.ForMessage(34, global::Plexus.Interop.Testing.Generated.Context.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context> contexts_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.Context> Contexts {\n      get { return contexts_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoringAppInstance);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoringAppInstance other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!object.Equals(AppInstanceId, other.AppInstanceId)) return false;\n      if(!appIds_.Equals(other.appIds_)) return false;\n      if(!contextIds_.Equals(other.contextIds_)) return false;\n      if(!contexts_.Equals(other.contexts_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (appInstanceId_ != null) hash ^= AppInstanceId.GetHashCode();\n      hash ^= appIds_.GetHashCode();\n      hash ^= contextIds_.GetHashCode();\n      hash ^= contexts_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(output, _repeated_appIds_codec);\n      contextIds_.WriteTo(output, _repeated_contextIds_codec);\n      contexts_.WriteTo(output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (appInstanceId_ != null) {\n        output.WriteRawTag(10);\n        output.WriteMessage(AppInstanceId);\n      }\n      appIds_.WriteTo(ref output, _repeated_appIds_codec);\n      contextIds_.WriteTo(ref output, _repeated_contextIds_codec);\n      contexts_.WriteTo(ref output, _repeated_contexts_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (appInstanceId_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppInstanceId);\n      }\n      size += appIds_.CalculateSize(_repeated_appIds_codec);\n      size += contextIds_.CalculateSize(_repeated_contextIds_codec);\n      size += contexts_.CalculateSize(_repeated_contexts_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoringAppInstance other) {\n      if (other == null) {\n        return;\n      }\n      if (other.appInstanceId_ != null) {\n        if (appInstanceId_ == null) {\n          AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n        }\n        AppInstanceId.MergeFrom(other.AppInstanceId);\n      }\n      appIds_.Add(other.appIds_);\n      contextIds_.Add(other.contextIds_);\n      contexts_.Add(other.contexts_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            contextIds_.AddEntriesFrom(input, _repeated_contextIds_codec);\n            break;\n          }\n          case 34: {\n            contexts_.AddEntriesFrom(input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            if (appInstanceId_ == null) {\n              AppInstanceId = new global::Plexus.Interop.Testing.Generated.UniqueId();\n            }\n            input.ReadMessage(AppInstanceId);\n            break;\n          }\n          case 18: {\n            appIds_.AddEntriesFrom(ref input, _repeated_appIds_codec);\n            break;\n          }\n          case 26: {\n            contextIds_.AddEntriesFrom(ref input, _repeated_contextIds_codec);\n            break;\n          }\n          case 34: {\n            contexts_.AddEntriesFrom(ref input, _repeated_contexts_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class RestoreContextsLinkageResponse : pb::IMessage<RestoreContextsLinkageResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<RestoreContextsLinkageResponse> _parser = new pb::MessageParser<RestoreContextsLinkageResponse>(() => new RestoreContextsLinkageResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<RestoreContextsLinkageResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.ContextLinkageReflection.Descriptor.MessageTypes[11]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse(RestoreContextsLinkageResponse other) : this() {\n      createdContextsMap_ = other.createdContextsMap_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public RestoreContextsLinkageResponse Clone() {\n      return new RestoreContextsLinkageResponse(this);\n    }\n\n    /// <summary>Field number for the \"created_contexts_map\" field.</summary>\n    public const int CreatedContextsMapFieldNumber = 1;\n    private static readonly pbc::MapField<string, global::Plexus.Interop.Testing.Generated.Context>.Codec _map_createdContextsMap_codec\n        = new pbc::MapField<string, global::Plexus.Interop.Testing.Generated.Context>.Codec(pb::FieldCodec.ForString(10, \"\"), pb::FieldCodec.ForMessage(18, global::Plexus.Interop.Testing.Generated.Context.Parser), 10);\n    private readonly pbc::MapField<string, global::Plexus.Interop.Testing.Generated.Context> createdContextsMap_ = new pbc::MapField<string, global::Plexus.Interop.Testing.Generated.Context>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::MapField<string, global::Plexus.Interop.Testing.Generated.Context> CreatedContextsMap {\n      get { return createdContextsMap_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as RestoreContextsLinkageResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(RestoreContextsLinkageResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (!CreatedContextsMap.Equals(other.CreatedContextsMap)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      hash ^= CreatedContextsMap.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      createdContextsMap_.WriteTo(output, _map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      createdContextsMap_.WriteTo(ref output, _map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      size += createdContextsMap_.CalculateSize(_map_createdContextsMap_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(RestoreContextsLinkageResponse other) {\n      if (other == null) {\n        return;\n      }\n      createdContextsMap_.Add(other.createdContextsMap_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            createdContextsMap_.AddEntriesFrom(input, _map_createdContextsMap_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            createdContextsMap_.AddEntriesFrom(ref input, _map_createdContextsMap_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/ContextLinkage.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\context_linkage.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class ContextLinkageService {\n\t\t\n\t\tpublic const string Id = \"interop.ContextLinkageService\";\t\t\t\n\t\tpublic const string ContextLoadedStreamMethodId = \"ContextLoadedStream\";\n\t\tpublic const string CreateContextMethodId = \"CreateContext\";\n\t\tpublic const string CreateContext2MethodId = \"CreateContext2\";\n\t\tpublic const string JoinContextMethodId = \"JoinContext\";\n\t\tpublic const string GetContextsMethodId = \"GetContexts\";\n\t\tpublic const string GetLinkedInvocationsMethodId = \"GetLinkedInvocations\";\n\t\tpublic const string GetAllLinkedInvocationsMethodId = \"GetAllLinkedInvocations\";\n\t\tpublic const string AppJoinedContextStreamMethodId = \"AppJoinedContextStream\";\n\t\tpublic const string RestoreContextsLinkageMethodId = \"RestoreContextsLinkage\";\n\t\t\n\t\tpublic static readonly ContextLinkageService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static ContextLinkageService.Descriptor CreateDescriptor() {\n\t\t\treturn new ContextLinkageService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static ContextLinkageService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new ContextLinkageService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IContextLoadedStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate> ContextLoadedStream(global::Plexus.Interop.Testing.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContextProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContext2Proxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.Context> CreateContext2(global::Plexus.Interop.Testing.Generated.CreateContextRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IJoinContextProxy {\n\t\t\tIUnaryMethodCall<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Testing.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetContextsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLinkedInvocationsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Testing.Generated.Context request);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAllLinkedInvocationsProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppJoinedContextStreamProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent> AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request);\n\t\t}\n\t\t\n\t\tpublic partial interface IRestoreContextsLinkageProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IContextLoadedStreamImpl {\n\t\t\tTask ContextLoadedStream(global::Plexus.Interop.Testing.Generated.Context request, IWritableChannel<global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContextImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface ICreateContext2Impl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.Context> CreateContext2(global::Plexus.Interop.Testing.Generated.CreateContextRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IJoinContextImpl {\n\t\t\tTask<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Testing.Generated.Context request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetContextsImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetLinkedInvocationsImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Testing.Generated.Context request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IGetAllLinkedInvocationsImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IAppJoinedContextStreamImpl {\n\t\t\tTask AppJoinedContextStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IRestoreContextsLinkageImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkage(global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate> ContextLoadedStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.Context> CreateContextMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.CreateContextRequest, global::Plexus.Interop.Testing.Generated.Context> CreateContext2Method {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty> JoinContextMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextsList> GetContextsMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.InvocationsList> GetLinkedInvocationsMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextToInvocationsList> GetAllLinkedInvocationsMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent> AppJoinedContextStreamMethod {get; private set; }\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse> RestoreContextsLinkageMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tContextLoadedStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate>(Id, ContextLoadedStreamMethodId);\n\t\t\t\tCreateContextMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.Context>(Id, CreateContextMethodId);\n\t\t\t\tCreateContext2Method = Method.Unary<global::Plexus.Interop.Testing.Generated.CreateContextRequest, global::Plexus.Interop.Testing.Generated.Context>(Id, CreateContext2MethodId);\n\t\t\t\tJoinContextMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty>(Id, JoinContextMethodId);\n\t\t\t\tGetContextsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextsList>(Id, GetContextsMethodId);\n\t\t\t\tGetLinkedInvocationsMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.InvocationsList>(Id, GetLinkedInvocationsMethodId);\n\t\t\t\tGetAllLinkedInvocationsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextToInvocationsList>(Id, GetAllLinkedInvocationsMethodId);\n\t\t\t\tAppJoinedContextStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent>(Id, AppJoinedContextStreamMethodId);\n\t\t\t\tRestoreContextsLinkageMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse>(Id, RestoreContextsLinkageMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tContextLoadedStreamMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate>(Id, alias, ContextLoadedStreamMethodId);\n\t\t\t\tCreateContextMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.Context>(Id, alias, CreateContextMethodId);\n\t\t\t\tCreateContext2Method = Method.Unary<global::Plexus.Interop.Testing.Generated.CreateContextRequest, global::Plexus.Interop.Testing.Generated.Context>(Id, alias, CreateContext2MethodId);\n\t\t\t\tJoinContextMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.Context, global::Google.Protobuf.WellKnownTypes.Empty>(Id, alias, JoinContextMethodId);\n\t\t\t\tGetContextsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextsList>(Id, alias, GetContextsMethodId);\n\t\t\t\tGetLinkedInvocationsMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.Context, global::Plexus.Interop.Testing.Generated.InvocationsList>(Id, alias, GetLinkedInvocationsMethodId);\n\t\t\t\tGetAllLinkedInvocationsMethod = Method.Unary<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.ContextToInvocationsList>(Id, alias, GetAllLinkedInvocationsMethodId);\n\t\t\t\tAppJoinedContextStreamMethod = Method.ServerStreaming<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppJoinedContextEvent>(Id, alias, AppJoinedContextStreamMethodId);\n\t\t\t\tRestoreContextsLinkageMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageRequest, global::Plexus.Interop.Testing.Generated.RestoreContextsLinkageResponse>(Id, alias, RestoreContextsLinkageMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/InvocationDescriptor.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/invocation_descriptor.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/invocation_descriptor.proto</summary>\n  public static partial class InvocationDescriptorReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/invocation_descriptor.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static InvocationDescriptorReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiNpbnRlcm9wL2ludm9jYXRpb25fZGVzY3JpcHRvci5wcm90bxIHaW50ZXJv\",\n            \"cBonaW50ZXJvcC9hcHBfY29ubmVjdGlvbl9kZXNjcmlwdG9yLnByb3RvGhVp\",\n            \"bnRlcm9wL29wdGlvbnMucHJvdG8i3QEKFEludm9jYXRpb25EZXNjcmlwdG9y\",\n            \"EhIKCnNlcnZpY2VfaWQYASABKAkSGAoQc2VydmljZV9hbGlhc19pZBgCIAEo\",\n            \"CRIRCgltZXRob2RfaWQYAyABKAkSMAoGc291cmNlGAQgASgLMiAuaW50ZXJv\",\n            \"cC5BcHBDb25uZWN0aW9uRGVzY3JpcHRvchIwCgZ0YXJnZXQYBSABKAsyIC5p\",\n            \"bnRlcm9wLkFwcENvbm5lY3Rpb25EZXNjcmlwdG9yOiCS2wQcaW50ZXJvcC5J\",\n            \"bnZvY2F0aW9uRGVzY3JpcHRvckIjqgIgUGxleHVzLkludGVyb3AuVGVzdGlu\",\n            \"Zy5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.AppConnectionDescriptorReflection.Descriptor, global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.InvocationDescriptor), global::Plexus.Interop.Testing.Generated.InvocationDescriptor.Parser, new[]{ \"ServiceId\", \"ServiceAliasId\", \"MethodId\", \"Source\", \"Target\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class InvocationDescriptor : pb::IMessage<InvocationDescriptor>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<InvocationDescriptor> _parser = new pb::MessageParser<InvocationDescriptor>(() => new InvocationDescriptor());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<InvocationDescriptor> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.InvocationDescriptorReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor(InvocationDescriptor other) : this() {\n      serviceId_ = other.serviceId_;\n      serviceAliasId_ = other.serviceAliasId_;\n      methodId_ = other.methodId_;\n      source_ = other.source_ != null ? other.source_.Clone() : null;\n      target_ = other.target_ != null ? other.target_.Clone() : null;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public InvocationDescriptor Clone() {\n      return new InvocationDescriptor(this);\n    }\n\n    /// <summary>Field number for the \"service_id\" field.</summary>\n    public const int ServiceIdFieldNumber = 1;\n    private string serviceId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceId {\n      get { return serviceId_; }\n      set {\n        serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"service_alias_id\" field.</summary>\n    public const int ServiceAliasIdFieldNumber = 2;\n    private string serviceAliasId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string ServiceAliasId {\n      get { return serviceAliasId_; }\n      set {\n        serviceAliasId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"method_id\" field.</summary>\n    public const int MethodIdFieldNumber = 3;\n    private string methodId_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string MethodId {\n      get { return methodId_; }\n      set {\n        methodId_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"source\" field.</summary>\n    public const int SourceFieldNumber = 4;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor source_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor Source {\n      get { return source_; }\n      set {\n        source_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"target\" field.</summary>\n    public const int TargetFieldNumber = 5;\n    private global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor target_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor Target {\n      get { return target_; }\n      set {\n        target_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as InvocationDescriptor);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(InvocationDescriptor other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (ServiceId != other.ServiceId) return false;\n      if (ServiceAliasId != other.ServiceAliasId) return false;\n      if (MethodId != other.MethodId) return false;\n      if (!object.Equals(Source, other.Source)) return false;\n      if (!object.Equals(Target, other.Target)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();\n      if (ServiceAliasId.Length != 0) hash ^= ServiceAliasId.GetHashCode();\n      if (MethodId.Length != 0) hash ^= MethodId.GetHashCode();\n      if (source_ != null) hash ^= Source.GetHashCode();\n      if (target_ != null) hash ^= Target.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (ServiceId.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        output.WriteRawTag(18);\n        output.WriteString(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        output.WriteRawTag(26);\n        output.WriteString(MethodId);\n      }\n      if (source_ != null) {\n        output.WriteRawTag(34);\n        output.WriteMessage(Source);\n      }\n      if (target_ != null) {\n        output.WriteRawTag(42);\n        output.WriteMessage(Target);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (ServiceId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);\n      }\n      if (ServiceAliasId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceAliasId);\n      }\n      if (MethodId.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(MethodId);\n      }\n      if (source_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Source);\n      }\n      if (target_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(InvocationDescriptor other) {\n      if (other == null) {\n        return;\n      }\n      if (other.ServiceId.Length != 0) {\n        ServiceId = other.ServiceId;\n      }\n      if (other.ServiceAliasId.Length != 0) {\n        ServiceAliasId = other.ServiceAliasId;\n      }\n      if (other.MethodId.Length != 0) {\n        MethodId = other.MethodId;\n      }\n      if (other.source_ != null) {\n        if (source_ == null) {\n          Source = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        Source.MergeFrom(other.Source);\n      }\n      if (other.target_ != null) {\n        if (target_ == null) {\n          Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n        }\n        Target.MergeFrom(other.Target);\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            ServiceId = input.ReadString();\n            break;\n          }\n          case 18: {\n            ServiceAliasId = input.ReadString();\n            break;\n          }\n          case 26: {\n            MethodId = input.ReadString();\n            break;\n          }\n          case 34: {\n            if (source_ == null) {\n              Source = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Source);\n            break;\n          }\n          case 42: {\n            if (target_ == null) {\n              Target = new global::Plexus.Interop.Testing.Generated.AppConnectionDescriptor();\n            }\n            input.ReadMessage(Target);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/Options.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  public static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIjqgIgUGxleHVzLkludGVyb3AuVGVzdGluZy5HZW5lcmF0ZWRiBnByb3Rv\",\n            \"Mw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { OptionsExtensions.MessageId, OptionsExtensions.ServiceId, OptionsExtensions.MethodId }, null));\n    }\n    #endregion\n\n  }\n  /// <summary>Holder for extension identifiers generated from the top level of interop/options.proto</summary>\n  public static partial class OptionsExtensions {\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string> MessageId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MessageOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string> ServiceId =\n      new pb::Extension<global::Google.Protobuf.Reflection.ServiceOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n    public static readonly pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string> MethodId =\n      new pb::Extension<global::Google.Protobuf.Reflection.MethodOptions, string>(9650, pb::FieldCodec.ForString(77202, \"\"));\n  }\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/UniqueId.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/unique_id.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/unique_id.proto</summary>\n  public static partial class UniqueIdReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/unique_id.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static UniqueIdReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChdpbnRlcm9wL3VuaXF1ZV9pZC5wcm90bxIHaW50ZXJvcBoVaW50ZXJvcC9v\",\n            \"cHRpb25zLnByb3RvIjgKCFVuaXF1ZUlkEgoKAmxvGAEgASgGEgoKAmhpGAIg\",\n            \"ASgGOhSS2wQQaW50ZXJvcC5VbmlxdWVJZEIjqgIgUGxleHVzLkludGVyb3Au\",\n            \"VGVzdGluZy5HZW5lcmF0ZWRiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.UniqueId), global::Plexus.Interop.Testing.Generated.UniqueId.Parser, new[]{ \"Lo\", \"Hi\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  /// <summary>\n  /// Stores UUID in little-endian format (i.e. reversed).\n  /// To convert to bytes on little-endian systems (most common case): concat (toBytes(hi), toBytes(lo))\n  /// To convert to bytes on big-endian systems need to additionally reverse \"hi\" and \"lo\" parts: concat( reverse(toBytes(hi)), reverse(toBytes(lo)) )\n  /// </summary>\n  public sealed partial class UniqueId : pb::IMessage<UniqueId>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<UniqueId> _parser = new pb::MessageParser<UniqueId>(() => new UniqueId());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<UniqueId> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.UniqueIdReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId(UniqueId other) : this() {\n      lo_ = other.lo_;\n      hi_ = other.hi_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public UniqueId Clone() {\n      return new UniqueId(this);\n    }\n\n    /// <summary>Field number for the \"lo\" field.</summary>\n    public const int LoFieldNumber = 1;\n    private ulong lo_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Lo {\n      get { return lo_; }\n      set {\n        lo_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"hi\" field.</summary>\n    public const int HiFieldNumber = 2;\n    private ulong hi_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public ulong Hi {\n      get { return hi_; }\n      set {\n        hi_ = value;\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as UniqueId);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(UniqueId other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Lo != other.Lo) return false;\n      if (Hi != other.Hi) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Lo != 0UL) hash ^= Lo.GetHashCode();\n      if (Hi != 0UL) hash ^= Hi.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Lo != 0UL) {\n        output.WriteRawTag(9);\n        output.WriteFixed64(Lo);\n      }\n      if (Hi != 0UL) {\n        output.WriteRawTag(17);\n        output.WriteFixed64(Hi);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Lo != 0UL) {\n        size += 1 + 8;\n      }\n      if (Hi != 0UL) {\n        size += 1 + 8;\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(UniqueId other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Lo != 0UL) {\n        Lo = other.Lo;\n      }\n      if (other.Hi != 0UL) {\n        Hi = other.Hi;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 9: {\n            Lo = input.ReadFixed64();\n            break;\n          }\n          case 17: {\n            Hi = input.ReadFixed64();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/EchoClient.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\testing\\echo_client.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface IEchoClient: IClient {\n\t\tEchoClient.IEchoServiceProxy EchoService { get; }\n\t\t\n\t\tEchoClient.IGreetingServiceProxy GreetingService { get; }\n\t\t\n\t\tEchoClient.IAppLifecycleServiceProxy AppLifecycleService { get; }\n\t\t\n\t\tEchoClient.IContextLinkageServiceProxy ContextLinkageService { get; }\n\t}\n\t\n\tpublic sealed partial class EchoClient: ClientBase, IEchoClient {\n\t\t\n\t\tpublic const string Id = \"interop.testing.EchoClient\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t}\n\t\t\n\t\tpublic EchoClient(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t{ \n\t\t\tEchoService = new EchoClient.EchoServiceProxy(this.CallInvoker);\n\t\t\tGreetingService = new EchoClient.GreetingServiceProxy(this.CallInvoker);\n\t\t\tAppLifecycleService = new EchoClient.AppLifecycleServiceProxy(this.CallInvoker);\n\t\t\tContextLinkageService = new EchoClient.ContextLinkageServiceProxy(this.CallInvoker);\n\t\t}\n\t\t\n\t\tpublic partial interface IEchoServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IUnaryProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IServerStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IClientStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IDuplexStreamingProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class EchoServiceProxy: IEchoServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.EchoService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.EchoService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic EchoServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.UnaryMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ServerStreamingMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IClientStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ClientStreamingMethod);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDuplexStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> DuplexStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.DuplexStreamingMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEchoServiceProxy EchoService { get; private set; }\n\t\t\n\t\tpublic partial interface IGreetingServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.GreetingService.IHelloProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class GreetingServiceProxy: IGreetingServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.GreetingService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.GreetingService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic GreetingServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.HelloMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IGreetingServiceProxy GreetingService { get; private set; }\n\t\t\n\t\tpublic partial interface IAppLifecycleServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLifecycleService.IGetConnectionsProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLifecycleService.IGetConnectionsStreamProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class AppLifecycleServiceProxy: IAppLifecycleServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.AppLifecycleService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.AppLifecycleService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic AppLifecycleServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.GetConnectionsResponse> GetConnections(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetConnectionsMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.GetConnectionsEvent> GetConnectionsStream(global::Plexus.Interop.Testing.Generated.GetConnectionsRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetConnectionsStreamMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IAppLifecycleServiceProxy AppLifecycleService { get; private set; }\n\t\t\n\t\tpublic partial interface IContextLinkageServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IContextLoadedStreamProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.ICreateContext2Proxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IJoinContextProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetContextsProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetLinkedInvocationsProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetAllLinkedInvocationsProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class ContextLinkageServiceProxy: IContextLinkageServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.ContextLinkageService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.ContextLinkageService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic ContextLinkageServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate> ContextLoadedStream(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ContextLoadedStreamMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.Context> CreateContext2(global::Plexus.Interop.Testing.Generated.CreateContextRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.CreateContext2Method, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.JoinContextMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetContextsMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetLinkedInvocationsMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetAllLinkedInvocationsMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IContextLinkageServiceProxy ContextLinkageService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/EchoServer.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\testing\\echo_server.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface IEchoServerClient: IClient {\n\t\tEchoServerClient.IEchoServiceProxy EchoService { get; }\n\t\t\n\t\tEchoServerClient.IGreetingServiceProxy GreetingService { get; }\n\t}\n\t\n\tpublic sealed partial class EchoServerClient: ClientBase, IEchoServerClient {\n\t\t\n\t\tpublic const string Id = \"interop.testing.EchoServer\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(EchoServerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic EchoServerClient(\n\t\t\tEchoServerClient.IEchoServiceImpl echoService,\n\t\t\tEchoServerClient.IGreetingServiceImpl greetingService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new EchoServerClient.ServiceBinder(\n\t\t\techoService,\n\t\t\tgreetingService\n\t\t), setup) { }\n\t\t\n\t\tpublic EchoServerClient(EchoServerClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t\tEchoService = new EchoServerClient.EchoServiceProxy(this.CallInvoker);\n\t\t\tGreetingService = new EchoServerClient.GreetingServiceProxy(this.CallInvoker);\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tEchoServerClient.IEchoServiceImpl echoService,\n\t\t\t\tEchoServerClient.IGreetingServiceImpl greetingService\n\t\t\t) {\n\t\t\t\t_echoServiceBinder = new EchoServerClient.EchoServiceBinder(echoService);\n\t\t\t\t_greetingServiceBinder = new EchoServerClient.GreetingServiceBinder(greetingService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate EchoServiceBinder _echoServiceBinder;\n\t\t\tprivate GreetingServiceBinder _greetingServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _echoServiceBinder.Bind(builder);\n\t\t\t\tbuilder = _greetingServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface IEchoServiceImpl:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IUnaryImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IServerStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IClientStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IDuplexStreamingImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class EchoServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IEchoServiceImpl _impl;\n\t\t\t\n\t\t\tpublic EchoServiceBinder(IEchoServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Testing.Generated.EchoService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(global::Plexus.Interop.Testing.Generated.EchoService.UnaryMethodId, _impl.Unary);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(global::Plexus.Interop.Testing.Generated.EchoService.ServerStreamingMethodId, _impl.ServerStreaming);\n\t\t\t\tbuilder = builder.WithClientStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(global::Plexus.Interop.Testing.Generated.EchoService.ClientStreamingMethodId, _impl.ClientStreaming);\n\t\t\t\tbuilder = builder.WithDuplexStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(global::Plexus.Interop.Testing.Generated.EchoService.DuplexStreamingMethodId, _impl.DuplexStreaming);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class EchoServiceImpl: IEchoServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> _unaryHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> _serverStreamingHandler;\n\t\t\tprivate readonly ClientStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> _clientStreamingHandler;\n\t\t\tprivate readonly DuplexStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> _duplexStreamingHandler;\n\t\t\t\n\t\t\tpublic EchoServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> unaryHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> serverStreamingHandler,\n\t\t\t\tClientStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> clientStreamingHandler,\n\t\t\t\tDuplexStreamingMethodHandler<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> duplexStreamingHandler\n\t\t\t) {\n\t\t\t\t_unaryHandler = unaryHandler;\n\t\t\t\t_serverStreamingHandler = serverStreamingHandler;\n\t\t\t\t_clientStreamingHandler = clientStreamingHandler;\n\t\t\t\t_duplexStreamingHandler = duplexStreamingHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request, MethodCallContext context) {\n\t\t\t\treturn _unaryHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context) {\n\t\t\t\treturn _serverStreamingHandler(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, MethodCallContext context) {\n\t\t\t\treturn _clientStreamingHandler(requestStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task DuplexStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context) {\n\t\t\t\treturn _duplexStreamingHandler(requestStream, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class EchoServiceImpl<T>: IEchoServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IUnaryImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IServerStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IClientStreamingImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IDuplexStreamingImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic EchoServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.Unary(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.ServerStreaming(request, responseStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, MethodCallContext context) {\n\t\t\t\treturn _impl.ClientStreaming(requestStream, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task DuplexStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.DuplexStreaming(requestStream, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IGreetingServiceImpl:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.GreetingService.IHelloImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class GreetingServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IGreetingServiceImpl _impl;\n\t\t\t\n\t\t\tpublic GreetingServiceBinder(IGreetingServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Testing.Generated.GreetingService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse>(global::Plexus.Interop.Testing.Generated.GreetingService.HelloMethodId, _impl.Hello);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class GreetingServiceImpl: IGreetingServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse> _helloHandler;\n\t\t\t\n\t\t\tpublic GreetingServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse> helloHandler\n\t\t\t) {\n\t\t\t\t_helloHandler = helloHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request, MethodCallContext context) {\n\t\t\t\treturn _helloHandler(request, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class GreetingServiceImpl<T>: IGreetingServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.GreetingService.IHelloImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic GreetingServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.Hello(request, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IEchoServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IUnaryProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IServerStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IClientStreamingProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.EchoService.IDuplexStreamingProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class EchoServiceProxy: IEchoServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.EchoService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.EchoService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic EchoServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.UnaryMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ServerStreamingMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IClientStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ClientStreamingMethod);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDuplexStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> DuplexStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.DuplexStreamingMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEchoServiceProxy EchoService { get; private set; }\n\t\t\n\t\tpublic partial interface IGreetingServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.GreetingService.IHelloProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class GreetingServiceProxy: IGreetingServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.GreetingService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.GreetingService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic GreetingServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.HelloMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IGreetingServiceProxy GreetingService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/EchoService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/testing/echo_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/testing/echo_service.proto</summary>\n  public static partial class EchoServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/testing/echo_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static EchoServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiJpbnRlcm9wL3Rlc3RpbmcvZWNob19zZXJ2aWNlLnByb3RvEg9pbnRlcm9w\",\n            \"LnRlc3RpbmcaFWludGVyb3Avb3B0aW9ucy5wcm90byLnAwoLRWNob1JlcXVl\",\n            \"c3QSFAoMc3RyaW5nX2ZpZWxkGAEgASgJEhMKC2ludDY0X2ZpZWxkGAIgASgD\",\n            \"EhQKDHVpbnQzMl9maWVsZBgDIAEoDRIdChVyZXBlYXRlZF9kb3VibGVfZmll\",\n            \"bGQYBCADKAESOAoKZW51bV9maWVsZBgFIAEoDjIkLmludGVyb3AudGVzdGlu\",\n            \"Zy5FY2hvUmVxdWVzdC5TdWJFbnVtEkIKEXN1Yl9tZXNzYWdlX2ZpZWxkGAYg\",\n            \"ASgLMicuaW50ZXJvcC50ZXN0aW5nLkVjaG9SZXF1ZXN0LlN1Yk1lc3NhZ2US\",\n            \"SwoacmVwZWF0ZWRfc3ViX21lc3NhZ2VfZmllbGQYByADKAsyJy5pbnRlcm9w\",\n            \"LnRlc3RpbmcuRWNob1JlcXVlc3QuU3ViTWVzc2FnZRpjCgpTdWJNZXNzYWdl\",\n            \"EhMKC2J5dGVzX2ZpZWxkGAEgASgMEhQKDHN0cmluZ19maWVsZBgCIAEoCToq\",\n            \"ktsEJmludGVyb3AudGVzdGluZy5FY2hvUmVxdWVzdC5TdWJNZXNzYWdlIicK\",\n            \"B1N1YkVudW0SDQoJVkFMVUVfT05FEAASDQoJVkFMVUVfVFdPEAE6H5LbBBtp\",\n            \"bnRlcm9wLnRlc3RpbmcuRWNob1JlcXVlc3Qy6AIKC0VjaG9TZXJ2aWNlEkMK\",\n            \"BVVuYXJ5EhwuaW50ZXJvcC50ZXN0aW5nLkVjaG9SZXF1ZXN0GhwuaW50ZXJv\",\n            \"cC50ZXN0aW5nLkVjaG9SZXF1ZXN0Ek8KD1NlcnZlclN0cmVhbWluZxIcLmlu\",\n            \"dGVyb3AudGVzdGluZy5FY2hvUmVxdWVzdBocLmludGVyb3AudGVzdGluZy5F\",\n            \"Y2hvUmVxdWVzdDABEk8KD0NsaWVudFN0cmVhbWluZxIcLmludGVyb3AudGVz\",\n            \"dGluZy5FY2hvUmVxdWVzdBocLmludGVyb3AudGVzdGluZy5FY2hvUmVxdWVz\",\n            \"dCgBElEKD0R1cGxleFN0cmVhbWluZxIcLmludGVyb3AudGVzdGluZy5FY2hv\",\n            \"UmVxdWVzdBocLmludGVyb3AudGVzdGluZy5FY2hvUmVxdWVzdCgBMAEaH5Lb\",\n            \"BBtpbnRlcm9wLnRlc3RpbmcuRWNob1NlcnZpY2VCI6oCIFBsZXh1cy5JbnRl\",\n            \"cm9wLlRlc3RpbmcuR2VuZXJhdGVkYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.EchoRequest), global::Plexus.Interop.Testing.Generated.EchoRequest.Parser, new[]{ \"StringField\", \"Int64Field\", \"Uint32Field\", \"RepeatedDoubleField\", \"EnumField\", \"SubMessageField\", \"RepeatedSubMessageField\" }, null, new[]{ typeof(global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage), global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage.Parser, new[]{ \"BytesField\", \"StringField\" }, null, null, null, null)})\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class EchoRequest : pb::IMessage<EchoRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<EchoRequest> _parser = new pb::MessageParser<EchoRequest>(() => new EchoRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<EchoRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.EchoServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EchoRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EchoRequest(EchoRequest other) : this() {\n      stringField_ = other.stringField_;\n      int64Field_ = other.int64Field_;\n      uint32Field_ = other.uint32Field_;\n      repeatedDoubleField_ = other.repeatedDoubleField_.Clone();\n      enumField_ = other.enumField_;\n      subMessageField_ = other.subMessageField_ != null ? other.subMessageField_.Clone() : null;\n      repeatedSubMessageField_ = other.repeatedSubMessageField_.Clone();\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public EchoRequest Clone() {\n      return new EchoRequest(this);\n    }\n\n    /// <summary>Field number for the \"string_field\" field.</summary>\n    public const int StringFieldFieldNumber = 1;\n    private string stringField_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string StringField {\n      get { return stringField_; }\n      set {\n        stringField_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    /// <summary>Field number for the \"int64_field\" field.</summary>\n    public const int Int64FieldFieldNumber = 2;\n    private long int64Field_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public long Int64Field {\n      get { return int64Field_; }\n      set {\n        int64Field_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"uint32_field\" field.</summary>\n    public const int Uint32FieldFieldNumber = 3;\n    private uint uint32Field_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public uint Uint32Field {\n      get { return uint32Field_; }\n      set {\n        uint32Field_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"repeated_double_field\" field.</summary>\n    public const int RepeatedDoubleFieldFieldNumber = 4;\n    private static readonly pb::FieldCodec<double> _repeated_repeatedDoubleField_codec\n        = pb::FieldCodec.ForDouble(34);\n    private readonly pbc::RepeatedField<double> repeatedDoubleField_ = new pbc::RepeatedField<double>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<double> RepeatedDoubleField {\n      get { return repeatedDoubleField_; }\n    }\n\n    /// <summary>Field number for the \"enum_field\" field.</summary>\n    public const int EnumFieldFieldNumber = 5;\n    private global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum enumField_ = global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum EnumField {\n      get { return enumField_; }\n      set {\n        enumField_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"sub_message_field\" field.</summary>\n    public const int SubMessageFieldFieldNumber = 6;\n    private global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage subMessageField_;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage SubMessageField {\n      get { return subMessageField_; }\n      set {\n        subMessageField_ = value;\n      }\n    }\n\n    /// <summary>Field number for the \"repeated_sub_message_field\" field.</summary>\n    public const int RepeatedSubMessageFieldFieldNumber = 7;\n    private static readonly pb::FieldCodec<global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage> _repeated_repeatedSubMessageField_codec\n        = pb::FieldCodec.ForMessage(58, global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage.Parser);\n    private readonly pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage> repeatedSubMessageField_ = new pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage>();\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public pbc::RepeatedField<global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage> RepeatedSubMessageField {\n      get { return repeatedSubMessageField_; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as EchoRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(EchoRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (StringField != other.StringField) return false;\n      if (Int64Field != other.Int64Field) return false;\n      if (Uint32Field != other.Uint32Field) return false;\n      if(!repeatedDoubleField_.Equals(other.repeatedDoubleField_)) return false;\n      if (EnumField != other.EnumField) return false;\n      if (!object.Equals(SubMessageField, other.SubMessageField)) return false;\n      if(!repeatedSubMessageField_.Equals(other.repeatedSubMessageField_)) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (StringField.Length != 0) hash ^= StringField.GetHashCode();\n      if (Int64Field != 0L) hash ^= Int64Field.GetHashCode();\n      if (Uint32Field != 0) hash ^= Uint32Field.GetHashCode();\n      hash ^= repeatedDoubleField_.GetHashCode();\n      if (EnumField != global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne) hash ^= EnumField.GetHashCode();\n      if (subMessageField_ != null) hash ^= SubMessageField.GetHashCode();\n      hash ^= repeatedSubMessageField_.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (StringField.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(StringField);\n      }\n      if (Int64Field != 0L) {\n        output.WriteRawTag(16);\n        output.WriteInt64(Int64Field);\n      }\n      if (Uint32Field != 0) {\n        output.WriteRawTag(24);\n        output.WriteUInt32(Uint32Field);\n      }\n      repeatedDoubleField_.WriteTo(output, _repeated_repeatedDoubleField_codec);\n      if (EnumField != global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) EnumField);\n      }\n      if (subMessageField_ != null) {\n        output.WriteRawTag(50);\n        output.WriteMessage(SubMessageField);\n      }\n      repeatedSubMessageField_.WriteTo(output, _repeated_repeatedSubMessageField_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (StringField.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(StringField);\n      }\n      if (Int64Field != 0L) {\n        output.WriteRawTag(16);\n        output.WriteInt64(Int64Field);\n      }\n      if (Uint32Field != 0) {\n        output.WriteRawTag(24);\n        output.WriteUInt32(Uint32Field);\n      }\n      repeatedDoubleField_.WriteTo(ref output, _repeated_repeatedDoubleField_codec);\n      if (EnumField != global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne) {\n        output.WriteRawTag(40);\n        output.WriteEnum((int) EnumField);\n      }\n      if (subMessageField_ != null) {\n        output.WriteRawTag(50);\n        output.WriteMessage(SubMessageField);\n      }\n      repeatedSubMessageField_.WriteTo(ref output, _repeated_repeatedSubMessageField_codec);\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (StringField.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(StringField);\n      }\n      if (Int64Field != 0L) {\n        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Int64Field);\n      }\n      if (Uint32Field != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Uint32Field);\n      }\n      size += repeatedDoubleField_.CalculateSize(_repeated_repeatedDoubleField_codec);\n      if (EnumField != global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne) {\n        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumField);\n      }\n      if (subMessageField_ != null) {\n        size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubMessageField);\n      }\n      size += repeatedSubMessageField_.CalculateSize(_repeated_repeatedSubMessageField_codec);\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(EchoRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.StringField.Length != 0) {\n        StringField = other.StringField;\n      }\n      if (other.Int64Field != 0L) {\n        Int64Field = other.Int64Field;\n      }\n      if (other.Uint32Field != 0) {\n        Uint32Field = other.Uint32Field;\n      }\n      repeatedDoubleField_.Add(other.repeatedDoubleField_);\n      if (other.EnumField != global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum.ValueOne) {\n        EnumField = other.EnumField;\n      }\n      if (other.subMessageField_ != null) {\n        if (subMessageField_ == null) {\n          SubMessageField = new global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage();\n        }\n        SubMessageField.MergeFrom(other.SubMessageField);\n      }\n      repeatedSubMessageField_.Add(other.repeatedSubMessageField_);\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            StringField = input.ReadString();\n            break;\n          }\n          case 16: {\n            Int64Field = input.ReadInt64();\n            break;\n          }\n          case 24: {\n            Uint32Field = input.ReadUInt32();\n            break;\n          }\n          case 34:\n          case 33: {\n            repeatedDoubleField_.AddEntriesFrom(input, _repeated_repeatedDoubleField_codec);\n            break;\n          }\n          case 40: {\n            EnumField = (global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum) input.ReadEnum();\n            break;\n          }\n          case 50: {\n            if (subMessageField_ == null) {\n              SubMessageField = new global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage();\n            }\n            input.ReadMessage(SubMessageField);\n            break;\n          }\n          case 58: {\n            repeatedSubMessageField_.AddEntriesFrom(input, _repeated_repeatedSubMessageField_codec);\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            StringField = input.ReadString();\n            break;\n          }\n          case 16: {\n            Int64Field = input.ReadInt64();\n            break;\n          }\n          case 24: {\n            Uint32Field = input.ReadUInt32();\n            break;\n          }\n          case 34:\n          case 33: {\n            repeatedDoubleField_.AddEntriesFrom(ref input, _repeated_repeatedDoubleField_codec);\n            break;\n          }\n          case 40: {\n            EnumField = (global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubEnum) input.ReadEnum();\n            break;\n          }\n          case 50: {\n            if (subMessageField_ == null) {\n              SubMessageField = new global::Plexus.Interop.Testing.Generated.EchoRequest.Types.SubMessage();\n            }\n            input.ReadMessage(SubMessageField);\n            break;\n          }\n          case 58: {\n            repeatedSubMessageField_.AddEntriesFrom(ref input, _repeated_repeatedSubMessageField_codec);\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n    #region Nested types\n    /// <summary>Container for nested types declared in the EchoRequest message type.</summary>\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static partial class Types {\n      public enum SubEnum {\n        [pbr::OriginalName(\"VALUE_ONE\")] ValueOne = 0,\n        [pbr::OriginalName(\"VALUE_TWO\")] ValueTwo = 1,\n      }\n\n      public sealed partial class SubMessage : pb::IMessage<SubMessage>\n      #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n          , pb::IBufferMessage\n      #endif\n      {\n        private static readonly pb::MessageParser<SubMessage> _parser = new pb::MessageParser<SubMessage>(() => new SubMessage());\n        private pb::UnknownFieldSet _unknownFields;\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public static pb::MessageParser<SubMessage> Parser { get { return _parser; } }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public static pbr::MessageDescriptor Descriptor {\n          get { return global::Plexus.Interop.Testing.Generated.EchoRequest.Descriptor.NestedTypes[0]; }\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        pbr::MessageDescriptor pb::IMessage.Descriptor {\n          get { return Descriptor; }\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public SubMessage() {\n          OnConstruction();\n        }\n\n        partial void OnConstruction();\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public SubMessage(SubMessage other) : this() {\n          bytesField_ = other.bytesField_;\n          stringField_ = other.stringField_;\n          _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public SubMessage Clone() {\n          return new SubMessage(this);\n        }\n\n        /// <summary>Field number for the \"bytes_field\" field.</summary>\n        public const int BytesFieldFieldNumber = 1;\n        private pb::ByteString bytesField_ = pb::ByteString.Empty;\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public pb::ByteString BytesField {\n          get { return bytesField_; }\n          set {\n            bytesField_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n          }\n        }\n\n        /// <summary>Field number for the \"string_field\" field.</summary>\n        public const int StringFieldFieldNumber = 2;\n        private string stringField_ = \"\";\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public string StringField {\n          get { return stringField_; }\n          set {\n            stringField_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n          }\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public override bool Equals(object other) {\n          return Equals(other as SubMessage);\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public bool Equals(SubMessage other) {\n          if (ReferenceEquals(other, null)) {\n            return false;\n          }\n          if (ReferenceEquals(other, this)) {\n            return true;\n          }\n          if (BytesField != other.BytesField) return false;\n          if (StringField != other.StringField) return false;\n          return Equals(_unknownFields, other._unknownFields);\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public override int GetHashCode() {\n          int hash = 1;\n          if (BytesField.Length != 0) hash ^= BytesField.GetHashCode();\n          if (StringField.Length != 0) hash ^= StringField.GetHashCode();\n          if (_unknownFields != null) {\n            hash ^= _unknownFields.GetHashCode();\n          }\n          return hash;\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public override string ToString() {\n          return pb::JsonFormatter.ToDiagnosticString(this);\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public void WriteTo(pb::CodedOutputStream output) {\n        #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n          output.WriteRawMessage(this);\n        #else\n          if (BytesField.Length != 0) {\n            output.WriteRawTag(10);\n            output.WriteBytes(BytesField);\n          }\n          if (StringField.Length != 0) {\n            output.WriteRawTag(18);\n            output.WriteString(StringField);\n          }\n          if (_unknownFields != null) {\n            _unknownFields.WriteTo(output);\n          }\n        #endif\n        }\n\n        #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n          if (BytesField.Length != 0) {\n            output.WriteRawTag(10);\n            output.WriteBytes(BytesField);\n          }\n          if (StringField.Length != 0) {\n            output.WriteRawTag(18);\n            output.WriteString(StringField);\n          }\n          if (_unknownFields != null) {\n            _unknownFields.WriteTo(ref output);\n          }\n        }\n        #endif\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public int CalculateSize() {\n          int size = 0;\n          if (BytesField.Length != 0) {\n            size += 1 + pb::CodedOutputStream.ComputeBytesSize(BytesField);\n          }\n          if (StringField.Length != 0) {\n            size += 1 + pb::CodedOutputStream.ComputeStringSize(StringField);\n          }\n          if (_unknownFields != null) {\n            size += _unknownFields.CalculateSize();\n          }\n          return size;\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public void MergeFrom(SubMessage other) {\n          if (other == null) {\n            return;\n          }\n          if (other.BytesField.Length != 0) {\n            BytesField = other.BytesField;\n          }\n          if (other.StringField.Length != 0) {\n            StringField = other.StringField;\n          }\n          _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n        }\n\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        public void MergeFrom(pb::CodedInputStream input) {\n        #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n          input.ReadRawMessage(this);\n        #else\n          uint tag;\n          while ((tag = input.ReadTag()) != 0) {\n            switch(tag) {\n              default:\n                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n                break;\n              case 10: {\n                BytesField = input.ReadBytes();\n                break;\n              }\n              case 18: {\n                StringField = input.ReadString();\n                break;\n              }\n            }\n          }\n        #endif\n        }\n\n        #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n        [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n        void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n          uint tag;\n          while ((tag = input.ReadTag()) != 0) {\n            switch(tag) {\n              default:\n                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n                break;\n              case 10: {\n                BytesField = input.ReadBytes();\n                break;\n              }\n              case 18: {\n                StringField = input.ReadString();\n                break;\n              }\n            }\n          }\n        }\n        #endif\n\n      }\n\n    }\n    #endregion\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/EchoService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\testing\\echo_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class EchoService {\n\t\t\n\t\tpublic const string Id = \"interop.testing.EchoService\";\t\t\t\n\t\tpublic const string UnaryMethodId = \"Unary\";\n\t\tpublic const string ServerStreamingMethodId = \"ServerStreaming\";\n\t\tpublic const string ClientStreamingMethodId = \"ClientStreaming\";\n\t\tpublic const string DuplexStreamingMethodId = \"DuplexStreaming\";\n\t\t\n\t\tpublic static readonly EchoService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static EchoService.Descriptor CreateDescriptor() {\n\t\t\treturn new EchoService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static EchoService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new EchoService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IUnaryProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingProxy {\n\t\t\tIServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest> ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingProxy {\n\t\t\tIClientStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingProxy {\n\t\t\tIDuplexStreamingMethodCall<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> DuplexStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IUnaryImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.EchoRequest> Unary(global::Plexus.Interop.Testing.Generated.EchoRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingImpl {\n\t\t\tTask ServerStreaming(global::Plexus.Interop.Testing.Generated.EchoRequest request, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingImpl {\n\t\t\tTask DuplexStreaming(IReadableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> requestStream, IWritableChannel<global::Plexus.Interop.Testing.Generated.EchoRequest> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> UnaryMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> ServerStreamingMethod {get; private set; }\n\t\t\tpublic ClientStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> ClientStreamingMethod {get; private set; }\n\t\t\tpublic DuplexStreamingMethod<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest> DuplexStreamingMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, DuplexStreamingMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tUnaryMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, alias, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, alias, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, alias, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::Plexus.Interop.Testing.Generated.EchoRequest, global::Plexus.Interop.Testing.Generated.EchoRequest>(Id, alias, DuplexStreamingMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/GreetingService.msg.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/testing/greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace Plexus.Interop.Testing.Generated {\n\n  /// <summary>Holder for reflection information generated from interop/testing/greeting_service.proto</summary>\n  public static partial class GreetingServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/testing/greeting_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static GreetingServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL3Rlc3RpbmcvZ3JlZXRpbmdfc2VydmljZS5wcm90bxIPaW50\",\n            \"ZXJvcC50ZXN0aW5nGhVpbnRlcm9wL29wdGlvbnMucHJvdG8iRAoPR3JlZXRp\",\n            \"bmdSZXF1ZXN0EgwKBG5hbWUYASABKAk6I5LbBB9pbnRlcm9wLnRlc3Rpbmcu\",\n            \"R3JlZXRpbmdSZXF1ZXN0IkoKEEdyZWV0aW5nUmVzcG9uc2USEAoIZ3JlZXRp\",\n            \"bmcYASABKAk6JJLbBCBpbnRlcm9wLnRlc3RpbmcuR3JlZXRpbmdSZXNwb25z\",\n            \"ZTKEAQoPR3JlZXRpbmdTZXJ2aWNlEkwKBUhlbGxvEiAuaW50ZXJvcC50ZXN0\",\n            \"aW5nLkdyZWV0aW5nUmVxdWVzdBohLmludGVyb3AudGVzdGluZy5HcmVldGlu\",\n            \"Z1Jlc3BvbnNlGiOS2wQfaW50ZXJvcC50ZXN0aW5nLkdyZWV0aW5nU2Vydmlj\",\n            \"ZUIjqgIgUGxleHVzLkludGVyb3AuVGVzdGluZy5HZW5lcmF0ZWRiBnByb3Rv\",\n            \"Mw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::Plexus.Interop.Testing.Generated.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.GreetingRequest), global::Plexus.Interop.Testing.Generated.GreetingRequest.Parser, new[]{ \"Name\" }, null, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::Plexus.Interop.Testing.Generated.GreetingResponse), global::Plexus.Interop.Testing.Generated.GreetingResponse.Parser, new[]{ \"Greeting\" }, null, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class GreetingRequest : pb::IMessage<GreetingRequest>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GreetingRequest> _parser = new pb::MessageParser<GreetingRequest>(() => new GreetingRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GreetingRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.GreetingServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingRequest(GreetingRequest other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingRequest Clone() {\n      return new GreetingRequest(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GreetingRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GreetingRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  public sealed partial class GreetingResponse : pb::IMessage<GreetingResponse>\n  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      , pb::IBufferMessage\n  #endif\n  {\n    private static readonly pb::MessageParser<GreetingResponse> _parser = new pb::MessageParser<GreetingResponse>(() => new GreetingResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pb::MessageParser<GreetingResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::Plexus.Interop.Testing.Generated.GreetingServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingResponse(GreetingResponse other) : this() {\n      greeting_ = other.greeting_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public GreetingResponse Clone() {\n      return new GreetingResponse(this);\n    }\n\n    /// <summary>Field number for the \"greeting\" field.</summary>\n    public const int GreetingFieldNumber = 1;\n    private string greeting_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public string Greeting {\n      get { return greeting_; }\n      set {\n        greeting_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public bool Equals(GreetingResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Greeting != other.Greeting) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Greeting.Length != 0) hash ^= Greeting.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void WriteTo(pb::CodedOutputStream output) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      output.WriteRawMessage(this);\n    #else\n      if (Greeting.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Greeting);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n      if (Greeting.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Greeting);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(ref output);\n      }\n    }\n    #endif\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public int CalculateSize() {\n      int size = 0;\n      if (Greeting.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Greeting);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(GreetingResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Greeting.Length != 0) {\n        Greeting = other.Greeting;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    public void MergeFrom(pb::CodedInputStream input) {\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n      input.ReadRawMessage(this);\n    #else\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Greeting = input.ReadString();\n            break;\n          }\n        }\n      }\n    #endif\n    }\n\n    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    [global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);\n            break;\n          case 10: {\n            Greeting = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n    #endif\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/GreetingService.svc.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\testing\\greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class GreetingService {\n\t\t\n\t\tpublic const string Id = \"interop.testing.GreetingService\";\t\t\t\n\t\tpublic const string HelloMethodId = \"Hello\";\n\t\t\n\t\tpublic static readonly GreetingService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor() {\n\t\t\treturn new GreetingService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new GreetingService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IHelloProxy {\n\t\t\tIUnaryMethodCall<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IHelloImpl {\n\t\t\tTask<global::Plexus.Interop.Testing.Generated.GreetingResponse> Hello(global::Plexus.Interop.Testing.Generated.GreetingRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse> HelloMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tHelloMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse>(Id, HelloMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tHelloMethod = Method.Unary<global::Plexus.Interop.Testing.Generated.GreetingRequest, global::Plexus.Interop.Testing.Generated.GreetingResponse>(Id, alias, HelloMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Generated/interop/testing/TestAppLauncher.app.g.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\testing\\test_app_launcher.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace Plexus.Interop.Testing.Generated {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface ITestAppLauncherClient: IClient {\n\t\tTestAppLauncherClient.IContextLinkageServiceProxy ContextLinkageService { get; }\n\t\t\n\t\tTestAppLauncherClient.IAppLifecycleServiceProxy AppLifecycleService { get; }\n\t\t\n\t\tTestAppLauncherClient.IAppRegistrationServiceProxy AppRegistrationService { get; }\n\t}\n\t\n\tpublic sealed partial class TestAppLauncherClient: ClientBase, ITestAppLauncherClient {\n\t\t\n\t\tpublic const string Id = \"interop.testing.TestAppLauncher\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(TestAppLauncherClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tserviceBinder.Bind(builder);\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\n\t\t\treturn builder.Build();\n\t\t}\n\t\t\n\t\tpublic TestAppLauncherClient(\n\t\t\tTestAppLauncherClient.IAppLauncherServiceImpl appLauncherService,\n\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t)\n\t\t:this(new TestAppLauncherClient.ServiceBinder(\n\t\t\tappLauncherService\n\t\t), setup) { }\n\t\t\n\t\tpublic TestAppLauncherClient(TestAppLauncherClient.ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t{\n\t\t\tContextLinkageService = new TestAppLauncherClient.ContextLinkageServiceProxy(this.CallInvoker);\n\t\t\tAppLifecycleService = new TestAppLauncherClient.AppLifecycleServiceProxy(this.CallInvoker);\n\t\t\tAppRegistrationService = new TestAppLauncherClient.AppRegistrationServiceProxy(this.CallInvoker);\n\t\t}\n\t\n\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\n\t\t\tpublic ServiceBinder(\n\t\t\t\tTestAppLauncherClient.IAppLauncherServiceImpl appLauncherService\n\t\t\t) {\n\t\t\t\t_appLauncherServiceBinder = new TestAppLauncherClient.AppLauncherServiceBinder(appLauncherService);\n\t\t\t}\n\t\t\t\n\t\t\tprivate AppLauncherServiceBinder _appLauncherServiceBinder;\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\tbuilder = _appLauncherServiceBinder.Bind(builder);\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic partial interface IAppLauncherServiceImpl:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLauncherService.ILaunchImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLauncherService.IAppLaunchedEventStreamImpl\n\t\t{ }\n\t\t\n\t\tprivate sealed partial class AppLauncherServiceBinder {\n\t\t\t\n\t\t\t\n\t\t\tprivate readonly IAppLauncherServiceImpl _impl;\n\t\t\t\n\t\t\tpublic AppLauncherServiceBinder(IAppLauncherServiceImpl impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\treturn builder.WithProvidedService(global::Plexus.Interop.Testing.Generated.AppLauncherService.Id, Bind);\n\t\t\t}\n\t\t\t\n\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\tbuilder = builder.WithUnaryMethod<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse>(global::Plexus.Interop.Testing.Generated.AppLauncherService.LaunchMethodId, _impl.Launch);\n\t\t\t\tbuilder = builder.WithServerStreamingMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent>(global::Plexus.Interop.Testing.Generated.AppLauncherService.AppLaunchedEventStreamMethodId, _impl.AppLaunchedEventStream);\n\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic sealed partial class AppLauncherServiceImpl: IAppLauncherServiceImpl\n\t\t{\n\t\t\tprivate readonly UnaryMethodHandler<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse> _launchHandler;\n\t\t\tprivate readonly ServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> _appLaunchedEventStreamHandler;\n\t\t\t\n\t\t\tpublic AppLauncherServiceImpl(\n\t\t\t\tUnaryMethodHandler<global::Plexus.Interop.Testing.Generated.AppLaunchRequest, global::Plexus.Interop.Testing.Generated.AppLaunchResponse> launchHandler,\n\t\t\t\tServerStreamingMethodHandler<global::Google.Protobuf.WellKnownTypes.Empty, global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> appLaunchedEventStreamHandler\n\t\t\t) {\n\t\t\t\t_launchHandler = launchHandler;\n\t\t\t\t_appLaunchedEventStreamHandler = appLaunchedEventStreamHandler;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Testing.Generated.AppLaunchRequest request, MethodCallContext context) {\n\t\t\t\treturn _launchHandler(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _appLaunchedEventStreamHandler(request, responseStream, context);\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\t\n\t\tpublic sealed partial class AppLauncherServiceImpl<T>: IAppLauncherServiceImpl\n\t\t\twhere T:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLauncherService.ILaunchImpl,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLauncherService.IAppLaunchedEventStreamImpl\n\t\t{\n\t\t\tprivate readonly T _impl;\n\t\t\t\n\t\t\tpublic AppLauncherServiceImpl(T impl) {\n\t\t\t\t_impl = impl;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task<global::Plexus.Interop.Testing.Generated.AppLaunchResponse> Launch(global::Plexus.Interop.Testing.Generated.AppLaunchRequest request, MethodCallContext context) {\n\t\t\t\treturn _impl.Launch(request, context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic Task AppLaunchedEventStream(global::Google.Protobuf.WellKnownTypes.Empty request, IWritableChannel<global::Plexus.Interop.Testing.Generated.AppLaunchedEvent> responseStream, MethodCallContext context) {\n\t\t\t\treturn _impl.AppLaunchedEventStream(request, responseStream, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial interface IContextLinkageServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IContextLoadedStreamProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.ICreateContextProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IJoinContextProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetContextsProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetLinkedInvocationsProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.ContextLinkageService.IGetAllLinkedInvocationsProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class ContextLinkageServiceProxy: IContextLinkageServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.ContextLinkageService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.ContextLinkageService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic ContextLinkageServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.ContextLoadingUpdate> ContextLoadedStream(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ContextLoadedStreamMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.Context> CreateContext(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.CreateContextMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Google.Protobuf.WellKnownTypes.Empty> JoinContext(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.JoinContextMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextsList> GetContexts(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetContextsMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.InvocationsList> GetLinkedInvocations(global::Plexus.Interop.Testing.Generated.Context request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetLinkedInvocationsMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.ContextToInvocationsList> GetAllLinkedInvocations(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetAllLinkedInvocationsMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IContextLinkageServiceProxy ContextLinkageService { get; private set; }\n\t\t\n\t\tpublic partial interface IAppLifecycleServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLifecycleService.IGetLifecycleEventStreamProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppLifecycleService.IGetInvocationEventStreamProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class AppLifecycleServiceProxy: IAppLifecycleServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.AppLifecycleService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.AppLifecycleService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic AppLifecycleServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.AppLifecycleEvent> GetLifecycleEventStream(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetLifecycleEventStreamMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::Plexus.Interop.Testing.Generated.InvocationEvent> GetInvocationEventStream(global::Google.Protobuf.WellKnownTypes.Empty request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.GetInvocationEventStreamMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IAppLifecycleServiceProxy AppLifecycleService { get; private set; }\n\t\t\n\t\tpublic partial interface IAppRegistrationServiceProxy:\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppRegistrationService.IRequestInstanceIdProxy,\n\t\t\tglobal::Plexus.Interop.Testing.Generated.AppRegistrationService.IRegisterInstanceIdProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class AppRegistrationServiceProxy: IAppRegistrationServiceProxy {\n\t\t\t\n\t\t\tpublic static global::Plexus.Interop.Testing.Generated.AppRegistrationService.Descriptor Descriptor = global::Plexus.Interop.Testing.Generated.AppRegistrationService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic AppRegistrationServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.UniqueId> RequestInstanceId(global::Plexus.Interop.Testing.Generated.RequestInstanceIdRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.RequestInstanceIdMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::Plexus.Interop.Testing.Generated.RegisterInstanceIdResponse> RegisterInstanceId(global::Plexus.Interop.Testing.Generated.RegisterInstanceIdRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.RegisterInstanceIdMethod, request);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IAppRegistrationServiceProxy AppRegistrationService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/ITestBroker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Testing\n{\n    using System;\n    using System.Threading.Tasks;\n\n    public interface ITestBroker : IDisposable\n    {\n        string WorkingDir { get; }\n\n        Task Completion { get; }\n\n        Task StartAsync();\n\n        Task StopAsync();        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/NLog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"true\"\n      internalLogFile=\"logs/nlog.log\"\n      internalLogLevel=\"Warn\"\n      >\n\n  <extensions>\n    <add assembly=\"Plexus.Logging.NLog\"/>\n  </extensions>\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception:${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${workDir}/logs/\"/>\n\n  <targets async=\"true\">\n    <target xsi:type=\"File\"\n            name=\"FileTarget\"\n            deleteOldFileOnStartup=\"true\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/plexus.log\"\n            keepFileOpen=\"false\"\n            maxArchiveFiles=\"0\"\n    />\n  </targets>\n  <rules>\n    <logger name=\"*\" writeTo=\"FileTarget\" minlevel=\"Debug\" />\n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/ObservableExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Testing\n{\n    using System;\n    using System.Reactive;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Reactive.Threading.Tasks;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    public static class ObservableExtensions\n    {\n        public static Task PipeAsync<T>(\n            this IObservable<T> observable,\n            IWritableChannel<T> writableChannel,\n            CancellationToken cancellationToken = default(CancellationToken),\n            TimeSpan sendTimeout = default(TimeSpan))\n        {\n            return observable\n                .SelectMany(arg => WriteAsync(writableChannel, arg, cancellationToken, sendTimeout).ToObservable())\n                .Concat(Observable.Return(Unit.Default))\n                .ToTask(cancellationToken);\n        }\n\n        private static async Task WriteAsync<T>(\n            IWritableChannel<T> channel,\n            T arg,\n            CancellationToken cancellationToken,\n            TimeSpan sendTimeout)\n        {\n            using (var timeoutCancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            {\n                if (sendTimeout > TimeSpan.Zero)\n                {\n                    // Cancel sending after timeout\n                    timeoutCancellation.CancelAfter(sendTimeout);\n                }\n\n                await channel.WriteAsync(arg, timeoutCancellation.Token).ConfigureAwait(false);\n            }\n        }\n\n        public static Task PipeAsync<T>(\n            this IReadableChannel<T> readableChannel,\n            IObserver<T> observer,\n            CancellationToken cancellationToken = default(CancellationToken),\n            bool sendCompete = false,\n            bool sendException = false)\n        {\n            return readableChannel.ConsumeAsync(obj => observer.OnNext(obj), cancellationToken, () =>\n            {\n                if (sendCompete)\n                {\n                    observer.OnCompleted();\n                }\n                return TaskHelper.CompletedTask;\n            }, exception =>\n            {\n                if (sendException)\n                {\n                    observer.OnError(exception);\n                }\n                return TaskHelper.FromException(exception);\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Plexus.Interop.Testing.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n    <AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <None Remove=\"TestBrokerConfig\\metadata\\apps.json\" />\n    <None Remove=\"TestBrokerConfig\\metadata\\interop.json\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Include=\"TestBrokerConfig\\metadata\\apps.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"TestBrokerConfig\\metadata\\interop.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </EmbeddedResource>\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.20.1\" />\n    <PackageReference Include=\"System.Reactive.Linq\" Version=\"3.1.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"nlog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Update=\"TestBrokerConfig\\NLog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/Properties/AssemblyInfo.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Tests\")]"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestAppLauncher.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Testing\n{\n    using Plexus.Interop.Testing.Generated;\n    using Plexus.Processes;\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n    using UniqueId = Plexus.UniqueId;\n\n    internal sealed class TestAppLauncher : ProcessBase, TestAppLauncherClient.IAppLauncherServiceImpl\n    {\n        public static readonly UniqueId LauncherAppInstanceId = UniqueId.FromString(\"C1EC24C635D744E48AC27740360D235E\");\n        public static readonly UniqueId EchoServiceAppInstanceId = UniqueId.FromString(\"1D9CBA35139E4126950839DBF0FEC928\");\n\n        private readonly ITestBroker _broker;\n        private readonly Dictionary<string, TestClientFactory> _clientFactories;\n        private readonly bool _connectClients;\n        private readonly ITestAppLauncherClient _client;\n\n        private readonly object _sync = new object();\n\n        private readonly Dictionary<string, List<Task<IClient>>> _createClientTasks\n            = new Dictionary<string, List<Task<IClient>>>();\n\n        private readonly Dictionary<string, List<IClient>> _createdClients\n            = new Dictionary<string, List<IClient>>();\n\n        private readonly ReplaySubject<AppLaunchedEvent> _appLaunchedEvents = new ReplaySubject<AppLaunchedEvent>(5);\n\n        public TestAppLauncher(ITestBroker broker, Dictionary<string, TestClientFactory> clientFactories, bool connectClients = true)\n        {\n            _broker = broker;\n            _clientFactories = clientFactories;\n            _connectClients = connectClients;\n            _client = new TestAppLauncherClient(this, s => s\n               .WithBrokerWorkingDir(broker.WorkingDir)\n               .WithAppInstanceId(LauncherAppInstanceId));\n            OnStop(_client.Disconnect);\n        }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            await _client.ConnectAsync().ConfigureAwait(false);\n            await _client.AppRegistrationService.RegisterInstanceId(new RegisterInstanceIdRequest { AppInstanceId = EchoServiceAppInstanceId });\n            return _client.Completion;\n        }\n\n        public async Task<AppLaunchResponse> Launch(AppLaunchRequest request, MethodCallContext context)\n        {\n            var appId = request.AppId;\n            var suggestedAppInstanceId = UniqueId.FromHiLo(\n                request.SuggestedAppInstanceId.Hi,\n                request.SuggestedAppInstanceId.Lo);\n            Task<IClient> clientTask = null;\n            lock (_sync)\n            {\n                if (request.LaunchMode == AppLaunchMode.SingleInstance &&\n                    _createdClients.TryGetValue(appId, out var clientList) &&\n                    clientList.Any())\n                {\n                    var existingClient = clientList.First();\n                    clientTask = Task.FromResult(existingClient);\n                }\n\n                if (request.LaunchMode != AppLaunchMode.MultiInstance && clientTask == null)\n                {\n                    if (_createClientTasks.TryGetValue(appId, out var list) && list.Any())\n                    {\n                        clientTask = list.First();\n                    }\n                }\n\n                clientTask = clientTask ?? CreateClientAsync(appId, suggestedAppInstanceId, request.Referrer);\n            }\n\n            var client = await clientTask.ConfigureAwait(false);\n\n            OnStop(client.Disconnect);\n\n            if (_connectClients)\n            {\n                await client.ConnectAsync().ConfigureAwait(false);\n            }\n\n            if (client.ApplicationInstanceId == suggestedAppInstanceId)\n            {\n                lock (_sync)\n                {\n                    if (_createClientTasks.TryGetValue(appId, out var list))\n                    {\n                        list.Remove(clientTask);\n                        if (!list.Any())\n                        {\n                            _createClientTasks.Remove(appId);\n                        }\n                    }\n                }\n            }\n\n            return new AppLaunchResponse\n            {\n                AppInstanceId = ConvertUniqueId(client.ApplicationInstanceId),\n            };\n        }\n\n        private async Task<IClient> CreateClientAsync(string appId, UniqueId suggestedAppInstanceId, AppLaunchReferrer requestReferrer)\n        {\n            if (!_clientFactories.TryGetValue(appId, out var clientFactory))\n            {\n                throw new InvalidOperationException($\"Unknown application launch requested: {appId}\");\n            }\n\n            _appLaunchedEvents.OnNext(new AppLaunchedEvent { AppInstanceId = ConvertUniqueId(suggestedAppInstanceId), Referrer = requestReferrer, AppIds = { appId } });\n\n            var client = await clientFactory.CreateClientAsync(_broker, suggestedAppInstanceId).ConfigureAwait(false);\n\n            lock (_sync)\n            {\n                if (!_createdClients.TryGetValue(appId, out var clientList))\n                {\n                    clientList = new List<IClient>();\n                    _createdClients[appId] = clientList;\n                }\n\n                clientList.Add(client);\n\n                client.Completion.IgnoreExceptions().ContinueWithInBackground(_ =>\n                {\n                    lock (_sync)\n                    {\n                        return clientList.Remove(client);\n                    }\n                }).IgnoreAwait();\n            }\n\n            return client;\n        }\n\n        public IServerStreamingMethodCall<AppLifecycleEvent> GetLifecycleEventStream()\n        {\n            return _client.AppLifecycleService.GetLifecycleEventStream(new Empty());\n        }\n\n        public IServerStreamingMethodCall<InvocationEvent> GetInvocationEventStream()\n        {\n            return _client.AppLifecycleService.GetInvocationEventStream(new Empty());\n        }\n\n        public async Task AppLaunchedEventStream(Empty request, IWritableChannel<AppLaunchedEvent> responseStream, MethodCallContext context)\n        {\n            Log.Debug(\"AppLaunchedEventStream pipe started\");\n            await _appLaunchedEvents.PipeAsync(responseStream, context.CancellationToken).ConfigureAwait(false);\n            Log.Debug(\"AppLaunchedEventStream pipe finished\");\n        }\n\n        private static Generated.UniqueId ConvertUniqueId(UniqueId suggestedAppInstanceId)\n        {\n            return new Generated.UniqueId\n            {\n                Hi = suggestedAppInstanceId.Hi,\n                Lo = suggestedAppInstanceId.Lo,\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestBroker.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Testing\n{\n    using Plexus.Processes;\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Runtime.InteropServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Process = System.Diagnostics.Process;\n\n    internal sealed class TestBroker : ProcessBase, ITestBroker\n    {\n        private static readonly TimeSpan StopTimeout = TimeoutConstants.Timeout3Sec;\n\n        private const string ArtifactsDir =\n#if CORE_ONLY\n\"netcoreapp2.1-x64\";\n#else\n\"net45-AnyCPU\";\n#endif\n        private readonly string _exePath =\n            Path.GetFullPath(Path.Combine(\n                Directory.GetCurrentDirectory(), \"..\", \"..\", \"..\", \"..\", \"..\", \"..\", \"bin\", ArtifactsDir, \"broker\",\n                \"plexus\"));\n        \n        private readonly Promise _processExited = new Promise();\n        private readonly Process _process;\n\n        public TestBroker(string id)\n        {\n            var testBrokerConfigDir = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), \"TestBrokerConfig\"));\n            WorkingDir = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), \"TestBroker\", id));\n            FileSystemUtils.DeleteDir(WorkingDir);\n            FileSystemUtils.CopyDir(testBrokerConfigDir, WorkingDir);\n            _process = new Process\n            {\n                StartInfo = new ProcessStartInfo(_exePath)\n                {\n                    WorkingDirectory = WorkingDir,\n                    Arguments = \"broker metadata\",\n                    RedirectStandardOutput = false,\n                    RedirectStandardInput = false,\n                    RedirectStandardError = false,\n                    CreateNoWindow = true,\n                    UseShellExecute = false,\n                },\n                EnableRaisingEvents = true,\n            };\n\n#if NET45\n            var processEnv = _process.StartInfo.EnvironmentVariables;\n#else\n            var processEnv = _process.StartInfo.Environment;\n#endif\n            processEnv[EnvironmentHelper.ParentProcessIdVarName] = Process.GetCurrentProcess().Id.ToString();\n            processEnv[EnvironmentHelper.LauncherId] = TestAppLauncher.LauncherAppInstanceId.ToString();\n            _process.Exited += (x, y) =>\n            {\n                if (_process.ExitCode != 0)\n                {\n                    _processExited.TryFail(\n                        new InvalidOperationException(\n                            $\"Broker process exited with non-zero exit code {_process.ExitCode}\"));\n                }\n                else\n                {\n                    _processExited.TryComplete();\n                }\n            };\n\n            OnStop(SendShutdownEvent);\n        }\n\n        public string WorkingDir { get; }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<TestBroker>();\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            Log.Info(\"Starting test broker in directory {0}\", WorkingDir);\n            if (!_process.Start())\n            {\n                throw new InvalidOperationException(\"Broker failed to start\");\n            }\n            Log.Info(\"Test broker started in directory {0}\", WorkingDir);\n            return Task.FromResult(_processExited.Task);\n        }\n\n        private void SendShutdownEvent()\n        {\n            Log.Info(\"Stopping\");\n            var shutdownEventName = \"plexus-host-shutdown-\" + _process.Id;\n            Log.Info(\"Signalling broker process to shutdown: {0}\", shutdownEventName);\n            var shutdownEvent = new EventWaitHandle(\n                false,\n                EventResetMode.AutoReset,\n                shutdownEventName);\n            shutdownEvent.Set();\n            _processExited.Task.ContinueWithSynchronously(_ => shutdownEvent.Dispose());\n            Task.Delay(StopTimeout).ContinueWithSynchronously(t =>\n            {\n                if (!_process.HasExited)\n                {\n                    Log.Warn(\"Killing broker forcibly after {0}sec shutdown awaiting\", StopTimeout.TotalSeconds);\n                    _process.Kill();\n                }\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestBrokerConfig/NLog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"true\"\n      internalLogFile=\"logs/nlog.log\"\n      internalLogLevel=\"Warn\"\n      >\n\n  <extensions>\n    <add assembly=\"Plexus.Logging.NLog\"/>\n  </extensions>\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception:${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${workDir}/logs/\"/>\n\n  <targets async=\"true\">\n    <target xsi:type=\"File\"\n            name=\"FileTarget\"\n            deleteOldFileOnStartup=\"false\"\n            layout=\"${defaultLayout}\"\n            fileName=\"${logsDir}/plexus.log\"\n            keepFileOpen=\"false\"            \n            maxArchiveFiles=\"0\"\n    />\n  </targets>\n  <rules>\n    <logger name=\"*\" writeTo=\"FileTarget\" minlevel=\"Debug\" />\n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestBrokerConfig/metadata/apps.json",
    "content": "﻿{\n  \"apps\": [\n    {\n      \"id\": \"interop.testing.TestAppLauncher\",\n      \"displayName\": \"Test App Launcher\"\n    },\n    {\n      \"id\": \"interop.testing.EchoServer\",\n      \"displayName\": \"Test Echo Server\",\n      \"launcherId\": \"interop.testing.TestAppLauncher\",\n      \"launcherParams\": {}\n    },\n    {\n      \"id\": \"interop.testing.EchoClient\",\n      \"displayName\": \"Test Echo Client\",\n      \"launcherId\": \"interop.testing.TestAppLauncher\",\n      \"launcherParams\": {}\n    }\n  ]\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestBrokerConfig/metadata/interop.json",
    "content": "{\n\t\"messages\": {\n\t  \"nested\": {\n\t    \"google\": {\n\t      \"nested\": {\n\t        \"protobuf\": {\n\t          \"options\": {\n\t            \"go_package\": \"github.com/golang/protobuf/ptypes/empty\",\n\t            \"java_package\": \"com.google.protobuf\",\n\t            \"java_outer_classname\": \"EmptyProto\",\n\t            \"csharp_namespace\": \"Google.Protobuf.WellKnownTypes\",\n\t            \"objc_class_prefix\": \"GPB\",\n\t            \"optimize_for\": \"SPEED\",\n\t            \"java_multiple_files\": true,\n\t            \"cc_enable_arenas\": true\n\t          },\n\t          \"nested\": {\n\t            \"FileDescriptorSet\": {\n\t              \"fields\": {\n\t                \"file\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FileDescriptorProto\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"FileDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"package\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"dependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"publicDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"weakDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 11,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"messageType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 5\n\t                },\n\t                \"service\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ServiceDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 7\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FileOptions\",\n\t                  \"id\": 8\n\t                },\n\t                \"sourceCodeInfo\": {\n\t                  \"type\": \"SourceCodeInfo\",\n\t                  \"id\": 9\n\t                },\n\t                \"syntax\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 12\n\t                }\n\t              }\n\t            },\n\t            \"DescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"field\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"nestedType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 3\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"extensionRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ExtensionRange\",\n\t                  \"id\": 5\n\t                },\n\t                \"oneofDecl\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"OneofDescriptorProto\",\n\t                  \"id\": 8\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MessageOptions\",\n\t                  \"id\": 7\n\t                },\n\t                \"reservedRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ReservedRange\",\n\t                  \"id\": 9\n\t                },\n\t                \"reservedName\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"ExtensionRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"options\": {\n\t                      \"type\": \"ExtensionRangeOptions\",\n\t                      \"id\": 3\n\t                    }\n\t                  }\n\t                },\n\t                \"ReservedRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"ExtensionRangeOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 3\n\t                },\n\t                \"label\": {\n\t                  \"type\": \"Label\",\n\t                  \"id\": 4\n\t                },\n\t                \"type\": {\n\t                  \"type\": \"Type\",\n\t                  \"id\": 5\n\t                },\n\t                \"typeName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 6\n\t                },\n\t                \"extendee\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"defaultValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 7\n\t                },\n\t                \"oneofIndex\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 9\n\t                },\n\t                \"jsonName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FieldOptions\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Type\": {\n\t                  \"values\": {\n\t                    \"TYPE_DOUBLE\": 1,\n\t                    \"TYPE_FLOAT\": 2,\n\t                    \"TYPE_INT64\": 3,\n\t                    \"TYPE_UINT64\": 4,\n\t                    \"TYPE_INT32\": 5,\n\t                    \"TYPE_FIXED64\": 6,\n\t                    \"TYPE_FIXED32\": 7,\n\t                    \"TYPE_BOOL\": 8,\n\t                    \"TYPE_STRING\": 9,\n\t                    \"TYPE_GROUP\": 10,\n\t                    \"TYPE_MESSAGE\": 11,\n\t                    \"TYPE_BYTES\": 12,\n\t                    \"TYPE_UINT32\": 13,\n\t                    \"TYPE_ENUM\": 14,\n\t                    \"TYPE_SFIXED32\": 15,\n\t                    \"TYPE_SFIXED64\": 16,\n\t                    \"TYPE_SINT32\": 17,\n\t                    \"TYPE_SINT64\": 18\n\t                  }\n\t                },\n\t                \"Label\": {\n\t                  \"values\": {\n\t                    \"LABEL_OPTIONAL\": 1,\n\t                    \"LABEL_REQUIRED\": 2,\n\t                    \"LABEL_REPEATED\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"OneofOptions\",\n\t                  \"id\": 2\n\t                }\n\t              }\n\t            },\n\t            \"EnumDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"value\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumValueDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"EnumValueDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumValueOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"ServiceDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"method\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"MethodDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"ServiceOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"MethodDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"inputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"outputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MethodOptions\",\n\t                  \"id\": 4\n\t                },\n\t                \"clientStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"serverStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"FileOptions\": {\n\t              \"fields\": {\n\t                \"javaPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"javaOuterClassname\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                },\n\t                \"javaMultipleFiles\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenerateEqualsAndHash\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 20,\n\t                  \"options\": {\n\t                    \"deprecated\": true\n\t                  }\n\t                },\n\t                \"javaStringCheckUtf8\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 27,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"optimizeFor\": {\n\t                  \"type\": \"OptimizeMode\",\n\t                  \"id\": 9,\n\t                  \"options\": {\n\t                    \"default\": \"SPEED\"\n\t                  }\n\t                },\n\t                \"goPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 11\n\t                },\n\t                \"ccGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 16,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 17,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"pyGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 18,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"phpGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 19,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 23,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"ccEnableArenas\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 31,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"objcClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 36\n\t                },\n\t                \"csharpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 37\n\t                },\n\t                \"swiftPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 39\n\t                },\n\t                \"phpClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 40\n\t                },\n\t                \"phpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 41\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  38,\n\t                  38\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"OptimizeMode\": {\n\t                  \"values\": {\n\t                    \"SPEED\": 1,\n\t                    \"CODE_SIZE\": 2,\n\t                    \"LITE_RUNTIME\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"MessageOptions\": {\n\t              \"fields\": {\n\t                \"messageSetWireFormat\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"noStandardDescriptorAccessor\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"mapEntry\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 7\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  8,\n\t                  8\n\t                ],\n\t                [\n\t                  9,\n\t                  9\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldOptions\": {\n\t              \"fields\": {\n\t                \"ctype\": {\n\t                  \"type\": \"CType\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": \"STRING\"\n\t                  }\n\t                },\n\t                \"packed\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"jstype\": {\n\t                  \"type\": \"JSType\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": \"JS_NORMAL\"\n\t                  }\n\t                },\n\t                \"lazy\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"weak\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  4,\n\t                  4\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"CType\": {\n\t                  \"values\": {\n\t                    \"STRING\": 0,\n\t                    \"CORD\": 1,\n\t                    \"STRING_PIECE\": 2\n\t                  }\n\t                },\n\t                \"JSType\": {\n\t                  \"values\": {\n\t                    \"JS_NORMAL\": 0,\n\t                    \"JS_STRING\": 1,\n\t                    \"JS_NUMBER\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumOptions\": {\n\t              \"fields\": {\n\t                \"allowAlias\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  5,\n\t                  5\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumValueOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"ServiceOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"MethodOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"idempotencyLevel\": {\n\t                  \"type\": \"IdempotencyLevel\",\n\t                  \"id\": 34,\n\t                  \"options\": {\n\t                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"IdempotencyLevel\": {\n\t                  \"values\": {\n\t                    \"IDEMPOTENCY_UNKNOWN\": 0,\n\t                    \"NO_SIDE_EFFECTS\": 1,\n\t                    \"IDEMPOTENT\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"UninterpretedOption\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"NamePart\",\n\t                  \"id\": 2\n\t                },\n\t                \"identifierValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"positiveIntValue\": {\n\t                  \"type\": \"uint64\",\n\t                  \"id\": 4\n\t                },\n\t                \"negativeIntValue\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 5\n\t                },\n\t                \"doubleValue\": {\n\t                  \"type\": \"double\",\n\t                  \"id\": 6\n\t                },\n\t                \"stringValue\": {\n\t                  \"type\": \"bytes\",\n\t                  \"id\": 7\n\t                },\n\t                \"aggregateValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"NamePart\": {\n\t                  \"fields\": {\n\t                    \"namePart\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"isExtension\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"bool\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"SourceCodeInfo\": {\n\t              \"fields\": {\n\t                \"location\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Location\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Location\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"span\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"leadingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"trailingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"leadingDetachedComments\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 6\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GeneratedCodeInfo\": {\n\t              \"fields\": {\n\t                \"annotation\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Annotation\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Annotation\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"sourceFile\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"begin\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 4\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"Empty\": {\n\t              \"fields\": {}\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"interop\": {\n\t      \"options\": {\n\t        \"csharp_namespace\": \"plexus\"\n\t      },\n\t      \"nested\": {\n\t        \"AppConnectionDescriptor\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectionDescriptor\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            },\n\t            \"transportType\": {\n\t              \"type\": \"TransportType\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"TransportType\": {\n\t          \"values\": {\n\t            \"Unknown\": 0,\n\t            \"Pipe\": 1,\n\t            \"Ws\": 2,\n\t            \"Wss\": 3\n\t          }\n\t        },\n\t        \"AppLaunchMode\": {\n\t          \"values\": {\n\t            \"SINGLE_INSTANCE\": 0,\n\t            \"MULTI_INSTANCE\": 1\n\t          }\n\t        },\n\t        \"AppLauncherService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLauncherService\"\n\t          },\n\t          \"methods\": {\n\t            \"Launch\": {\n\t              \"requestType\": \"AppLaunchRequest\",\n\t              \"responseType\": \"AppLaunchResponse\"\n\t            },\n\t            \"AppLaunchedEventStream\": {\n\t              \"requestType\": \".google.protobuf.Empty\",\n\t              \"responseType\": \"AppLaunchedEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchParamsJson\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"suggestedAppInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 4\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchReferrer\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchReferrer\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLifecycleService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLifecycleService\"\n\t          },\n\t          \"methods\": {\n\t            \"ResolveApp\": {\n\t              \"requestType\": \"ResolveAppRequest\",\n\t              \"responseType\": \"ResolveAppResponse\"\n\t            },\n\t            \"GetLifecycleEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppLifecycleEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetInvocationEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"InvocationEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetConnections\": {\n\t              \"requestType\": \"GetConnectionsRequest\",\n\t              \"responseType\": \"GetConnectionsResponse\"\n\t            },\n\t            \"GetConnectionsStream\": {\n\t              \"requestType\": \"GetConnectionsRequest\",\n\t              \"responseType\": \"GetConnectionsEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"ResolveAppRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ResolveAppRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appResolveMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ResolveAppResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ResolveAppResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appConnectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"isNewInstanceLaunched\": {\n\t              \"type\": \"bool\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLifecycleEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLifecycleEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"connected\",\n\t                \"disconnected\",\n\t                \"error\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"connected\": {\n\t              \"type\": \"AppConnectedEvent\",\n\t              \"id\": 1\n\t            },\n\t            \"disconnected\": {\n\t              \"type\": \"AppDisconnectedEvent\",\n\t              \"id\": 2\n\t            },\n\t            \"error\": {\n\t              \"type\": \"AppConnectionErrorEvent\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"invocationStarted\",\n\t                \"invocationFinished\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"invocationStarted\": {\n\t              \"type\": \"InvocationStartedEvent\",\n\t              \"id\": 1\n\t            },\n\t            \"invocationFinished\": {\n\t              \"type\": \"InvocationFinishedEvent\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppConnectedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppDisconnectedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppDisconnectedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppConnectionErrorEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppConnectionErrorEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"connectionDescriptor\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"InvocationStartedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationStartedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"invocationDescriptor\": {\n\t              \"type\": \"InvocationDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"InvocationFinishedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationFinishedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"invocationDescriptor\": {\n\t              \"type\": \"InvocationDescriptor\",\n\t              \"id\": 1\n\t            },\n\t            \"result\": {\n\t              \"type\": \"InvocationResult\",\n\t              \"id\": 2\n\t            },\n\t            \"durationMs\": {\n\t              \"type\": \"int64\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationResult\": {\n\t          \"values\": {\n\t            \"Succeeded\": 0,\n\t            \"Canceled\": 1,\n\t            \"Failed\": 2\n\t          }\n\t        },\n\t        \"GetConnectionsRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"applicationId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"GetConnectionsResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"connections\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"GetConnectionsEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.GetConnectionsEvent\"\n\t          },\n\t          \"oneofs\": {\n\t            \"event\": {\n\t              \"oneof\": [\n\t                \"newConnection\",\n\t                \"closedConnection\"\n\t              ]\n\t            }\n\t          },\n\t          \"fields\": {\n\t            \"connections\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 1\n\t            },\n\t            \"newConnection\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            },\n\t            \"closedConnection\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppMetadataService\"\n\t          },\n\t          \"methods\": {\n\t            \"GetAppMetadataChangedEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppMetadataChangedEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"GetMetamodelChangedEventStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"MetamodelChangedEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataChangedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetadataChangedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"apps\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"AppMetadataInfo\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppMetadataInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetadataInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"displayName\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launcherId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"launcherParams\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"MetamodelChangedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.MetamodelChangedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"applications\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \".interop.AppMetamodelInfo\",\n\t              \"id\": 1\n\t            },\n\t            \"services\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Service\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppMetamodelInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppMetamodelInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"consumedServices\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ConsumedService\",\n\t              \"id\": 2\n\t            },\n\t            \"providedServices\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ProvidedService\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ProvidedService\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ProvidedService\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"alias\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ProvidedMethod\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedService\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ConsumedService\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"alias\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ConsumedMethod\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedMethod\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ConsumedMethod\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ProvidedMethod\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ProvidedMethod\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"MetamodelLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"int32\",\n\t              \"id\": 4\n\t            },\n\t            \"options\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 5\n\t            }\n\t          },\n\t          \"nested\": {\n\t            \"MetamodelLaunchMode\": {\n\t              \"values\": {\n\t                \"None\": 0,\n\t                \"SingleInstance\": 1,\n\t                \"MultiInstance\": 2\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"Service\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.Service\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"methods\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"MethodInfo\",\n\t              \"id\": 2\n\t            },\n\t            \"options\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"OptionParameter\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"MethodInfo\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.MethodInfo\"\n\t          },\n\t          \"fields\": {\n\t            \"name\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"requestMessageId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"responseMessageId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 4\n\t            },\n\t            \"type\": {\n\t              \"type\": \"MethodType\",\n\t              \"id\": 5\n\t            }\n\t          },\n\t          \"nested\": {\n\t            \"MethodType\": {\n\t              \"values\": {\n\t                \"Unary\": 0,\n\t                \"ServerStreaming\": 1,\n\t                \"ClientStreaming\": 2,\n\t                \"DuplexStreaming\": 3\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"OptionParameter\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.OptionParameter\"\n\t          },\n\t          \"fields\": {\n\t            \"key\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"value\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppRegistrationService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppRegistrationService\"\n\t          },\n\t          \"methods\": {\n\t            \"RequestInstanceId\": {\n\t              \"requestType\": \"RequestInstanceIdRequest\",\n\t              \"responseType\": \"UniqueId\"\n\t            },\n\t            \"RegisterInstanceId\": {\n\t              \"requestType\": \"RegisterInstanceIdRequest\",\n\t              \"responseType\": \"RegisterInstanceIdResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"RequestInstanceIdRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RequestInstanceIdRequest\"\n\t          },\n\t          \"fields\": {}\n\t        },\n\t        \"RegisterInstanceIdRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RegisterInstanceIdRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"RegisterInstanceIdResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RegisterInstanceIdResponse\"\n\t          },\n\t          \"fields\": {}\n\t        },\n\t        \"Context\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.Context\"\n\t          },\n\t          \"fields\": {\n\t            \"id\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"own\": {\n\t              \"type\": \"bool\",\n\t              \"id\": 2\n\t            },\n\t            \"kind\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ContextsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextsList\"\n\t          },\n\t          \"fields\": {\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"CreateContextRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.CreateContextRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"kind\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextLoadingStatus\": {\n\t          \"values\": {\n\t            \"IN_PROGRESS\": 0,\n\t            \"FAILED\": 1,\n\t            \"FINISHED\": 2\n\t          }\n\t        },\n\t        \"ContextLoadingUpdate\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextLoadingUpdate\"\n\t          },\n\t          \"fields\": {\n\t            \"status\": {\n\t              \"type\": \"ContextLoadingStatus\",\n\t              \"id\": 1\n\t            },\n\t            \"loadedAppDescriptors\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            },\n\t            \"failedAppDescriptors\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"InvocationRef\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationRef\"\n\t          },\n\t          \"fields\": {\n\t            \"appInfo\": {\n\t              \"type\": \"interop.AppMetamodelInfo\",\n\t              \"id\": 1\n\t            },\n\t            \"target\": {\n\t              \"type\": \"interop.AppConnectionDescriptor\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"InvocationsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationsList\"\n\t          },\n\t          \"fields\": {\n\t            \"invocations\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"InvocationRef\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextToInvocations\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextToInvocations\"\n\t          },\n\t          \"fields\": {\n\t            \"context\": {\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            },\n\t            \"invocations\": {\n\t              \"type\": \"InvocationsList\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ContextToInvocationsList\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.ContextToInvocationsList\"\n\t          },\n\t          \"fields\": {\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"ContextToInvocations\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppJoinedContextEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppJoinedContextEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"context\": {\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"RestoreContextsLinkageRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoreContextsLinkageRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"apps\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"RestoringAppInstance\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"RestoringAppInstance\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoringAppInstance\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"contextIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 3,\n\t              \"options\": {\n\t                \"deprecated\": true\n\t              }\n\t            },\n\t            \"contexts\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"Context\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"RestoreContextsLinkageResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.RestoreContextsLinkageResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"createdContextsMap\": {\n\t              \"keyType\": \"string\",\n\t              \"type\": \"Context\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"ContextLinkageService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.ContextLinkageService\"\n\t          },\n\t          \"methods\": {\n\t            \"ContextLoadedStream\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"ContextLoadingUpdate\",\n\t              \"responseStream\": true\n\t            },\n\t            \"CreateContext\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"Context\",\n\t              \"options\": {\n\t                \"deprecated\": true\n\t              },\n\t              \"parsedOptions\": [\n\t                {\n\t                  \"deprecated\": true\n\t                }\n\t              ]\n\t            },\n\t            \"CreateContext2\": {\n\t              \"requestType\": \"CreateContextRequest\",\n\t              \"responseType\": \"Context\"\n\t            },\n\t            \"JoinContext\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"google.protobuf.Empty\"\n\t            },\n\t            \"GetContexts\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"ContextsList\"\n\t            },\n\t            \"GetLinkedInvocations\": {\n\t              \"requestType\": \"Context\",\n\t              \"responseType\": \"InvocationsList\"\n\t            },\n\t            \"GetAllLinkedInvocations\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"ContextToInvocationsList\"\n\t            },\n\t            \"AppJoinedContextStream\": {\n\t              \"requestType\": \"google.protobuf.Empty\",\n\t              \"responseType\": \"AppJoinedContextEvent\",\n\t              \"responseStream\": true\n\t            },\n\t            \"RestoreContextsLinkage\": {\n\t              \"requestType\": \"RestoreContextsLinkageRequest\",\n\t              \"responseType\": \"RestoreContextsLinkageResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"ApplicationOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedServiceOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedServiceOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedMethodOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"uint32\",\n\t              \"id\": 3\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedMethodOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ApplicationLaunchOnCallMode\": {\n\t          \"options\": {\n\t            \"allow_alias\": true\n\t          },\n\t          \"values\": {\n\t            \"IF_NOT_LAUNCHED\": 0,\n\t            \"DEFAULT\": 0,\n\t            \"ALWAYS\": 1,\n\t            \"ENABLED\": 1,\n\t            \"NEVER\": 2,\n\t            \"DISABLED\": 2\n\t          }\n\t        },\n\t        \"InvocationDescriptor\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.InvocationDescriptor\"\n\t          },\n\t          \"fields\": {\n\t            \"serviceId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"serviceAliasId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"methodId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 3\n\t            },\n\t            \"source\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 4\n\t            },\n\t            \"target\": {\n\t              \"type\": \"AppConnectionDescriptor\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"messageId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MessageOptions\"\n\t        },\n\t        \"serviceId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.ServiceOptions\"\n\t        },\n\t        \"methodId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MethodOptions\"\n\t        },\n\t        \"testing\": {\n\t          \"options\": {\n\t            \"csharp_namespace\": \"plexus\"\n\t          },\n\t          \"nested\": {\n\t            \"stringOption\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1500,\n\t              \"extend\": \".interop.ProvidedMethodOptions\"\n\t            },\n\t            \"enumOption\": {\n\t              \"type\": \"EchoRequest.SubEnum\",\n\t              \"id\": 1501,\n\t              \"extend\": \".interop.ProvidedMethodOptions\"\n\t            },\n\t            \"EchoService\": {\n\t              \"options\": {\n\t                \"(.interop.service_id)\": \"interop.testing.EchoService\"\n\t              },\n\t              \"methods\": {\n\t                \"Unary\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"responseType\": \"EchoRequest\"\n\t                },\n\t                \"ServerStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"responseType\": \"EchoRequest\",\n\t                  \"responseStream\": true\n\t                },\n\t                \"ClientStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"EchoRequest\"\n\t                },\n\t                \"DuplexStreaming\": {\n\t                  \"requestType\": \"EchoRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"EchoRequest\",\n\t                  \"responseStream\": true\n\t                }\n\t              }\n\t            },\n\t            \"EchoRequest\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.EchoRequest\"\n\t              },\n\t              \"fields\": {\n\t                \"stringField\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"int64Field\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 2\n\t                },\n\t                \"uint32Field\": {\n\t                  \"type\": \"uint32\",\n\t                  \"id\": 3\n\t                },\n\t                \"repeatedDoubleField\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"double\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumField\": {\n\t                  \"type\": \"SubEnum\",\n\t                  \"id\": 5\n\t                },\n\t                \"subMessageField\": {\n\t                  \"type\": \"SubMessage\",\n\t                  \"id\": 6\n\t                },\n\t                \"repeatedSubMessageField\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"SubMessage\",\n\t                  \"id\": 7\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"SubMessage\": {\n\t                  \"options\": {\n\t                    \"(.interop.message_id)\": \"interop.testing.EchoRequest.SubMessage\"\n\t                  },\n\t                  \"fields\": {\n\t                    \"bytesField\": {\n\t                      \"type\": \"bytes\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"stringField\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                },\n\t                \"SubEnum\": {\n\t                  \"values\": {\n\t                    \"VALUE_ONE\": 0,\n\t                    \"VALUE_TWO\": 1\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GreetingService\": {\n\t              \"options\": {\n\t                \"(.interop.service_id)\": \"interop.testing.GreetingService\"\n\t              },\n\t              \"methods\": {\n\t                \"Hello\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"responseType\": \"GreetingResponse\"\n\t                }\n\t              }\n\t            },\n\t            \"GreetingRequest\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.GreetingRequest\"\n\t              },\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"GreetingResponse\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.testing.GreetingResponse\"\n\t              },\n\t              \"fields\": {\n\t                \"greeting\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"UniqueId\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.UniqueId\"\n\t          },\n\t          \"fields\": {\n\t            \"lo\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 1\n\t            },\n\t            \"hi\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        }\n\t      }\n\t    }\n\t  }\n\t}\n\t,\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"AppLaunchedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLauncherService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLifecycleService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ResolveApp\",\n\t\t\t\t\t\"request\": \"interop.ResolveAppRequest\",\n\t\t\t\t\t\"response\": \"interop.ResolveAppResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetLifecycleEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppLifecycleEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetInvocationEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.InvocationEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetConnections\",\n\t\t\t\t\t\"request\": \"interop.GetConnectionsRequest\",\n\t\t\t\t\t\"response\": \"interop.GetConnectionsResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetConnectionsStream\",\n\t\t\t\t\t\"request\": \"interop.GetConnectionsRequest\",\n\t\t\t\t\t\"response\": \"interop.GetConnectionsEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLifecycleService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppMetadataService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetAppMetadataChangedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppMetadataChangedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetMetamodelChangedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.MetamodelChangedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppMetadataService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.ContextLinkageService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ContextLoadedStream\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"interop.ContextLoadingUpdate\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"CreateContext\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.Context\",\n\t\t\t\t\t\"type\": \"Unary\",\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"google.protobuf.MethodOptions.deprecated\",\n\t\t\t\t\t\t\t\"value\": \"true\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"CreateContext2\",\n\t\t\t\t\t\"request\": \"interop.CreateContextRequest\",\n\t\t\t\t\t\"response\": \"interop.Context\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"JoinContext\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetContexts\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.ContextsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetLinkedInvocations\",\n\t\t\t\t\t\"request\": \"interop.Context\",\n\t\t\t\t\t\"response\": \"interop.InvocationsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.ContextToInvocationsList\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"AppJoinedContextStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppJoinedContextEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RestoreContextsLinkage\",\n\t\t\t\t\t\"request\": \"interop.RestoreContextsLinkageRequest\",\n\t\t\t\t\t\"response\": \"interop.RestoreContextsLinkageResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.ContextLinkageService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppRegistrationService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RequestInstanceId\",\n\t\t\t\t\t\"request\": \"interop.RequestInstanceIdRequest\",\n\t\t\t\t\t\"response\": \"interop.UniqueId\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"RegisterInstanceId\",\n\t\t\t\t\t\"request\": \"interop.RegisterInstanceIdRequest\",\n\t\t\t\t\t\"response\": \"interop.RegisterInstanceIdResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppRegistrationService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.testing.EchoService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.GreetingService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Hello\",\n\t\t\t\t\t\"request\": \"interop.testing.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.testing.GreetingResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.testing.GreetingService\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLifecycleManager\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ResolveApp\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLifecycleEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetInvocationEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnections\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnectionsStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppMetadataService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAppMetadataChangedEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetMetamodelChangedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext2\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppJoinedContextStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RestoreContextsLinkage\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppRegistrationService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RequestInstanceId\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RegisterInstanceId\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.CommandLineTool\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ResolveApp\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.NativeAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"plexus.interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoClient\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnections\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetConnectionsStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext2\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.EchoServer\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Unary Method\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.testing.string_option\",\n\t\t\t\t\t\t\t\t\t\"value\": \"some string\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.testing.enum_option\",\n\t\t\t\t\t\t\t\t\t\"value\": \"VALUE_TWO\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Server Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Client Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Duplex Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Sample Echo Service\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.testing.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Hello\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.testing.TestAppLauncher\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.ContextLinkageService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ContextLoadedStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"CreateContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"JoinContext\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetContexts\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLinkedInvocations\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetAllLinkedInvocations\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLifecycleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetLifecycleEventStream\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetInvocationEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppRegistrationService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RequestInstanceId\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"RegisterInstanceId\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"AppLaunchedEventStream\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestBrokerFixture.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Testing\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Linq;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public sealed class TestBrokerFixture : IDisposable\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<TestBrokerFixture>();\n        \n        private ConcurrentBag<TestBroker> _additionalBrokers = new ConcurrentBag<TestBroker>();\n\n        private int _additionalBrokerId;\n\n        public TestBrokerFixture()\n        {\n            EnsureSharedBrokerRunning();\n        }\n\n        public ITestBroker SharedInstance { get; private set; }\n\n        public void OnBeforeTest()\n        {\n            _additionalBrokers = new ConcurrentBag<TestBroker>();\n            EnsureSharedBrokerRunning();\n        }        \n\n        public void OnAfterTest()\n        {\n            Task.WhenAll(_additionalBrokers.Select(x => x.StopAsync())).ShouldCompleteIn(TimeoutConstants.Timeout10Sec);\n            if (SharedInstance.Completion.IsCompleted)\n            {\n                throw new InvalidOperationException(\n                    \"Default test broker unexpectedly closed\",\n                    SharedInstance.Completion.Exception?.ExtractInner());\n            }\n        }\n\n        public ITestBroker CreateBroker()\n        {\n            var id = Interlocked.Increment(ref _additionalBrokerId);\n            Log.Info(\"Creating broker {0}\", id);\n            var additionalBroker = new TestBroker(id.ToString());\n            _additionalBrokers.Add(additionalBroker);\n            return additionalBroker;\n        }\n\n        public void Dispose()\n        {\n            OnAfterTest();\n            if (SharedInstance != null && !SharedInstance.Completion.IsCompleted)\n            {\n                SharedInstance.StopAsync().ShouldCompleteIn(TimeoutConstants.Timeout10Sec);\n            }            \n        }\n\n        private void EnsureSharedBrokerRunning()\n        {\n            if (SharedInstance == null || SharedInstance.Completion.IsCompleted)\n            {\n                Log.Info(\"Starting shared test broker\");\n                SharedInstance = new TestBroker(\"shared\");\n                SharedInstance.StartAsync().ShouldCompleteIn(TimeoutConstants.Timeout10Sec);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/TestClientFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Testing\n{\n    using System;\n    using System.Threading.Tasks;\n\n    public sealed class TestClientFactory\n    {\n        private readonly Func<ITestBroker, UniqueId, Task<IClient>> _createClientDelegate;\n\n        public TestClientFactory(Func<ITestBroker, UniqueId, Task<IClient>> createClientDelegate)\n        {\n            _createClientDelegate = createClientDelegate;\n        }\n\n        public TestClientFactory(Func<ITestBroker, UniqueId, IClient> createClientDelegate)\n        {\n            _createClientDelegate = (x, y) => Task.FromResult(createClientDelegate(x, y));\n        }\n\n        public Task<IClient> CreateClientAsync(ITestBroker targetBroker, UniqueId appInstanceId)\n        {\n            return _createClientDelegate(targetBroker, appInstanceId);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Testing/UniqueId.Extensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Testing.Generated\n{\n    public sealed partial class UniqueId\n    {\n        public bool Equals(Plexus.UniqueId other)\n        {\n            if (Lo != other.Lo) return false;\n            if (Hi != other.Hi) return false;\n            return true;\n        }\n\n        public UniqueId(Plexus.UniqueId uniqueId)\n        {\n            Lo = uniqueId.Lo;\n            Hi = uniqueId.Hi;\n        }\n\n        public static implicit operator UniqueId(Plexus.UniqueId uniqueId)\n        {\n            return new UniqueId(uniqueId);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/AppLifecycleServiceIntegrationTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Testing;\n    using Plexus.Interop.Testing.Generated;\n    using Plexus.Interop.Transport.Protocol;\n    using Shouldly;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    public class AppLifecycleServiceIntegrationTests : BaseClientBrokerTestsSuite\n    {\n        public AppLifecycleServiceIntegrationTests(ITestOutputHelper output, TestBrokerFixture testBrokerFixture) : base(output, testBrokerFixture)\n        { }\n\n        [Fact]\n        public void EmptyGetConnectionsRequestReturnsAllConnections()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                for (int i = 1; i < 10; i++)\n                {\n                    var client = CreateClient<EchoClient>();\n                    await client.ConnectAsync();\n\n                    var response = await client.AppLifecycleService.GetConnections(new GetConnectionsRequest());\n                    response.Connections.Count.ShouldBeGreaterThan(i);\n                    response.Connections.FirstOrDefault(descriptor => descriptor.AppId == EchoClient.Id && descriptor.AppInstanceId.Equals(client.ApplicationInstanceId)).ShouldNotBeNull();\n                }\n            });\n        }\n\n        [Fact]\n        public void GetConnectionRequestByConnectionId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var testClient = CreateClient<EchoClient>();\n                await testClient.ConnectAsync();\n\n                var request = new GetConnectionsRequest { ConnectionId = testClient.ConnectionId };\n\n                var response = await client.AppLifecycleService.GetConnections(request);\n                response.Connections.Count.ShouldBe(1);\n                var descriptor = response.Connections.Single();\n                descriptor.AppId.ShouldBe(testClient.ApplicationId);\n                descriptor.AppInstanceId.ShouldBe(testClient.ApplicationInstanceId);\n                descriptor.ConnectionId.ShouldBe(testClient.ConnectionId);\n\n                await testClient.DisconnectAsync();\n\n                await Should.ThrowAsync<RemoteErrorException>(async () => await client.AppLifecycleService.GetConnections(request));\n            });\n        }\n\n        [Fact]\n        public void GetConnectionRequestByAppId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var clients = new List<EchoClient>();\n                for (int i = 0; i < 10; i++)\n                {\n                    clients.Add(CreateClient<EchoClient>());\n                }\n\n                await Task.WhenAll(clients.Select(echoClient => echoClient.ConnectAsync()));\n\n                var request = new GetConnectionsRequest { ApplicationId = EchoClient.Id };\n                var connections = (await client.AppLifecycleService.GetConnections(request)).Connections;\n                foreach (var echoClient in clients)\n                {\n                    connections.FirstOrDefault(descriptor => descriptor.AppId == EchoClient.Id && descriptor.AppInstanceId.Equals(echoClient.ApplicationInstanceId) && descriptor.ConnectionId.Equals(echoClient.ConnectionId)).ShouldNotBeNull();\n                }\n            });\n        }\n\n        [Fact]\n        public void GetConnectionRequestByAppInstanceId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var testClient = CreateClient<EchoClient>();\n\n                var request = new GetConnectionsRequest { AppInstanceId = testClient.ApplicationInstanceId };\n\n                var response = await client.AppLifecycleService.GetConnections(request);\n                response.Connections.Count.ShouldBe(0);\n\n                await testClient.ConnectAsync();\n\n                response = await client.AppLifecycleService.GetConnections(request);\n                response.Connections.Count.ShouldBe(1);\n                var descriptor = response.Connections.Single();\n                descriptor.AppId.ShouldBe(testClient.ApplicationId);\n                descriptor.AppInstanceId.ShouldBe(testClient.ApplicationInstanceId);\n                descriptor.ConnectionId.ShouldBe(testClient.ConnectionId);\n            });\n        }\n\n        [Fact]\n        public void GetConnectionRequestByAppIdAndAppInstanceId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var testClient = CreateClient<EchoClient>();\n\n                var request = new GetConnectionsRequest { AppInstanceId = testClient.ApplicationInstanceId, ApplicationId = testClient.ApplicationId };\n\n                await Should.ThrowAsync<RemoteErrorException>(async () => await client.AppLifecycleService.GetConnections(request));\n\n                await testClient.ConnectAsync();\n\n                var response = await client.AppLifecycleService.GetConnections(request);\n                response.Connections.Count.ShouldBe(1);\n                var descriptor = response.Connections.Single();\n                descriptor.AppId.ShouldBe(testClient.ApplicationId);\n                descriptor.AppInstanceId.ShouldBe(testClient.ApplicationInstanceId);\n                descriptor.ConnectionId.ShouldBe(testClient.ConnectionId);\n            });\n        }\n\n        [Fact]\n        public void GetConnectionEventsByAppInstanceId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var testClient = CreateClient<EchoClient>();\n\n                var request = new GetConnectionsRequest { AppInstanceId = testClient.ApplicationInstanceId };\n\n                var responseStream = client.AppLifecycleService.GetConnectionsStream(request).ResponseStream;\n                var initialCollection = await responseStream.ReadAsync();\n                initialCollection.EventCase.ShouldBe(GetConnectionsEvent.EventOneofCase.None);\n                initialCollection.Connections.Count.ShouldBe(0);\n\n                responseStream.TryRead(out _).ShouldBeFalse();\n\n                await testClient.ConnectAsync();\n\n                var connectionEvent = await responseStream.ReadAsync();\n                connectionEvent.EventCase.ShouldBe(GetConnectionsEvent.EventOneofCase.NewConnection);\n                connectionEvent.NewConnection.ConnectionId.ShouldBe(testClient.ConnectionId);\n                connectionEvent.Connections.Count.ShouldBe(1);\n\n                responseStream.TryRead(out _).ShouldBeFalse();\n\n                await testClient.DisconnectAsync();\n                var disconnectEvent = await responseStream.ReadAsync();\n                disconnectEvent.EventCase.ShouldBe(GetConnectionsEvent.EventOneofCase.ClosedConnection);\n                disconnectEvent.ClosedConnection.ConnectionId.ShouldBe(testClient.ConnectionId);\n                disconnectEvent.Connections.Count.ShouldBe(0);\n\n                responseStream.TryRead(out _).ShouldBeFalse();\n            });\n        }\n\n        [Fact]\n        public void GetConnectionEventsByConnectionId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var testClient = CreateClient<EchoClient>();\n                await testClient.ConnectAsync();\n\n                var request = new GetConnectionsRequest { ConnectionId = testClient.ConnectionId };\n\n                var responseStream = client.AppLifecycleService.GetConnectionsStream(request).ResponseStream;\n                var initialCollection = await responseStream.ReadAsync();\n                initialCollection.EventCase.ShouldBe(GetConnectionsEvent.EventOneofCase.None);\n                initialCollection.Connections.Count.ShouldBe(1);\n\n                responseStream.TryRead(out _).ShouldBeFalse();\n\n                await testClient.DisconnectAsync();\n\n                var disconnectEvent = await responseStream.ReadAsync();\n                disconnectEvent.EventCase.ShouldBe(GetConnectionsEvent.EventOneofCase.ClosedConnection);\n                disconnectEvent.ClosedConnection.ConnectionId.ShouldBe(testClient.ConnectionId);\n                disconnectEvent.Connections.Count.ShouldBe(0);\n\n                responseStream.TryRead(out _).ShouldBeFalse();\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/BaseClientBrokerTestsSuite.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Testing;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    public abstract class BaseClientBrokerTestsSuite : TestsSuite, IClassFixture<TestBrokerFixture>\n    {\n        protected readonly TestBrokerFixture _testBrokerFixture;\n\n        public BaseClientBrokerTestsSuite(ITestOutputHelper output, TestBrokerFixture testBrokerFixture) : base(output)\n        {\n            _testBrokerFixture = testBrokerFixture;\n            _testBrokerFixture.OnBeforeTest();\n            TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;\n        }\n\n        private readonly List<Exception> _unobservedExceptions = new List<Exception>();\n\n        private void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)\n        {\n            lock (_unobservedExceptions)\n            {\n                _unobservedExceptions.AddRange(e.Exception.InnerExceptions);\n            }\n        }\n\n        public override void Dispose()\n        {\n            try\n            {\n                base.Dispose();\n                _testBrokerFixture.OnAfterTest();\n                VerifyNoUnobservedTaskExceptions();\n            }\n            finally\n            {\n                TaskScheduler.UnobservedTaskException -= OnUnobservedTaskException;\n            }\n        }\n\n        private void VerifyNoUnobservedTaskExceptions()\n        {\n            GC.Collect();\n            GC.WaitForPendingFinalizers();\n            GC.Collect();\n            lock (_unobservedExceptions)\n            {\n                if (_unobservedExceptions.Count > 0)\n                {\n                    throw new AggregateException(\n                        \"Unhandled task exceptions after test run\",\n                        _unobservedExceptions);\n                }\n            }\n        }\n\n        protected T CreateClient<T>() where T : ClientBase\n        {\n            Func<ClientOptionsBuilder, ClientOptionsBuilder> builderFunc = builder => builder;\n            builderFunc = builder => builder.WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir);\n            var instance = (T)Activator.CreateInstance(typeof(T), builderFunc);\n            RegisterDisposable(instance);\n            return instance;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/ClientBrokerIntegrationTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using Google.Protobuf;\n    using Plexus.Channels;\n    using Plexus.Interop.Testing;\n    using Plexus.Interop.Testing.Generated;\n    using Plexus.Interop.Transport.Protocol;\n    using Shouldly;\n    using System;\n    using System.Collections.Generic;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Linq;\n    using System.Reactive.Concurrency;\n    using System.Reactive.Linq;\n    using System.Reactive.Subjects;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using WebSocket4Net;\n    using Xunit;\n    using Xunit.Abstractions;\n    using ErrorEventArgs = SuperSocket.ClientEngine.ErrorEventArgs;\n    using UniqueId = Plexus.UniqueId;\n\n    public sealed class ClientBrokerIntegrationTests : BaseClientBrokerTestsSuite\n    {\n        private static readonly UnaryMethod<EchoRequest, EchoRequest> EchoUnaryMethod =\n            Method.Unary<EchoRequest, EchoRequest>(\"interop.testing.EchoService\", \"Unary\");\n\n        private static readonly ServerStreamingMethod<EchoRequest, EchoRequest> EchoServerStreamingMethod =\n            Method.ServerStreaming<EchoRequest, EchoRequest>(\"interop.testing.EchoService\", \"ServerStreaming\");\n\n        private static readonly ClientStreamingMethod<EchoRequest, EchoRequest> EchoClientStreamingMethod =\n            Method.ClientStreaming<EchoRequest, EchoRequest>(\"interop.testing.EchoService\", \"ClientStreaming\");\n\n        private static readonly DuplexStreamingMethod<EchoRequest, EchoRequest> EchoDuplexStreamingMethod =\n            Method.DuplexStreaming<EchoRequest, EchoRequest>(\"interop.testing.EchoService\", \"DuplexStreaming\");\n\n        public ClientBrokerIntegrationTests(ITestOutputHelper output, TestBrokerFixture testBrokerFixture)\n            : base(output, testBrokerFixture)\n        { }\n\n        [Fact]\n        public void ClientConnectDisconnect()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = ConnectEchoClient();\n                await client.DisconnectAsync();\n            });\n        }\n\n        [Fact]\n        public void ConnectionLifecycleEvents()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory>()\n                    )\n                );\n                await appLauncher.StartAsync();\n                var stream = appLauncher.GetLifecycleEventStream().ResponseStream;\n                await Task.Delay(Timeout500Ms);\n                var client = ConnectEchoClient();\n                await client.DisconnectAsync();\n                var evt1 = await stream.ReadAsync();\n                var evt2 = await stream.ReadAsync();\n\n                evt1.EventCase.ShouldBe(AppLifecycleEvent.EventOneofCase.Connected);\n                evt1.Connected.ConnectionDescriptor.AppId.ShouldBe(\"interop.testing.EchoClient\");\n                evt2.EventCase.ShouldBe(AppLifecycleEvent.EventOneofCase.Disconnected);\n                evt2.Disconnected.ConnectionDescriptor.AppId.ShouldBe(\"interop.testing.EchoClient\");\n            });\n        }\n\n        [Fact]\n        public void ConcurrentClientConnectDisconnect()\n        {\n            RunWith30SecTimeout(() =>\n            {\n                const int concurrentClientCount = 5;\n                var connectTasks = Enumerable.Range(0, concurrentClientCount)\n                    .Select(_ => TaskRunner.RunInBackground(() => ConnectEchoClient()));\n                var clients = Task.WhenAll(connectTasks).ShouldCompleteIn(Timeout30Sec);\n                var disconnectTasks = clients.Select(c => TaskRunner.RunInBackground(c.DisconnectAsync));\n                Task.WhenAll(disconnectTasks).ShouldCompleteIn(Timeout30Sec);\n            });\n        }\n\n        [Fact]\n        public void ExceptionWhenConnectingWithUnexistingAppId()\n        {\n            Should.Throw<Exception>(() => ConnectClient(\"interop.testing.UnexistingApp\"));\n        }\n\n        [Fact]\n        public void BrokerStopWhenThereAreActiveConnections()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                using (var broker = _testBrokerFixture.CreateBroker())\n                {\n                    await broker.StartAsync();\n                    var client = ConnectEchoClient(broker);\n                    await broker.StopAsync();\n                    client.Completion.ShouldCompleteIn(Timeout5Sec);\n                    client.CallInvoker.Call(EchoUnaryMethod, new EchoRequest())\n                        .AsTask()\n                        .ShouldThrow<TaskCanceledException>(Timeout1Sec);\n                }\n            });\n        }\n\n        [Fact]\n        public void UnaryCall()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Console.WriteLine(\"Starting test\");\n                EchoRequest receivedRequest = null;\n                MethodCallContext receivedCallContext = null;\n\n                Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n                {\n                    receivedRequest = request;\n                    receivedCallContext = context;\n                    return Task.FromResult(request);\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)\n                    )\n                );\n                var sentRequest = CreateTestRequest();\n                Console.WriteLine(\"Starting call\");\n                var response = await client.CallInvoker.Call(EchoUnaryMethod, sentRequest);\n                Console.WriteLine(\"Response received\");\n                receivedRequest.ShouldBe(sentRequest);\n                response.ShouldBe(sentRequest);\n                receivedCallContext.ShouldNotBeNull();\n                receivedCallContext.ConsumerApplicationId.ShouldBe(\"interop.testing.EchoClient\");\n                receivedCallContext.ConsumerConnectionId.ShouldBe(client.ConnectionId);\n            });\n        }\n\n        [Fact]\n        public async Task UnaryCallThrowsCorrectExceptionWithoutConnectBeforeCall()\n        {\n            var client = CreateEchoClient();\n            var sentRequest = CreateTestRequest();\n            await Assert.ThrowsAsync<InvalidOperationException>(async () => await client.CallInvoker.Call(EchoUnaryMethod, sentRequest));\n        }\n\n        [Theory]\n        [InlineData(InvocationResult.Succeeded)]\n        [InlineData(InvocationResult.Canceled)]\n        [InlineData(InvocationResult.Failed)]\n        public void InvocationLifecycleEvents(InvocationResult result)\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory>()\n                    )\n                );\n                await appLauncher.StartAsync();\n\n                Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n                {\n                    switch (result)\n                    {\n                        case InvocationResult.Failed:\n                            throw new ApplicationException(\"Boom\");\n                        case InvocationResult.Canceled:\n                            throw new OperationCanceledException();\n                        default:\n                            return Task.FromResult(request);\n                    }\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)\n                    )\n                );\n                var sentRequest = CreateTestRequest();\n\n                var stream = appLauncher.GetInvocationEventStream().ResponseStream;\n                await Task.Delay(Timeout500Ms);\n                await client.CallInvoker\n                    .Call(EchoUnaryMethod, sentRequest)\n                    .AsTask()\n                    .IgnoreExceptions();\n\n                var evt1 = await stream.ReadAsync();\n                var evt2 = await stream.ReadAsync();\n                evt1.EventCase.ShouldBe(InvocationEvent.EventOneofCase.InvocationStarted);\n                evt1.InvocationStarted.InvocationDescriptor.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                evt1.InvocationStarted.InvocationDescriptor.MethodId.ShouldBe(\"Unary\");\n                evt1.InvocationStarted.InvocationDescriptor.Source.TransportType.ShouldBe(TransportType.Pipe);\n                evt1.InvocationStarted.InvocationDescriptor.Target.TransportType.ShouldBe(TransportType.Pipe);\n                evt2.EventCase.ShouldBe(InvocationEvent.EventOneofCase.InvocationFinished);\n                evt2.InvocationFinished.InvocationDescriptor.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                evt2.InvocationFinished.InvocationDescriptor.MethodId.ShouldBe(\"Unary\");\n                evt2.InvocationFinished.InvocationDescriptor.Source.TransportType.ShouldBe(TransportType.Pipe);\n                evt2.InvocationFinished.InvocationDescriptor.Target.TransportType.ShouldBe(TransportType.Pipe);\n                evt2.InvocationFinished.Result.ShouldBe(result);\n                evt2.InvocationFinished.DurationMs.ShouldBeGreaterThan(0);\n            });\n        }\n\n        private static EchoRequest CreateTestRequest()\n        {\n            var sentRequest = new EchoRequest\n            {\n                Int64Field = long.MaxValue - 100,\n                EnumField = EchoRequest.Types.SubEnum.ValueTwo,\n                Uint32Field = uint.MinValue\n            };\n            sentRequest.RepeatedDoubleField.Add(new[] { 0, -0.5, 123.1 });\n            sentRequest.RepeatedSubMessageField.Add(\n                new EchoRequest.Types.SubMessage\n                {\n                    BytesField = ByteString.CopyFrom(1, 2, 3),\n                    StringField = \"abc\"\n                });\n            return sentRequest;\n        }\n\n        [Fact]\n        public void BrokerStartStop()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                using (var broker = _testBrokerFixture.CreateBroker())\n                {\n                    await broker.StartAsync().ConfigureAwait(false);\n                    await broker.StopAsync().ConfigureAwait(false);\n                }\n            });\n        }\n\n        [Fact]\n        public void RequestBrokerMetadataStress()\n        {\n            ConnectEchoClient();\n            var wsAddress =\n                File.ReadAllText(Path.Combine(_testBrokerFixture.SharedInstance.WorkingDir, \"servers\", \"ws-v1\",\n                    \"address\")) + \"/metadata/interop\";\n            for (var repeat = 0; repeat < 500; repeat++)\n            {\n                RunWith20SecTimeout(async () =>\n                {\n                    var tasks = new List<Task>();\n                    for (var i = 0; i < 10; i++)\n                    {\n                        tasks.Add(Task.Run(async () =>\n                        {\n                            using (var websocket = new WebSocket(wsAddress))\n                            {\n                                var openedCompletion = new TaskCompletionSource<bool>();\n                                var receivedCompletion = new TaskCompletionSource<string>();\n                                var closedCompletion = new TaskCompletionSource<bool>();\n\n                                void OnOpened(object sender, EventArgs args)\n                                {\n                                    openedCompletion.TrySetResult(true);\n                                }\n\n                                void OnError(object sender, ErrorEventArgs args)\n                                {\n                                    openedCompletion.TrySetException(args.Exception);\n                                    receivedCompletion.TrySetException(args.Exception);\n                                    closedCompletion.TrySetException(args.Exception);\n                                }\n\n                                void OnClosed(object sender, EventArgs args)\n                                {\n                                    openedCompletion.TrySetException(new Exception(\"Unexpectedly closed\"));\n                                    receivedCompletion.TrySetException(new Exception(\"Unexpectedly closed\"));\n                                    closedCompletion.TrySetResult(true);\n                                }\n\n                                void OnReceived(object sender, MessageReceivedEventArgs args)\n                                {\n                                    receivedCompletion.TrySetResult(args.Message);\n                                }\n\n                                websocket.Opened += OnOpened;\n                                websocket.Error += OnError;\n                                websocket.Closed += OnClosed;\n                                websocket.MessageReceived += OnReceived;\n                                try\n                                {\n                                    websocket.Open();\n                                    await openedCompletion.Task;\n                                    var metadata = await receivedCompletion.Task;\n                                    metadata.ShouldContain(\"plexus.interop\");\n                                    websocket.Close();\n                                    await closedCompletion.Task;\n                                }\n                                finally\n                                {\n                                    websocket.Opened -= OnOpened;\n                                    websocket.Error -= OnError;\n                                    websocket.Closed -= OnClosed;\n                                    websocket.MessageReceived -= OnReceived;\n                                }\n                            }\n                        }));\n                    }\n                    await Task.WhenAll(tasks);\n                });\n            }\n        }\n\n        [Fact]\n        public void ExceptionWhenTargetServiceNotProvided()\n        {\n            RunWith10SecTimeout(() =>\n            {\n                Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n                {\n                    return Task.FromResult(request);\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.UnexistingService\",\n                        s => s.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)\n                    )\n                );\n                Console.WriteLine(\"Starting call\");\n                Should.Throw<Exception>(() => client.CallInvoker.Call(EchoUnaryMethod, new EchoRequest()).AsTask());\n                Console.WriteLine(\"Response received\");\n            });\n        }\n\n        [Fact]\n        public void ExceptionWhenTargetMethodThrowsException()\n        {\n            RunWith10SecTimeout(() =>\n            {\n                async Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n                {\n                    WriteLog(\"Handling request by throwing exception\");\n                    await Task.Yield();\n                    throw new ArgumentException();\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)\n                    )\n                );\n                WriteLog(\"Starting call\");\n                var ex = Should.Throw<Exception>(client.CallInvoker.Call(EchoUnaryMethod, CreateTestRequest()).AsTask(),\n                    Timeout5Sec);\n                WriteLog($\"Exception received: {ex.FormatTypeAndMessage()}\");\n            });\n        }\n\n        [Fact]\n        public void ExceptionWhenTargetMethodNotProvided()\n        {\n            RunWith10SecTimeout(() =>\n            {\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s\n                    )\n                );\n                Console.WriteLine(\"Starting call\");\n                Should.Throw<Exception>(() => client.CallInvoker.Call(EchoUnaryMethod, new EchoRequest()).AsTask());\n                Console.WriteLine(\"Response received\");\n            });\n        }\n\n        [Fact]\n        public void ServerStreamingCall()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Console.WriteLine(\"Starting test\");\n                EchoRequest receivedRequest = null;\n                var responses = new List<EchoRequest>();\n                var sentRequest = CreateTestRequest();\n\n                async Task HandleAsync(EchoRequest request, IWritableChannel<EchoRequest> responseStream,\n                    MethodCallContext context)\n                {\n                    Console.WriteLine(\"Handling invocation\");\n                    receivedRequest = request;\n                    await responseStream.WriteAsync(request).ConfigureAwait(false);\n                    await responseStream.WriteAsync(request).ConfigureAwait(false);\n                    await responseStream.WriteAsync(request).ConfigureAwait(false);\n                    Console.WriteLine(\"Responses sent\");\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithServerStreamingMethod<EchoRequest, EchoRequest>(\"ServerStreaming\", HandleAsync)\n                    )\n                );\n                Console.WriteLine(\"Starting call\");\n                var call = client.CallInvoker.Call(EchoServerStreamingMethod, sentRequest);\n                while (await call.ResponseStream.WaitReadAvailableAsync())\n                {\n                    while (call.ResponseStream.TryRead(out var item))\n                    {\n                        responses.Add(item);\n                    }\n                }\n\n                Console.WriteLine(\"Responses received\");\n                receivedRequest.ShouldBe(sentRequest);\n                responses.ShouldAllBe(r => r.Equals(sentRequest));\n            });\n        }\n\n        [Fact]\n        public void ServerStreamingCancellation()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                WriteLog(\"Starting test\");\n                var sentRequest = CreateTestRequest();\n                var serverCallCompletion = new Promise();\n\n                async Task HandleAsync(EchoRequest request, IWritableChannel<EchoRequest> responseStream,\n                    MethodCallContext context)\n                {\n                    try\n                    {\n                        WriteLog(\"Server handling invocation\");\n                        await responseStream.WriteAsync(request).ConfigureAwait(false);\n                        WriteLog(\"Server waiting for cancellation\");\n                        await context.CancellationToken.ToAwaitable();\n                    }\n                    catch (Exception ex)\n                    {\n                        serverCallCompletion.TryFail(ex);\n                        throw;\n                    }\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithServerStreamingMethod<EchoRequest, EchoRequest>(\"ServerStreaming\", HandleAsync)\n                    )\n                );\n                WriteLog(\"Starting call\");\n                var call = client.CallInvoker.Call(EchoServerStreamingMethod, sentRequest);\n                await call.ResponseStream.ReadAsync();\n                WriteLog(\"Cancelling call\");\n                call.CancelAsync().ShouldCompleteIn(Timeout5Sec);\n                WriteLog(\"Client call canceled\");\n                serverCallCompletion.Task.ShouldThrow<OperationCanceledException>(Timeout5Sec);\n                WriteLog(\"Server call canceled\");\n            });\n        }\n\n        [Fact]\n        public void ClientStreamingCall()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Console.WriteLine(\"Starting test\");\n                var receivedRequests = new List<EchoRequest>();\n\n                async Task<EchoRequest> HandleAsync(IReadableChannel<EchoRequest> requestStream,\n                    MethodCallContext context)\n                {\n                    while (await requestStream.WaitReadAvailableAsync().ConfigureAwait(false))\n                    {\n                        while (requestStream.TryRead(out var item))\n                        {\n                            receivedRequests.Add(item);\n                        }\n                    }\n\n                    Console.WriteLine(\"Received {0} requests\", receivedRequests.Count);\n                    return receivedRequests.Last();\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithClientStreamingMethod<EchoRequest, EchoRequest>(\"ClientStreaming\", HandleAsync)\n                    )\n                );\n                var sentRequest = CreateTestRequest();\n                Console.WriteLine(\"Starting call\");\n                var call = client.CallInvoker.Call(EchoClientStreamingMethod);\n                for (var i = 0; i < 3; i++)\n                {\n                    await call.RequestStream.WriteAsync(sentRequest).ConfigureAwait(false);\n                }\n\n                await call.RequestStream.CompleteAsync();\n                Console.WriteLine(\"Requests sent\");\n                var response = await call.ResponseAsync;\n                Console.WriteLine(\"Response received\");\n\n                await call.Completion;\n\n                Console.WriteLine(\"Call completed\");\n\n                receivedRequests.ShouldAllBe(r => r.Equals(sentRequest));\n                response.ShouldBe(sentRequest);\n            });\n        }\n\n        [Fact]\n        public void DuplexStreamingCall()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Console.WriteLine(\"Starting test\");\n\n                async Task HandleAsync(\n                    IReadableChannel<EchoRequest> requestStream,\n                    IWritableChannel<EchoRequest> responseStream,\n                    MethodCallContext context)\n                {\n                    while (await requestStream.WaitReadAvailableAsync())\n                    {\n                        while (requestStream.TryRead(out var item))\n                        {\n                            await responseStream.WriteAsync(item);\n                        }\n                    }\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithDuplexStreamingMethod<EchoRequest, EchoRequest>(\"DuplexStreaming\", HandleAsync)\n                    )\n                );\n                var sentRequest = CreateTestRequest();\n                Console.WriteLine(\"Starting call\");\n                var responses = new List<EchoRequest>();\n                var call = client.CallInvoker.Call(EchoDuplexStreamingMethod);\n                for (var i = 0; i < 3; i++)\n                {\n                    await call.RequestStream.WriteAsync(sentRequest);\n                    var response = await call.ResponseStream.ReadAsync();\n                    responses.Add(response);\n                }\n\n                await call.RequestStream.CompleteAsync();\n                Console.WriteLine(\"Requests sent\");\n\n                while (await call.ResponseStream.WaitReadAvailableAsync())\n                {\n                    while (call.ResponseStream.TryRead(out var item))\n                    {\n                        responses.Add(item);\n                    }\n                }\n\n                Console.WriteLine(\"Responses received\");\n\n                await call.Completion;\n\n                Console.WriteLine(\"Call completed\");\n\n                responses.ShouldAllBe(x => x.Equals(sentRequest));\n            });\n        }\n\n        [Fact]\n        public void DiscoveryByMethod()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = ConnectEchoClient();\n                var discoveryResults = await client.DiscoveryInvoker.DiscoverAsync(EchoUnaryMethod);\n                discoveryResults.Count.ShouldBe(1);\n                var discoveryResult = discoveryResults.Single();\n                discoveryResult.Title.ShouldBe(\"Sample Unary Method\");\n                discoveryResult.ProvidedMethod.ProvidedService.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                discoveryResult.ProvidedMethod.ProvidedService.ServiceAlias.HasValue.ShouldBeFalse();\n                discoveryResult.ProvidedMethod.ProvidedService.ApplicationId.ShouldBe(\n                    \"interop.testing.EchoServer\");\n                discoveryResult.ProvidedMethod.Name.ShouldBe(\"Unary\");\n                discoveryResult.InputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                discoveryResult.OutputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                discoveryResult.Type.ShouldBe(MethodType.Unary);\n                discoveryResult.Options.Count.ShouldBe(3);\n                discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.ProvidedMethodOptions.title\") && o.Value.Equals(\"Sample Unary Method\"));\n                discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.string_option\") && o.Value.Equals(\"some string\"));\n                discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.enum_option\") && o.Value.Equals(\"VALUE_TWO\"));\n            });\n        }\n\n        [Fact]\n        public void DiscoveryByMethodWithNoResponse()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = ConnectEchoClient();\n                var discoveryResults = await client.DiscoveryInvoker.DiscoverAsync(EchoUnaryMethod);\n                discoveryResults.Count.ShouldBe(1);\n                var discoveryResult = discoveryResults.Single();\n                discoveryResult.Title.ShouldBe(\"Sample Unary Method\");\n                discoveryResult.ProvidedMethod.ProvidedService.ServiceId.ShouldBe(\"interop.testing.EchoService\");\n                discoveryResult.ProvidedMethod.ProvidedService.ServiceAlias.HasValue.ShouldBeFalse();\n                discoveryResult.ProvidedMethod.ProvidedService.ApplicationId.ShouldBe(\n                    \"interop.testing.EchoServer\");\n                discoveryResult.ProvidedMethod.Name.ShouldBe(\"Unary\");\n                discoveryResult.InputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                discoveryResult.OutputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                discoveryResult.Type.ShouldBe(MethodType.Unary);\n            });\n        }\n\n        [Fact]\n        public void DiscoveryByService()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                ConnectEchoServer();\n                ConnectEchoServer();\n                var client = ConnectEchoClient();\n                var discoveryResults =\n                    await client.DiscoveryInvoker.DiscoverAsync(\n                        ServiceDiscoveryQuery.Create(EchoUnaryMethod.Reference.Service));\n                discoveryResults.Count.ShouldBe(1);\n                foreach (var discoveryResult in discoveryResults)\n                {\n                    discoveryResult.Title.ShouldBe(\"Sample Echo Service\");\n                    discoveryResult.ProvidedService.ApplicationId.ShouldBe(\"interop.testing.EchoServer\");\n                    discoveryResult.ProvidedService.ConnectionId.HasValue.ShouldBeFalse();\n                    discoveryResult.Methods.Count.ShouldBe(4);\n                    var serverStreamingMethod = discoveryResult.Methods.FirstOrDefault(x =>\n                        string.Equals(x.ProvidedMethod.Name, \"DuplexStreaming\"));\n                    serverStreamingMethod.ShouldNotBeNull();\n                    serverStreamingMethod.Title.ShouldBe(\"Sample Duplex Streaming Method\");\n                    serverStreamingMethod.ProvidedMethod.ProvidedService.ConnectionId.HasValue.ShouldBeFalse();\n                    serverStreamingMethod.Options.Count.ShouldBe(1);\n                    var unaryMethod =\n                        discoveryResult.Methods.FirstOrDefault(x => string.Equals(x.ProvidedMethod.Name, \"Unary\"));\n                    unaryMethod.ShouldNotBeNull();\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.ProvidedMethodOptions.title\") && o.Value.Equals(\"Sample Unary Method\"));\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.string_option\") && o.Value.Equals(\"some string\"));\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.enum_option\") && o.Value.Equals(\"VALUE_TWO\"));\n                }\n            });\n        }\n\n        [Fact]\n        public void OnlineDiscoveryByMethod()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1 = ConnectEchoServer();\n                var server2 = ConnectEchoServer();\n                var client = ConnectEchoClient();\n                var discoveryResults = await client.DiscoveryInvoker.DiscoverOnlineAsync(EchoUnaryMethod);\n                discoveryResults.Count.ShouldBe(2);\n                foreach (var discoveryResult in discoveryResults)\n                {\n                    discoveryResult.Title.ShouldBe(\"Sample Unary Method\");\n                    discoveryResult.ProvidedMethod.ProvidedService.ServiceId.ShouldBe(\n                        \"interop.testing.EchoService\");\n                    discoveryResult.ProvidedMethod.ProvidedService.ServiceAlias.HasValue.ShouldBeFalse();\n                    discoveryResult.ProvidedMethod.ProvidedService.ApplicationId.ShouldBe(\n                        \"interop.testing.EchoServer\");\n                    discoveryResult.ProvidedMethod.ProvidedService.ServiceAlias.ShouldBe(Maybe<string>.Nothing);\n                    discoveryResult.ProvidedMethod.Name.ShouldBe(\"Unary\");\n                    discoveryResult.InputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                    discoveryResult.OutputMessageId.ShouldBe(\"interop.testing.EchoRequest\");\n                    discoveryResult.Type.ShouldBe(MethodType.Unary);\n                    discoveryResult.ProviderConnectionId.ShouldBeOneOf(server1.ConnectionId, server2.ConnectionId);\n                    discoveryResult.Options.Count.ShouldBe(3);\n                    discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.ProvidedMethodOptions.title\") && o.Value.Equals(\"Sample Unary Method\"));\n                    discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.string_option\") && o.Value.Equals(\"some string\"));\n                    discoveryResult.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.enum_option\") && o.Value.Equals(\"VALUE_TWO\"));\n                }\n            });\n        }\n\n        [Fact]\n        public void OnlineDiscoveryByService()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1 = ConnectEchoServer();\n                var server2 = ConnectEchoServer();\n                var client = ConnectEchoClient();\n                var discoveryResults =\n                    await client.DiscoveryInvoker.DiscoverOnlineAsync(\n                        ServiceDiscoveryQuery.Create(EchoUnaryMethod.Reference.Service));\n                discoveryResults.Count.ShouldBe(2);\n                foreach (var discoveryResult in discoveryResults)\n                {\n                    discoveryResult.Title.ShouldBe(\"Sample Echo Service\");\n                    discoveryResult.ProvidedService.ApplicationId.ShouldBe(\"interop.testing.EchoServer\");\n                    discoveryResult.ProviderConnectionId.ShouldBeOneOf(server1.ConnectionId, server2.ConnectionId);\n                    discoveryResult.Methods.Count.ShouldBe(4);\n                    var serverStreamingMethod = discoveryResult.Methods.FirstOrDefault(x =>\n                        string.Equals(x.ProvidedMethod.Name, \"ServerStreaming\"));\n                    serverStreamingMethod.ShouldNotBeNull();\n                    serverStreamingMethod.ProviderConnectionId.ShouldBeOneOf(server1.ConnectionId,\n                        server2.ConnectionId);\n                    serverStreamingMethod.Title.ShouldBe(\"Sample Server Streaming Method\");\n                    var unaryMethod =\n                        discoveryResult.Methods.FirstOrDefault(x => string.Equals(x.ProvidedMethod.Name, \"Unary\"));\n                    unaryMethod.ShouldNotBeNull();\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.ProvidedMethodOptions.title\") && o.Value.Equals(\"Sample Unary Method\"));\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.string_option\") && o.Value.Equals(\"some string\"));\n                    unaryMethod.Options.ShouldContain(o => o.Id.Equals(\"interop.testing.enum_option\") && o.Value.Equals(\"VALUE_TWO\"));\n                }\n            });\n        }\n\n        [Fact]\n        public void DiscoveryByMethodThenInvoke()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Task<EchoRequest> HandleAsync(EchoRequest msg, MethodCallContext context)\n                {\n                    return Task.FromResult(msg);\n                }\n\n                var client = ConnectEchoClient();\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)\n                    )\n                );\n                var discoveryResult = (await client.DiscoveryInvoker.DiscoverAsync(EchoUnaryMethod)).Single();\n                var request = CreateTestRequest();\n                var response = await client.CallInvoker.Call(discoveryResult, request).ConfigureAwait(false);\n                response.ShouldBe(request);\n            });\n        }\n\n        [Fact]\n        public void DiscoveryByInputMessage()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = ConnectEchoClient();\n                var discoveryResults = await client.DiscoveryInvoker.DiscoverAsync<EchoRequest>();\n                discoveryResults.Count.ShouldBe(4);\n                var unary = discoveryResults.Single(x => string.Equals(x.ProvidedMethod.Name, \"Unary\"));\n                unary.Type.ShouldBe(MethodType.Unary);\n                var serverStreaming =\n                    discoveryResults.Single(x => string.Equals(x.ProvidedMethod.Name, \"ServerStreaming\"));\n                serverStreaming.Type.ShouldBe(MethodType.ServerStreaming);\n            });\n        }\n\n        [Fact]\n        public void ExceptionWhenTargetAppIsNotRunningAndCannotBeStarted()\n        {\n            RunWith10SecTimeout(() =>\n            {\n                var client = ConnectEchoClient();\n                Should.Throw<Exception>(async () => await client.CallInvoker.Call(EchoUnaryMethod, new EchoRequest()),\n                    Timeout5Sec);\n            });\n        }\n\n        [Fact]\n        public void AppLauncherStartAppWhenRequired()\n        {\n            EchoRequest receivedRequest = null;\n\n            Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n            {\n                receivedRequest = request;\n                return Task.FromResult(request);\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                EchoService.Id,\n                                x => x.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync))\n                            .WithApplicationId(EchoServerClient.Id);\n\n                        return ClientFactory.Instance.Create(optionsBuilder.Build());\n                    });\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory> { { EchoServerClient.Id, echoServerFactory } }\n                    )\n                );\n                await appLauncher.StartAsync();\n                var client = ConnectEchoClient();\n                var request = CreateTestRequest();\n                var response = await client.CallInvoker.Call(EchoUnaryMethod, request);\n                response.ShouldBe(request);\n                receivedRequest.ShouldBe(request);\n            });\n        }\n\n        [Fact]\n        public void InvocationShouldBeRoutedToAnotherInstanceEvenIfSourceAppCanHandleIt()\n        {\n            MethodCallContext receivedRequestContext = null;\n\n            Task<EchoRequest> HandleAsync(EchoRequest request, MethodCallContext context)\n            {\n                receivedRequestContext = context;\n                return Task.FromResult(request);\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var server = ConnectEchoServer();\n                ConnectEchoServer(\n                    b => b.WithProvidedService(\n                        EchoService.Id,\n                        x => x.WithUnaryMethod<EchoRequest, EchoRequest>(\"Unary\", HandleAsync)));\n                var request = CreateTestRequest();\n                var response = await server.CallInvoker.Call(EchoUnaryMethod, request);\n                response.ShouldBe(request);\n                receivedRequestContext.ShouldNotBeNull();\n                receivedRequestContext.ConsumerConnectionId.ShouldBe(server.ConnectionId);\n            });\n        }\n\n        [Fact]\n        public void InvocationShouldAlwaysTriggerLaunchWhenMethodLaunchModeSetToAlways()\n        {\n            const string applicationId = EchoServerClient.Id;\n            const string serverServiceId = GreetingService.Id;\n            const string methodName = GreetingService.HelloMethodId;\n            const string serviceAliasId = \"AlwaysLaunchGreetingService\";\n\n            Task<GreetingResponse> HandleAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                return Task.FromResult(new GreetingResponse { Greeting = greetingRequest.Name });\n            }\n\n            var brokerInstance = _testBrokerFixture.SharedInstance;\n            RunWith10SecTimeout(async () =>\n            {\n                var serverCreatedCount = 0;\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(brokerInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(applicationId)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                serverServiceId,\n                                serviceAliasId,\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(methodName, HandleAsync));\n\n                        serverCreatedCount++;\n\n                        return Task.FromResult(ClientFactory.Instance.Create(optionsBuilder.Build()));\n                    });\n\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        brokerInstance,\n                        new Dictionary<string, TestClientFactory>\n                        {\n                            {applicationId, echoServerFactory}\n                        }\n                    )\n                );\n                await appLauncher.StartAsync();\n                ConnectEchoServer();\n                var client = new EchoClient(s => s.WithBrokerWorkingDir(brokerInstance.WorkingDir));\n                client.ConnectAsync().ShouldCompleteIn(Timeout5Sec);\n                var callDescriptor = new MethodCallDescriptor(ProvidedMethodReference.Create(serverServiceId, serviceAliasId, methodName, applicationId));\n                await client.CallInvoker.CallUnary(callDescriptor, new GreetingRequest { Name = \"Test\" });\n                await client.CallInvoker.CallUnary(callDescriptor, new GreetingRequest { Name = \"Test\" });\n                serverCreatedCount.ShouldBe(2);\n            });\n        }\n\n        [Fact]\n        public void InvocationShouldTriggerLaunchWithSingleInstanceModeByDefault()\n        {\n            const string serverAppId = EchoServerClient.Id;\n            const string serverServiceId = GreetingService.Id;\n            const string methodName = GreetingService.HelloMethodId;\n\n            var serverInvokedCount = 0;\n            var serverCreatedCount = 0;\n\n            Task<GreetingResponse> HandleAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                Interlocked.Increment(ref serverInvokedCount);\n                return Task.FromResult(new GreetingResponse { Greeting = greetingRequest.Name });\n            }\n\n            using (var brokerInstance = _testBrokerFixture.CreateBroker())\n            {\n                RunWith10SecTimeout(async () =>\n                {\n                    await brokerInstance.StartAsync();\n\n                    var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        WriteLog(\"Launching server on demand\");\n\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(brokerInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(serverAppId)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                serverServiceId,\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(methodName, HandleAsync));\n\n                        Interlocked.Increment(ref serverCreatedCount);\n\n                        return ClientFactory.Instance.Create(optionsBuilder.Build());\n                    });\n\n                    var appLauncher = RegisterDisposable(\n                        new TestAppLauncher(\n                            brokerInstance,\n                            new Dictionary<string, TestClientFactory> { { serverAppId, echoServerFactory } }\n                        )\n                    );\n                    await appLauncher.StartAsync();\n                    var client = new EchoClient(s => s.WithBrokerWorkingDir(brokerInstance.WorkingDir));\n                    client.ConnectAsync().ShouldCompleteIn(Timeout5Sec);\n                    var callDescriptor = new MethodCallDescriptor(ProvidedMethodReference.Create(serverServiceId, methodName, serverAppId));\n                    var call1 = client.CallInvoker.CallUnary(callDescriptor, new GreetingRequest { Name = \"Test\" });\n                    var call2 = client.CallInvoker.CallUnary(callDescriptor, new GreetingRequest { Name = \"Test\" });\n                    await Task.WhenAny(call1.AsTask(), call2.AsTask());\n                    WriteLog(\"Call 1 completed\");\n                    await Task.WhenAll(call1.AsTask(), call2.AsTask());\n                    WriteLog(\"Call 2 completed\");\n                    Volatile.Read(ref serverCreatedCount).ShouldBe(1, \"Unexpected serverCreatedCount\");\n                    Volatile.Read(ref serverInvokedCount).ShouldBe(2, \"Unexpected serverInvokedCount\");\n                });\n            }\n        }\n\n        [Fact]\n        public void InvocationShouldFailIfThereIsNoOnlineInstanceAndMethodLaunchModeSetToNever()\n        {\n            Task<GreetingResponse> HandleAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                return Task.FromResult(new GreetingResponse { Greeting = greetingRequest.Name });\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var serverCreatedCount = 0;\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(EchoServerClient.Id)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                GreetingService.Id,\n                                \"NeverLaunchGreetingService\",\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(\"Hello\", HandleAsync));\n\n                        serverCreatedCount++;\n\n                        return ClientFactory.Instance.Create(optionsBuilder.Build());\n                    });\n\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory>\n                        {\n                            {EchoServerClient.Id, echoServerFactory}\n                        }\n                    )\n                );\n                await appLauncher.StartAsync();\n                var client = new EchoClient(s => s.WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir));\n                await client.ConnectAsync();\n                var callDescriptor = new MethodCallDescriptor(\n                    ProvidedMethodReference.Create(GreetingService.Id, \"NeverLaunchGreetingService\", \"Hello\", EchoServerClient.Id));\n                client.CallInvoker\n                    .CallUnary(callDescriptor, new GreetingRequest { Name = \"Test\" })\n                    .AsTask()\n                    .ShouldThrow<RemoteErrorException>()\n                    .RemoteExceptionName.ShouldBe(\"InvalidOperationException\");\n                serverCreatedCount.ShouldBe(0);\n            });\n        }\n\n        [Theory]\n        [InlineData(0, 0)]\n        [InlineData(1, 0)]\n        [InlineData(1, 1)]\n        [InlineData(1, 10)]\n        [InlineData(10, 0)]\n        [InlineData(10, 1)]\n        [InlineData(10, 10)]\n        [InlineData(100, 10)]\n        public void DuplexStreamingStress(int requestsCount, int responsesPerRequest)\n        {\n            async Task HandleAsync(\n                IReadableChannel<EchoRequest> requestStream,\n                IWritableChannel<EchoRequest> responseStream,\n                MethodCallContext context)\n            {\n                WriteLog(\"Provider: Started request\");\n                var x = 0;\n                do\n                {\n                    while (requestStream.TryRead(out var item))\n                    {\n                        var stopwatch = new Stopwatch();\n                        Log.Info($\"Provider: request {x} received\");\n                        for (var i = 0; i < responsesPerRequest; i++)\n                        {\n                            var y = x * responsesPerRequest + i;\n                            Log.Info($\"Provider: sending response {y}\");\n                            stopwatch.Restart();\n                            await responseStream.WriteAsync(item).ConfigureAwait(false);\n                            stopwatch.Stop();\n                            Log.Info($\"Provider: response {y} sent in {stopwatch.ElapsedMilliseconds}ms\");\n                        }\n                        x++;\n                    }\n                } while (await requestStream.WaitReadAvailableAsync().ConfigureAwait(false));\n                WriteLog(\"Provider: completed request\");\n            }\n\n            RunWith30SecTimeout(async () =>\n            {\n                ConnectEchoServer(x => x\n                    .WithProvidedService(\n                        \"interop.testing.EchoService\",\n                        s => s.WithDuplexStreamingMethod<EchoRequest, EchoRequest>(\"DuplexStreaming\", HandleAsync)\n                    )\n                );\n                var client = ConnectEchoClient();\n                var call = client.CallInvoker.Call(EchoDuplexStreamingMethod);\n                var request = CreateTestRequest();\n                var receivedResponsesCount = 0;\n                var sendWorker = TaskRunner.RunInBackground(async () =>\n                {\n                    var stopwatch = new Stopwatch();\n                    for (var i = 0; i < requestsCount; i++)\n                    {\n                        stopwatch.Restart();\n                        await call.RequestStream.WriteAsync(request).ConfigureAwait(false);\n                        stopwatch.Stop();\n                        Log.Info($\"Consumer: request {i} sent in {stopwatch.ElapsedMilliseconds}ms\");\n                    }\n\n                    WriteLog(\"Consumer: completing request stream\");\n                    await call.RequestStream.CompleteAsync().ConfigureAwait(false);\n                });\n                var receiveWorker = TaskRunner.RunInBackground(async () =>\n                {\n                    do\n                    {\n                        while (call.ResponseStream.TryRead(out _))\n                        {\n                            Log.Info($\"Consumer: response {receivedResponsesCount} received\");\n                            receivedResponsesCount++;\n                        }\n                    } while (await call.ResponseStream.WaitReadAvailableAsync().ConfigureAwait(false));\n\n                    WriteLog(\"Consumer: response stream completed\");\n                });\n                await Task.WhenAll(sendWorker, receiveWorker).ConfigureAwait(false);\n                await call.Completion.ConfigureAwait(false);\n                receivedResponsesCount.ShouldBe(requestsCount * responsesPerRequest);\n            });\n        }\n\n        [Fact]\n        public void NewAppInstanceWillBeLaunchedOnInvocation()\n        {\n            Task<GreetingResponse> HandleAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                return Task.FromResult(new GreetingResponse { Greeting = greetingRequest.Name + \"1\" });\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var serverCreatedCount = 0;\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(EchoServerClient.Id)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                GreetingService.Id,\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(\"Hello\", HandleAsync));\n\n                        serverCreatedCount++;\n\n                        return ClientFactory.Instance.Create(optionsBuilder.Build());\n                    });\n\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory>\n                        {\n                            {EchoServerClient.Id, echoServerFactory}\n                        }\n                    )\n                );\n                await appLauncher.StartAsync();\n                var client = new EchoClient(s => s.WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir));\n                await client.ConnectAsync();\n                var result = client.GreetingService.Hello(new GreetingRequest { Name = \"Test\" }).AsTask().ShouldCompleteIn(Timeout1Sec);\n\n                result.Greeting.ShouldBe(\"Test1\");\n\n                serverCreatedCount.ShouldBe(1);\n            });\n        }\n\n        [Fact]\n        public void AppLaunchedWithUnexpectedAppInstanceShouldBeResolved()\n        {\n            Task<GreetingResponse> HandleGreetingRequestAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                return Task.FromResult(new GreetingResponse { Greeting = \"Polo\" });\n            }\n\n            IClient CreateEchoServerClient(UniqueId clientAppInstanceId)\n            {\n                var optionsBuilder = new ClientOptionsBuilder()\n                    .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                    .WithAppInstanceId(clientAppInstanceId)\n                    .WithApplicationId(EchoServerClient.Id)\n                    .WithDefaultConfiguration()\n                    .WithProvidedService(\n                        GreetingService.Id,\n                        x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(GreetingService.HelloMethodId, HandleGreetingRequestAsync));\n                return ClientFactory.Instance.Create(optionsBuilder.Build());\n            }\n\n            TaskCompletionSource<UniqueId> echoServerClientLaunchedCompletionSource = new TaskCompletionSource<UniqueId>();\n            Subject<AppLaunchedEvent> launchEventsSubject = new Subject<AppLaunchedEvent>();\n\n            Task<AppLaunchResponse> HandleAppLaunchRequestAsync(AppLaunchRequest request, MethodCallContext context)\n            {\n                var uniqueId = UniqueId.Generate();\n                var appInstanceId = new Testing.Generated.UniqueId { Hi = uniqueId.Hi, Lo = uniqueId.Lo };\n                echoServerClientLaunchedCompletionSource.SetResult(uniqueId);\n                launchEventsSubject.OnNext(new AppLaunchedEvent\n                {\n                    AppInstanceId = appInstanceId,\n                    Referrer = request.Referrer\n                });\n                return Task.FromResult(new AppLaunchResponse\n                {\n                    AppInstanceId = appInstanceId\n                });\n            }\n\n            async Task Handler(Empty request, IWritableChannel<AppLaunchedEvent> responseStream, MethodCallContext context)\n            {\n                await launchEventsSubject.ObserveOn(ThreadPoolScheduler.Instance).PipeAsync(responseStream, context.CancellationToken).ConfigureAwait(false);\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var launcherClient = ClientFactory.Instance.Create(\n                    new ClientOptionsBuilder()\n                        .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                        .WithApplicationId(TestAppLauncherClient.Id)\n                        .WithDefaultConfiguration()\n                        .WithProvidedService(AppLauncherService.Id,\n                            x => x.WithUnaryMethod<AppLaunchRequest, AppLaunchResponse>(\n                                AppLauncherService.LaunchMethodId,\n                                HandleAppLaunchRequestAsync)\n                                .WithServerStreamingMethod<Empty, AppLaunchedEvent>(AppLauncherService.AppLaunchedEventStreamMethodId, Handler))\n                        .Build());\n\n                await launcherClient.ConnectAsync();\n\n                var client = new EchoClient(s => s.WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir));\n                await client.ConnectAsync();\n\n                var responseTask = client.GreetingService.Hello(new GreetingRequest { Name = \"Marco\" }).AsTask();\n                var echoClientLaunchTask = echoServerClientLaunchedCompletionSource.Task;\n                var finishedTask1 = await Task.WhenAny(responseTask, echoClientLaunchTask);\n\n                finishedTask1.ShouldBe(echoClientLaunchTask);\n\n                var delay = Task.Delay(Timeout1Sec);\n                var finishedTask2 = await Task.WhenAny(responseTask, delay);\n\n                finishedTask2.ShouldBe(delay);\n\n                var echoServerClient = CreateEchoServerClient(echoClientLaunchTask.Result);\n                await echoServerClient.ConnectAsync();\n\n                var response = await responseTask;\n                response.Greeting.ShouldBe(\"Polo\");\n            });\n        }\n\n        private IClient CreateEchoClient(ITestBroker testBroker = null)\n        {\n            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;\n            var clientOptions = new ClientOptionsBuilder()\n                .WithBrokerWorkingDir(testBroker.WorkingDir)\n                .WithDefaultConfiguration()\n                .WithApplicationId(\"interop.testing.EchoClient\")\n                .WithAppInstanceId(TestAppLauncher.EchoServiceAppInstanceId)\n                .Build();\n            return RegisterDisposable(ClientFactory.Instance.Create(clientOptions));\n        }\n\n        private IClient ConnectEchoClient(ITestBroker testBroker = null)\n        {\n            var client = CreateEchoClient(testBroker);\n            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);\n            return client;\n        }\n\n        private IClient ConnectClient(string appId, ITestBroker testBroker = null)\n        {\n            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;\n            var clientOptions = new ClientOptionsBuilder()\n                .WithBrokerWorkingDir(testBroker.WorkingDir)\n                .WithDefaultConfiguration()\n                .WithApplicationId(appId)\n                .Build();\n            var client = RegisterDisposable(ClientFactory.Instance.Create(clientOptions));\n            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);\n            return client;\n        }\n\n        private IClient ConnectEchoServer(Action<ClientOptionsBuilder> setup = null, ITestBroker testBroker = null)\n        {\n            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;\n            var clientOptionsBuilder = new ClientOptionsBuilder()\n                .WithBrokerWorkingDir(testBroker.WorkingDir)\n                .WithDefaultConfiguration()\n                .WithApplicationId(\"interop.testing.EchoServer\")\n                .WithAppInstanceId(TestAppLauncher.EchoServiceAppInstanceId);\n            setup?.Invoke(clientOptionsBuilder);\n            var clientOptions = clientOptionsBuilder.Build();\n            var client = RegisterDisposable(ClientFactory.Instance.Create(clientOptions));\n            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);\n            return client;\n        }\n    }\n}\n\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/ContextLinkageIntegrationTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System.Collections.Generic;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Google.Protobuf.WellKnownTypes;\n    using Plexus.Channels;\n    using Plexus.Interop.Testing;\n    using Plexus.Interop.Testing.Generated;\n    using Shouldly;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    public class ContextLinkageIntegrationTests : BaseClientBrokerTestsSuite\n    {\n        public ContextLinkageIntegrationTests(ITestOutputHelper output, TestBrokerFixture testBrokerFixture)\n            : base(output, testBrokerFixture)\n        { }\n\n        [Fact]\n        public void NewAppInstanceWillBeLaunchedOnInvocationWithinContext()\n        {\n            var serverCreatedCount = 0;\n\n            Task<GreetingResponse> HandleAsync(GreetingRequest greetingRequest, MethodCallContext context)\n            {\n                return Task.FromResult(new GreetingResponse { Greeting = greetingRequest.Name + (serverCreatedCount) });\n            }\n\n            RunWith10SecTimeout(async () =>\n            {\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(_testBrokerFixture.SharedInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(EchoServerClient.Id)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                GreetingService.Id,\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(\"Hello\", HandleAsync));\n\n                        serverCreatedCount++;\n\n                        return ClientFactory.Instance.Create(optionsBuilder.Build());\n                    });\n\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        _testBrokerFixture.SharedInstance,\n                        new Dictionary<string, TestClientFactory>\n                        {\n                            {EchoServerClient.Id, echoServerFactory}\n                        }\n                    )\n                );\n                await appLauncher.StartAsync();\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var result1 = await client.GreetingService.Hello(new GreetingRequest { Name = \"Test1\" });\n                result1.Greeting.ShouldBe(\"Test11\");\n\n                var result2 = await client.GreetingService.Hello(new GreetingRequest { Name = \"Test2\" });\n                result2.Greeting.ShouldBe(\"Test21\");\n\n                serverCreatedCount.ShouldBe(1);\n\n                var newContext = await client.ContextLinkageService.CreateContext2(new CreateContextRequest());\n                var allContexts = await client.ContextLinkageService.GetContexts(new Empty());\n\n                allContexts.Contexts.Count.ShouldBe(1);\n                allContexts.Contexts[0].Id.ShouldBe(newContext.Id);\n\n                var result3 = await client.CallInvoker.Call(\n                    GreetingService.DefaultDescriptor.HelloMethod,\n                    new GreetingRequest { Name = \"Test3\" },\n                    ContextLinkageOptions.WithCurrentContext());\n\n                result3.Greeting.ShouldBe(\"Test32\");\n\n                serverCreatedCount.ShouldBe(2);\n\n                WriteLog(\"Starting to read context loaded stream\");\n\n                var contextStatus = await client.ContextLinkageService.ContextLoadedStream(newContext).ResponseStream\n                    .FirstAsync(update => update.LoadedAppDescriptors.Any(appDescriptor => appDescriptor.AppId == EchoServerClient.Id));\n\n                contextStatus.LoadedAppDescriptors.Any(descriptor => descriptor.AppId == EchoClient.Id);\n\n                var linkedInvocations = await client.ContextLinkageService.GetLinkedInvocations(newContext);\n\n                linkedInvocations.Invocations\n                    .Single(reference => reference.AppInfo.ProvidedServices.Any(service => service.ServiceId == GreetingService.Id))\n                    .ShouldNotBeNull();\n            });\n        }\n\n        [Fact]\n        public void ShouldReceiveContextLoadedEventWhenApplicationConnected()\n        {\n            RunWith5SecTimeout(async () =>\n            {\n                var client1 = CreateClient<EchoClient>();\n                await client1.ConnectAsync();\n\n                var newContext = await client1.ContextLinkageService.CreateContext2(new CreateContextRequest());\n\n                var contextStatusUpdateStream = client1.ContextLinkageService.ContextLoadedStream(newContext).ResponseStream;\n\n                var client2 = CreateClient<EchoClient>();\n                await client2.ConnectAsync();\n\n                var contextLoadingUpdate = await contextStatusUpdateStream.FirstAsync();\n                contextLoadingUpdate.Status.ShouldBe(ContextLoadingStatus.Finished);\n                contextLoadingUpdate.LoadedAppDescriptors.Count.ShouldBe(1);\n\n                await client2.ContextLinkageService.JoinContext(newContext);\n\n                contextLoadingUpdate = await contextStatusUpdateStream.FirstAsync(update =>\n                    update.Status == ContextLoadingStatus.Finished && update.LoadedAppDescriptors.Count == 2);\n\n                contextLoadingUpdate.LoadedAppDescriptors.ShouldContain(descriptor => descriptor.AppInstanceId.Equals(client1.ApplicationInstanceId));\n                contextLoadingUpdate.LoadedAppDescriptors.ShouldContain(descriptor => descriptor.AppInstanceId.Equals(client2.ApplicationInstanceId));\n            });\n        }\n\n        [Fact]\n        public void AtMostOneContextWithSpecifiedKind()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                var ctx1 = await client.ContextLinkageService.CreateContext2(new CreateContextRequest());\n                ctx1.Kind.ShouldNotBeNullOrEmpty();\n\n                var ctx2 = await client.ContextLinkageService.CreateContext2(new CreateContextRequest());\n                var ctx3 = await client.ContextLinkageService.CreateContext2(new CreateContextRequest { Kind = ctx1.Kind });\n                ctx3.Kind.ShouldBe(ctx1.Kind);\n\n                var contexts = (await client.ContextLinkageService.GetContexts(new Empty())).Contexts;\n                contexts.OrderBy(x => x.Id).ShouldBe(new[] { ctx2, ctx3 }.OrderBy(x => x.Id));\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/Plexus.Interop.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"plexus-metadata\\**\" />\n    <Compile Remove=\"TestBroker\\**\" />\n    <EmbeddedResource Remove=\"plexus-metadata\\**\" />\n    <EmbeddedResource Remove=\"TestBroker\\**\" />\n    <None Remove=\"plexus-metadata\\**\" />\n    <None Remove=\"TestBroker\\**\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"Shouldly\" Version=\"3.0.2\" />\n    <PackageReference Include=\"System.Reactive.PlatformServices\" Version=\"3.1.1\" />\n    <PackageReference Include=\"WebSocket4Net\" Version=\"0.15.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Client\\Plexus.Interop.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Testing\\Plexus.Interop.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Service Include=\"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/SpecificAppInstanceCallIntegrationTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Testing;\n    using Plexus.Interop.Testing.Generated;\n    using Shouldly;\n    using Xunit;\n    using Xunit.Abstractions;\n    using UniqueId = Plexus.UniqueId;\n\n    public class SpecificAppInstanceCallIntegrationTests : BaseClientBrokerTestsSuite\n    {\n        public SpecificAppInstanceCallIntegrationTests(ITestOutputHelper output, TestBrokerFixture testBrokerFixture) : base(output, testBrokerFixture)\n        { }\n\n        [Fact]\n        public void InvokeTargetUsingConnectionId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1RequestCount = 0;\n                var server1 = ConnectEchoServer((request, context) =>\n                {\n                    server1RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer1\" });\n                });\n\n                var server2RequestCount = 0;\n                var server2 = ConnectEchoServer((request, context) =>\n                {\n                    server2RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer2\" });\n                });\n\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                server1RequestCount.ShouldBe(0);\n                server2RequestCount.ShouldBe(0);\n\n                var providedMethodReference = ProvidedMethodReference.CreateWithConnectionId(GreetingService.Id, GreetingService.HelloMethodId, server1.ApplicationId, server1.ConnectionId);\n                var methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                var greetingRequest = new GreetingRequest { Name = \"Client\" };\n                var response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer1\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(0);\n\n                providedMethodReference = ProvidedMethodReference.CreateWithConnectionId(GreetingService.Id, GreetingService.HelloMethodId, server2.ApplicationId, server2.ConnectionId);\n                methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer2\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(1);\n            });\n        }\n\n        [Fact]\n        public void InvokeTargetUsingAppInstanceId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1RequestCount = 0;\n                var server1 = ConnectEchoServer((request, context) =>\n                {\n                    server1RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer1\" });\n                });\n\n                var server2RequestCount = 0;\n                var server2 = ConnectEchoServer((request, context) =>\n                {\n                    server2RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer2\" });\n                });\n\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                server1RequestCount.ShouldBe(0);\n                server2RequestCount.ShouldBe(0);\n\n                var providedMethodReference = ProvidedMethodReference.CreateWithAppInstanceId(GreetingService.Id, GreetingService.HelloMethodId, server1.ApplicationId, server1.ApplicationInstanceId);\n                var methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                var greetingRequest = new GreetingRequest { Name = \"Client\" };\n                var response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer1\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(0);\n\n                providedMethodReference = ProvidedMethodReference.CreateWithAppInstanceId(GreetingService.Id, GreetingService.HelloMethodId, server2.ApplicationId, server2.ApplicationInstanceId);\n                methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer2\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(1);\n            });\n        }\n\n        [Fact]\n        public void InvokeTargetUsingAppInstanceIdWithoutAppId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1RequestCount = 0;\n                var server1 = ConnectEchoServer((request, context) =>\n                {\n                    server1RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer1\" });\n                });\n\n                var server2RequestCount = 0;\n                var server2 = ConnectEchoServer((request, context) =>\n                {\n                    server2RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer2\" });\n                });\n\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                server1RequestCount.ShouldBe(0);\n                server2RequestCount.ShouldBe(0);\n\n                var providedMethodReference = ProvidedMethodReference.CreateWithAppInstanceId(GreetingService.Id, GreetingService.HelloMethodId, server1.ApplicationInstanceId);\n                var methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                var greetingRequest = new GreetingRequest { Name = \"Client\" };\n                var response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer1\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(0);\n\n                providedMethodReference = ProvidedMethodReference.CreateWithAppInstanceId(GreetingService.Id, GreetingService.HelloMethodId, server2.ApplicationInstanceId);\n                methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor, greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer2\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(1);\n            });\n        }\n\n        [Fact]\n        public void InvokeTargetUsingConnectionIdWithoutAppId()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                var server1RequestCount = 0;\n                var server1 = ConnectEchoServer((request, context) =>\n                {\n                    server1RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer1\" });\n                });\n\n                var server2RequestCount = 0;\n                var server2 = ConnectEchoServer((request, context) =>\n                {\n                    server2RequestCount++;\n                    return Task.FromResult(new GreetingResponse { Greeting = \"FromServer2\" });\n                });\n\n                var client = CreateClient<EchoClient>();\n                await client.ConnectAsync();\n\n                server1RequestCount.ShouldBe(0);\n                server2RequestCount.ShouldBe(0);\n\n                var providedMethodReference = ProvidedMethodReference.CreateWithConnectionId(GreetingService.Id,\n                    GreetingService.HelloMethodId, server1.ConnectionId);\n                var methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                var greetingRequest = new GreetingRequest { Name = \"Client\" };\n                var response =\n                    await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor,\n                        greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer1\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(0);\n\n                providedMethodReference = ProvidedMethodReference.CreateWithConnectionId(GreetingService.Id,\n                    GreetingService.HelloMethodId, server2.ConnectionId);\n                methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                response = await client.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor,\n                    greetingRequest);\n\n                response.Greeting.ShouldBe(\"FromServer2\");\n                server1RequestCount.ShouldBe(1);\n                server2RequestCount.ShouldBe(1);\n            });\n        }\n\n        [Fact]\n        public void InvokeApplicationBeforeItsConnection()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                Task<GreetingResponse> HandleAsync(GreetingRequest request, MethodCallContext context)\n                {\n                    return Task.FromResult(new GreetingResponse {Greeting = request.Name + \"1\"});\n                }\n\n                var brokerInstance = _testBrokerFixture.SharedInstance;\n                var createdServersCount = 0;\n                var createdServerClient = new TaskCompletionSource<IClient>();\n                var echoServerFactory = new TestClientFactory(\n                    (broker, id) =>\n                    {\n                        var optionsBuilder = new ClientOptionsBuilder()\n                            .WithBrokerWorkingDir(brokerInstance.WorkingDir)\n                            .WithAppInstanceId(id)\n                            .WithApplicationId(EchoServerClient.Id)\n                            .WithDefaultConfiguration()\n                            .WithProvidedService(\n                                GreetingService.Id,\n                                x => x.WithUnaryMethod<GreetingRequest, GreetingResponse>(GreetingService.HelloMethodId,\n                                    HandleAsync));\n                        var serverClient = ClientFactory.Instance.Create(optionsBuilder.Build());\n                        createdServerClient.SetResult(serverClient);\n                        createdServersCount++;\n                        return Task.FromResult(serverClient);\n                    });\n\n                var appLauncher = RegisterDisposable(\n                    new TestAppLauncher(\n                        brokerInstance,\n                        new Dictionary<string, TestClientFactory>\n                        {\n                            {EchoServerClient.Id, echoServerFactory}\n                        },\n                        false\n                    )\n                );\n                await appLauncher.StartAsync();\n\n                var client1 = CreateClient<EchoClient>();\n                await client1.ConnectAsync();\n\n                var client2 = CreateClient<EchoClient>();\n                await client2.ConnectAsync();\n\n                var helloTask = client1.GreetingService.Hello(new GreetingRequest {Name = \"Test1\"}).ResponseAsync;\n                var callUnconnectedServerTask = createdServerClient.Task.ContinueWith(async task =>\n                {\n                    var serverClient = task.Result;\n                    await Task.Delay(TimeSpan.FromSeconds(1));\n                    var providedMethodReference = ProvidedMethodReference.CreateWithAppInstanceId(GreetingService.Id,\n                        GreetingService.HelloMethodId, EchoServerClient.Id, serverClient.ApplicationInstanceId);\n                    var methodCallDescriptor = new MethodCallDescriptor(providedMethodReference);\n                    await client2.CallInvoker.CallUnary<GreetingRequest, GreetingResponse>(methodCallDescriptor,\n                        new GreetingRequest() {Name = \"Test2\"});\n                }).Unwrap();\n\n                var connectedServerAfterDelayTask = createdServerClient.Task.ContinueWith(async task =>\n                {\n                    var serverClient = task.Result;\n\n                    await Task.Delay(TimeSpan.FromSeconds(3));\n\n                    serverClient.ConnectionId.ShouldBe(UniqueId.Empty);\n                    var onlineConnectionsResponse =\n                        await client1.AppLifecycleService.GetConnections(new GetConnectionsRequest\n                            {AppInstanceId = serverClient.ApplicationInstanceId});\n                    onlineConnectionsResponse.Connections.Count.ShouldBe(0);\n\n                    await serverClient.ConnectAsync();\n                }).Unwrap();\n\n                await Task.WhenAll(helloTask, callUnconnectedServerTask, connectedServerAfterDelayTask);\n\n                createdServersCount.ShouldBe(1);\n            });\n        }\n\n        private IClient ConnectEchoServer(UnaryMethodHandler<GreetingRequest, GreetingResponse> handleHello)\n        {\n            return ConnectEchoServer(builder => builder.WithProvidedService(GreetingService.Id, x => x.WithUnaryMethod(GreetingService.HelloMethodId, handleHello)));\n        }\n\n        private IClient ConnectEchoServer(Action<ClientOptionsBuilder> setup = null, ITestBroker testBroker = null)\n        {\n            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;\n            var clientOptionsBuilder = new ClientOptionsBuilder()\n                .WithBrokerWorkingDir(testBroker.WorkingDir)\n                .WithDefaultConfiguration()\n                .WithApplicationId(\"interop.testing.EchoServer\");\n            setup?.Invoke(clientOptionsBuilder);\n            var clientOptions = clientOptionsBuilder.Build();\n            var client = RegisterDisposable(ClientFactory.Instance.Create(clientOptions));\n            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);\n            return client;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Tests.sln",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.26124.0\nMinimumVisualStudioVersion = 15.0.26124.0\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Tests\", \"Plexus.Interop.Tests\\Plexus.Interop.Tests.csproj\", \"{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Pipes.Tests\", \"Plexus.Interop.Transport.Pipes.Tests\\Plexus.Interop.Transport.Pipes.Tests.csproj\", \"{9F37DA8C-5E39-4563-9B93-D9F8502483FD}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Protocol.Tests\", \"Plexus.Interop.Transport.Protocol.Tests\\Plexus.Interop.Transport.Protocol.Tests.csproj\", \"{33EA817C-49E0-4262-9DBD-00675A14A8CB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Pipes.Tests\", \"Plexus.Interop.Transport.Transmission.Pipes.Tests\\Plexus.Interop.Transport.Transmission.Pipes.Tests.csproj\", \"{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.WebSockets.Tests\", \"Plexus.Interop.Transport.Transmission.WebSockets.Tests\\Plexus.Interop.Transport.Transmission.WebSockets.Tests.csproj\", \"{A6709CA7-1F52-43B6-A065-791E233136C1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.WebSockets.Tests\", \"Plexus.Interop.Transport.WebSockets.Tests\\Plexus.Interop.Transport.WebSockets.Tests.csproj\", \"{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Utils.Tests\", \"Plexus.Utils.Tests\\Plexus.Utils.Tests.csproj\", \"{2C430728-C292-4510-9497-7A5D71278DF9}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client.Marshalling.Protobuf.Tests\", \"Plexus.Interop.Client.Marshalling.Protobuf.Tests\\Plexus.Interop.Client.Marshalling.Protobuf.Tests.csproj\", \"{0493D415-3127-405B-8ADA-5E54FD3D048C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Metamodel.Json.Tests\", \"Plexus.Interop.Metamodel.Json.Tests\\Plexus.Interop.Metamodel.Json.Tests.csproj\", \"{613C39E3-D987-407C-BAA2-97630CB11BF7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol.Protobuf.Tests\", \"Plexus.Interop.Protocol.Protobuf.Tests\\Plexus.Interop.Protocol.Protobuf.Tests.csproj\", \"{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Plexus.Interop.Broker.Core.Tests\", \"Plexus.Interop.Broker.Core.Tests\\Plexus.Interop.Broker.Core.Tests.csproj\", \"{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|x64.Build.0 = Debug|x64\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Debug|x86.Build.0 = Debug|x86\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|x64.ActiveCfg = Release|x64\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|x64.Build.0 = Release|x64\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|x86.ActiveCfg = Release|x86\n\t\t{BCD5FBE3-0282-4803-86F3-6C71B1737AD8}.Release|x86.Build.0 = Release|x86\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|x64.Build.0 = Debug|x64\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Debug|x86.Build.0 = Debug|x86\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|x64.ActiveCfg = Release|x64\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|x64.Build.0 = Release|x64\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|x86.ActiveCfg = Release|x86\n\t\t{9F37DA8C-5E39-4563-9B93-D9F8502483FD}.Release|x86.Build.0 = Release|x86\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|x64.Build.0 = Debug|x64\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Debug|x86.Build.0 = Debug|x86\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|x64.ActiveCfg = Release|x64\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|x64.Build.0 = Release|x64\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|x86.ActiveCfg = Release|x86\n\t\t{33EA817C-49E0-4262-9DBD-00675A14A8CB}.Release|x86.Build.0 = Release|x86\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|x64.Build.0 = Debug|x64\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Debug|x86.Build.0 = Debug|x86\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|x64.ActiveCfg = Release|x64\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|x64.Build.0 = Release|x64\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|x86.ActiveCfg = Release|x86\n\t\t{80A4F4AA-7DEF-4FAC-AD43-E3D6D5B0D45C}.Release|x86.Build.0 = Release|x86\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|x64.Build.0 = Debug|x64\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Debug|x86.Build.0 = Debug|x86\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|x64.ActiveCfg = Release|x64\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|x64.Build.0 = Release|x64\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|x86.ActiveCfg = Release|x86\n\t\t{A6709CA7-1F52-43B6-A065-791E233136C1}.Release|x86.Build.0 = Release|x86\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|x64.Build.0 = Debug|x64\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Debug|x86.Build.0 = Debug|x86\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|x64.ActiveCfg = Release|x64\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|x64.Build.0 = Release|x64\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|x86.ActiveCfg = Release|x86\n\t\t{D77E9C9B-4B5C-421A-BA35-EAB5AED86F56}.Release|x86.Build.0 = Release|x86\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|x64.Build.0 = Debug|x64\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Debug|x86.Build.0 = Debug|x86\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|x64.ActiveCfg = Release|x64\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|x64.Build.0 = Release|x64\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|x86.ActiveCfg = Release|x86\n\t\t{2C430728-C292-4510-9497-7A5D71278DF9}.Release|x86.Build.0 = Release|x86\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|x64.Build.0 = Debug|x64\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Debug|x86.Build.0 = Debug|x86\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|x64.ActiveCfg = Release|x64\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|x64.Build.0 = Release|x64\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|x86.ActiveCfg = Release|x86\n\t\t{0493D415-3127-405B-8ADA-5E54FD3D048C}.Release|x86.Build.0 = Release|x86\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|x64.Build.0 = Debug|x64\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Debug|x86.Build.0 = Debug|x86\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|x64.ActiveCfg = Release|x64\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|x64.Build.0 = Release|x64\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|x86.ActiveCfg = Release|x86\n\t\t{613C39E3-D987-407C-BAA2-97630CB11BF7}.Release|x86.Build.0 = Release|x86\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|x64.Build.0 = Debug|x64\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Debug|x86.Build.0 = Debug|x86\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|x64.ActiveCfg = Release|x64\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|x64.Build.0 = Release|x64\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|x86.ActiveCfg = Release|x86\n\t\t{BC0A00B4-647F-4F88-B07D-3F0AE48A710E}.Release|x86.Build.0 = Release|x86\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|x64.Build.0 = Debug|x64\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Debug|x86.Build.0 = Debug|x86\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|x64.ActiveCfg = Release|x64\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|x64.Build.0 = Release|x64\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|x86.ActiveCfg = Release|x86\n\t\t{CB9C7C41-DCFD-45FC-9036-7B0A44075EF1}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/ChannelMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using System;\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal struct ChannelMessage : IPooledObject\n    {\n        public ChannelMessage(ITransportChannelHeader header)\n            : this(header, Maybe<IPooledBuffer>.Nothing)\n        {\n        }\n\n        public ChannelMessage(ITransportChannelHeader header, IPooledBuffer payload)\n            : this(header, new Maybe<IPooledBuffer>(payload))\n        {\n        }\n\n        public ChannelMessage(ITransportChannelHeader header, Maybe<IPooledBuffer> payload)\n        {\n            if (payload.HasValue && payload.Value == null)\n            {\n                throw new ArgumentException(nameof(payload));\n            }\n            Header = header;\n            Payload = payload;\n        }\n\n        public ITransportChannelHeader Header { get; }\n\n        public Maybe<IPooledBuffer> Payload { get; }\n\n        public static implicit operator TransportMessage(ChannelMessage value)\n        {\n            return new TransportMessage(value.Header, value.Payload);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is ChannelMessage))\n            {\n                return false;\n            }\n\n            var message = (ChannelMessage)obj;\n            return EqualityComparer<ITransportChannelHeader>.Default.Equals(Header, message.Header) &&\n                   Payload.Equals(message.Payload);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 1268427973;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<ITransportChannelHeader>.Default.GetHashCode(Header);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<IPooledBuffer>>.Default.GetHashCode(Payload);\n            return hashCode;\n        }\n\n        public void Retain()\n        {\n            Header.Retain();\n            if (Payload.HasValue)\n            {\n                Payload.Value.Retain();\n            }\n        }\n\n        public void Dispose()\n        {\n            Header.Dispose();\n            if (Payload.HasValue)\n            {\n                Payload.Value.Dispose();\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Header)}: {Header}, {nameof(Payload)}: {Payload}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/FrameMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Pools;\n    using System.Collections.Generic;\n\n    internal struct FrameMessage : IPooledObject\n    {\n        public FrameMessage(ITransportFrameHeader header, IPooledBuffer payload)\n        {\n            Header = header;\n            Payload = payload;\n        }\n\n        public static implicit operator ChannelMessage(FrameMessage value)\n        {\n            return new ChannelMessage(value.Header, value.Payload);\n        }\n\n        public ITransportFrameHeader Header { get; }\n\n        public IPooledBuffer Payload { get; }\n\n        public void Retain()\n        {\n            Header.Retain();\n            Payload.Retain();\n        }\n\n        public void Dispose()\n        {\n            Header.Dispose();\n            Payload.Dispose();\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is FrameMessage))\n            {\n                return false;\n            }\n\n            var message = (FrameMessage)obj;\n            return EqualityComparer<ITransportFrameHeader>.Default.Equals(Header, message.Header) &&\n                   Payload.Equals(message.Payload);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 1268427973;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<ITransportFrameHeader>.Default.GetHashCode(Header);\n            hashCode = hashCode * -1521134295 + EqualityComparer<IPooledBuffer>.Default.GetHashCode(Payload);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(FrameMessage).Name}, {nameof(Header)}: {Header}, {nameof(Payload)}: {Payload}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/ITransportReceiveProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using Plexus.Channels;\n\nnamespace Plexus.Interop.Transport.Internal\n{\n    internal interface ITransportReceiveProcessor\n    {\n        UniqueId InstanceId { get; }\n\n        IReadableChannel<ChannelMessage> In { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/ITransportSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Channels;\n    using System.Threading.Tasks;\n\n    internal interface ITransportSendProcessor\n    {\n        UniqueId InstanceId { get; }\n\n        Task Completion { get; }\n\n        ITerminatableWritableChannel<ChannelMessage> Out { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol.Common;\n    using Plexus.Interop.Transport.Protocol;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class TransportChannel : ITransportChannel\n    {\n        private readonly ILogger _log;\n        private readonly TransportChannelSendProcessor _sendProcessor;\n        private readonly IChannel<TransportMessageFrame> _receiveBuffer = new BufferedChannel<TransportMessageFrame>(3);\n        private readonly TransportChannelHeaderHandler<Task, ChannelMessage> _incomingMessageHandler;        \n\n        public TransportChannel(\n            UniqueId connectionId,\n            UniqueId channelId,\n            IWritableChannel<ChannelMessage> output,\n            IChannelHeaderFactory headerFactory)\n        {\n            ConnectionId = connectionId;\n            Id = channelId;\n            _log = LogManager.GetLogger<TransportChannel>($\"{connectionId}.{channelId}\");\n            _incomingMessageHandler = new TransportChannelHeaderHandler<Task, ChannelMessage>(HandleIncomingAsync, HandleIncomingAsync, HandleIncomingAsync);\n            _sendProcessor = new TransportChannelSendProcessor(connectionId, channelId, output, headerFactory);\n            Completion = ProcessAsync().LogCompletion(_log);\n        }\n\n        public UniqueId Id { get; }\n\n        public UniqueId ConnectionId { get; }\n\n        public Task Completion { get; }\n\n        internal Task Initialized => _sendProcessor.Initialized;\n\n        internal bool TerminateReceiving(Exception error = null)\n        {\n            return _receiveBuffer.Out.TryTerminate(error);\n        }\n\n        public ITerminatableWritableChannel<TransportMessageFrame> Out => _sendProcessor.Out;\n\n        public IReadableChannel<TransportMessageFrame> In => _receiveBuffer.In;\n\n        public async Task HandleIncomingAsync(ChannelMessage message)\n        {\n            try\n            {\n                _log.Trace(\"Handling incoming message {0}\", message);\n                await message.Header.Handle(_incomingMessageHandler, message).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {                \n                _log.Error(ex, \"Exception while handling incoming message\");\n                _sendProcessor.Out.TryTerminate(ex);\n                _receiveBuffer.Out.TryTerminate(ex);\n            }\n            finally\n            {\n                message.Header.Dispose();\n            }\n        }\n\n        private Task ProcessAsync()\n        {\n            return Task.WhenAll(_sendProcessor.Completion, _receiveBuffer.In.Completion);\n        }\n\n        private async Task HandleIncomingAsync(ITransportFrameHeader header, ChannelMessage message)\n        {\n            try\n            {\n                await _receiveBuffer.Out.WriteAsync(new TransportMessageFrame(message.Payload.Value, header.HasMore)).ConfigureAwait(false);\n            }\n            catch\n            {\n                if (message.Payload.HasValue)\n                {\n                    message.Payload.Value.Dispose();\n                }\n                throw;\n            }\n        }\n\n        private Task HandleIncomingAsync(ITransportChannelCloseHeader header, ChannelMessage message)\n        {\n            switch (header.Completion.Status)\n            {\n                case CompletionStatusHeader.Completed:\n                    _receiveBuffer.Out.TryComplete();\n                    break;\n                case CompletionStatusHeader.Canceled:\n                    _sendProcessor.Out.TryTerminate();\n                    _receiveBuffer.Out.TryTerminate();\n                    break;\n                case CompletionStatusHeader.Failed:\n                    var error = header.Completion.Error.Value;\n                    _sendProcessor.Out.TryTerminate();\n                    _receiveBuffer.Out.TryTerminate(new RemoteErrorException(error));\n                    break;\n                default:\n                    throw new InvalidOperationException();\n            }\n            return TaskConstants.Completed;\n        }\n\n        private static Task HandleIncomingAsync(ITransportChannelOpenHeader header, ChannelMessage message)\n        {\n            return TaskConstants.Completed;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Id)}: {Id}, {nameof(ConnectionId)}: {ConnectionId}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportChannelSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol.Common;\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Pools;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class TransportChannelSendProcessor\n    {\n        private readonly ILogger _log;\n        private readonly IChannel<TransportMessageFrame> _buffer = new BufferedChannel<TransportMessageFrame>(3);\n        private readonly IWritableChannel<ChannelMessage> _out;\n        private readonly IChannelHeaderFactory _headerFactory;\n        private readonly Promise _initialized = new Promise();\n\n        public TransportChannelSendProcessor(\n            UniqueId connectionId,\n            UniqueId channelId,\n            IWritableChannel<ChannelMessage> @out,\n            IChannelHeaderFactory headerFactory)\n        {\n            ChannelId = channelId;\n            _log = LogManager.GetLogger<TransportChannelSendProcessor>($\"{connectionId.ToString()}.{channelId.ToString()}\");\n            _headerFactory = headerFactory;\n            _out = @out;\n            _buffer.Out.PropagateTerminationFrom(_out.Completion);\n            Completion = ProcessAsync().LogCompletion(_log);\n            Completion.PropagateCompletionToPromise(_initialized);\n        }\n\n        public UniqueId ChannelId { get; }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<TransportMessageFrame> Out => _buffer.Out;\n\n        internal Task Initialized => _initialized.Task;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                _log.Trace(\"Starting sending\");\n                await SendOpenMessageAsync().ConfigureAwait(false);\n                _initialized.TryComplete();\n                await _buffer.In.ConsumeAsync(SendAsync).ConfigureAwait(false);                \n                await SendCloseMessageAsync().ConfigureAwait(false);\n                _log.Trace(\"Sending completed\");\n            }\n            catch (Exception ex)\n            {                              \n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                await SendCloseMessageAsync(ex).IgnoreExceptions().ConfigureAwait(false);\n                _log.Trace(\"Sending failed: {0}\", ex.FormatTypeAndMessage());\n                throw;\n            }            \n        }\n\n        private async Task SendOpenMessageAsync()\n        {\n            var openHeader = _headerFactory.CreateChannelOpenHeader(ChannelId);\n            await SendAsync(openHeader).ConfigureAwait(false);\n        }\n\n        private Task SendAsync(ITransportChannelHeader header, IPooledBuffer body) => SendAsync(header, new Maybe<IPooledBuffer>(body));\n\n        private async Task SendAsync(ITransportChannelHeader header, Maybe<IPooledBuffer> body = default)\n        {\n            try\n            {\n                _log.Trace(\"Sending: {0} with body {1}\", header, body);\n                await _out.WriteAsync(new ChannelMessage(header, body)).ConfigureAwait(false);\n            }\n            catch\n            {\n                header.Dispose();\n                if (body.HasValue)\n                {\n                    body.Value.Dispose();\n                }\n                throw;\n            }\n        }\n\n        private async Task SendCloseMessageAsync(Exception error = null)\n        {\n            var closeHeader = _headerFactory.CreateChannelCloseHeader(\n                ChannelId,\n                error == null\n                    ? CompletionHeader.Completed\n                    : error is OperationCanceledException\n                        ? CompletionHeader.Canceled\n                        : CompletionHeader.Failed(TransportUtils.GetErrorHeader(error)));\n            await SendAsync(closeHeader).ConfigureAwait(false);\n        }\n\n        private async Task SendAsync(TransportMessageFrame frame)\n        {\n            var header = _headerFactory.CreateFrameHeader(ChannelId, frame.HasMore, frame.Payload.Count);\n            await SendAsync(header, frame.Payload).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n\n    internal sealed class TransportClient : ITransportClient\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<TransportClient>();\n\n        private readonly ITransmissionClient _transmissionClient;\n        private readonly TransportConnectionFactory _connectionFactory;\n\n        public TransportClient(\n            TransportType transportType,\n            ITransmissionClient transmissionClient,\n            ITransportProtocolSerializationProvider serializationProvider)\n        {\n            _transmissionClient = transmissionClient;\n            _connectionFactory = new TransportConnectionFactory(transportType, serializationProvider);\n        }\n\n        public async ValueTask<ITransportConnection> ConnectAsync(string brokerWorkingDir, CancellationToken cancellationToken)\n        {\n            var transmissionConnection = await _transmissionClient.ConnectAsync(brokerWorkingDir, cancellationToken).ConfigureAwait(false);\n            try\n            {\n                return _connectionFactory.Create(transmissionConnection);\n            }\n            catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)\n            {\n                Log.Trace(\"Connection canceled\");\n                transmissionConnection.Dispose();\n                throw;\n            }\n            catch (Exception ex)\n            {\n                Log.Trace(\"Connection failed: {0}\", ex.FormatTypeAndMessage());\n                transmissionConnection.Dispose();\n                throw;\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Transmission transport: {_transmissionClient.GetType().Name}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// ReSharper disable InconsistentlySynchronizedField\nnamespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Protocol;\n    using System;\n    using System.Collections.Concurrent;\n    using System.Linq;\n    using System.Threading.Tasks;\n\n    internal sealed class TransportConnection : ITransportConnection\n    {\n        private readonly ILogger _log;\n        private readonly ITransportSendProcessor _transportSendProcessor;\n        private readonly ITransportReceiveProcessor _transportReceiveProcessor;\n        private readonly ITransportHeaderFactory _headerFactory;\n        private readonly IChannel<ITransportChannel> _incomingChannelQueue = new BufferedChannel<ITransportChannel>(3);\n        private readonly TransportChannelHeaderHandler<Task, ChannelMessage> _incomingMessageHandler;\n        private readonly ConcurrentDictionary<UniqueId, TransportChannel> _channels = new ConcurrentDictionary<UniqueId, TransportChannel>();\n        private readonly Latch _sendCompletion = new Latch();\n\n        public TransportConnection(\n            TransportType transportType,\n            ITransportSendProcessor transportSendProcessor,\n            ITransportReceiveProcessor transportReceiveProcessor,\n            ITransportHeaderFactory headerFactory)\n        {\n            Id = transportSendProcessor.InstanceId;\n            _log = LogManager.GetLogger<TransportConnection>(Id.ToString());\n            _transportSendProcessor = transportSendProcessor;\n            _transportReceiveProcessor = transportReceiveProcessor;\n            _headerFactory = headerFactory;\n            _incomingMessageHandler = new TransportChannelHeaderHandler<Task, ChannelMessage>(HandleIncomingAsync, HandleIncomingAsync, HandleIncomingAsync);\n            TransportType = transportType;\n            Completion = ProcessAsync().LogCompletion(_log);\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public IReadableChannel<ITransportChannel> IncomingChannels => _incomingChannelQueue.In;\n\n        public TransportType TransportType { get; }\n\n        public bool TryComplete()\n        {\n            if (!_sendCompletion.TryEnter())\n            {\n                return false;\n            }\n            CompleteSendingAsync().IgnoreAwait(_log);\n            return true;\n        }\n\n        public bool TryTerminate(Exception error = null)\n        {\n            if (!_sendCompletion.TryEnter())\n            {\n                return false;\n            }\n            TerminateSendingAsync(error).IgnoreAwait(_log);\n            return true;\n        }\n\n        public async ValueTask<Maybe<ITransportChannel>> TryCreateChannelSafeAsync()\n        {\n            if (_sendCompletion.IsEntered)\n            {\n                return Nothing.Instance;\n            }\n            return await TryCreateChannelSafeAsync(UniqueId.Generate());\n        }\n\n        private async ValueTask<Maybe<ITransportChannel>> TryCreateChannelSafeAsync(UniqueId channelId)\n        {\n            TransportChannel channel;\n            lock (_channels)\n            {\n                if (_sendCompletion.IsEntered)\n                {                    \n                    return Nothing.Instance;\n                }\n                _log.Trace(\"Creating new channel by local request: {0}\", channelId);\n                channel = new TransportChannel(Id, channelId, _transportSendProcessor.Out, _headerFactory);\n                _channels[channel.Id] = channel;\n                channel.Completion.ContinueWithSynchronously((Action<Task, object>)OnChannelCompleted, channel).IgnoreAwait(_log);                \n            }\n            await channel.Initialized.ConfigureAwait(false);\n            return channel;\n        }\n\n        private void OnChannelCompleted(Task completion, object state)\n        {\n            var channel = (TransportChannel)state;\n            _channels.TryRemove(channel.Id, out _);\n        }\n\n        private async Task ProcessAsync()\n        {\n            Task receiveTask = TaskConstants.Completed;\n            try\n            {\n                receiveTask = ReceiveAsync();\n                await Task.WhenAny(receiveTask, _transportSendProcessor.Completion).Unwrap().ConfigureAwait(false);\n                await CompleteSendingAsync().ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                await TerminateSendingAsync(ex).IgnoreExceptions().ConfigureAwait(false);\n                throw;\n            }\n            finally\n            {\n                await Task.WhenAll(receiveTask, _transportSendProcessor.Completion).ConfigureAwait(false);\n            }\n        }\n\n        private async Task ReceiveAsync()\n        {\n            try\n            {\n                await _transportReceiveProcessor.In.ConsumeAsync(HandleReceivedMessageAsync).ConfigureAwait(false);\n                _incomingChannelQueue.Out.TryComplete();\n                await CompleteReceivingAsync().ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _incomingChannelQueue.Out.TryTerminate(ex);\n                await CompleteReceivingAsync(ex).ConfigureAwait(false);\n                throw;\n            }\n        }\n\n        private async Task CompleteReceivingAsync(Exception error = null)\n        {\n            Task completion;\n            lock (_channels)\n            {\n                _log.Trace(\"Terminating receiving for {0} channels ({1}): {2}\", _channels.Count, string.Join(\", \", _channels.Keys), error.FormatTypeAndMessage());\n                foreach (var channel in _channels.Values)\n                {\n                    channel.TerminateReceiving(error);\n                }\n                completion = Task.WhenAll(_channels.Values.Select(x => x.Completion)).IgnoreExceptions();\n            }\n            await completion.ConfigureAwait(false);\n        }\n\n        private async Task CompleteSendingAsync()\n        {\n            Task completion;\n            lock (_channels)\n            {\n                _sendCompletion.TryEnter();\n                _log.Trace(\"Completing sending for {0} channels\", _channels.Count);\n                foreach (var channel in _channels.Values)\n                {\n                    channel.Out.TryComplete();\n                }\n                completion = Task.WhenAll(_channels.Values.Select(x => x.Out.Completion)).IgnoreExceptions();\n            }\n            await completion.ConfigureAwait(false);\n            _log.Trace(\"Sending completed for all channels\");\n            _transportSendProcessor.Out.TryComplete();\n        }\n\n        private async Task TerminateSendingAsync(Exception error = null)\n        {            \n            if (error is OperationCanceledException)\n            {\n                error = null;\n            }\n            Task completion;\n            lock (_channels)\n            {\n                _sendCompletion.TryEnter();\n                _log.Trace(\"Terminating sending for {0} channels: {1}\", _channels.Count, error.FormatTypeAndMessage());\n                foreach (var channel in _channels.Values)\n                {\n                    channel.Out.TryTerminate(error);\n                }\n                completion = Task.WhenAll(_channels.Values.Select(x => x.Out.Completion)).IgnoreExceptions();\n            }\n            await completion.ConfigureAwait(false);\n            _transportSendProcessor.Out.TryTerminate(error);\n        }\n\n        private async Task HandleReceivedMessageAsync(ChannelMessage message)\n        {\n            _log.Trace(\"Handling received message {0}\", message);\n            await message.Header.Handle(_incomingMessageHandler, message).ConfigureAwait(false);\n        }\n\n        private async Task HandleIncomingAsync(ITransportFrameHeader header, ChannelMessage message)\n        {\n            if (_channels.TryGetValue(header.ChannelId, out var channel))\n            {\n                await channel.HandleIncomingAsync(message).ConfigureAwait(false);\n            }\n            else\n            {\n                _log.Trace(\"Skipping message because the specified channel not found: {0}\", message);\n                message.Dispose();\n            }\n        }\n\n        private async Task HandleIncomingAsync(ITransportChannelCloseHeader header, ChannelMessage message)\n        {\n            if (_channels.TryGetValue(header.ChannelId, out var channel))\n            {\n                await channel.HandleIncomingAsync(message).ConfigureAwait(false);\n            }\n            else\n            {\n                _log.Trace(\"Skipping message because the specified channel not found: {0}\", header);\n                message.Dispose();\n            }\n        }\n\n        private async Task HandleIncomingAsync(ITransportChannelOpenHeader header, ChannelMessage message)\n        {\n            using (message)\n            {\n                if (_sendCompletion.IsEntered)\n                {\n                    _log.Trace(\"Skipping message because termination is in progress: {0}\", header);\n                    return;\n                }\n                TransportChannel channel;\n                lock (_channels)\n                {\n                    if (_channels.ContainsKey(header.ChannelId))\n                    {\n                        _log.Trace(\"Skipping message because the specified channel already exists: {0}\", header);\n                        return;\n                    }\n                    _log.Trace(\"Creating new channel by remote request: {0}\", header);\n                    channel = new TransportChannel(Id, header.ChannelId, _transportSendProcessor.Out, _headerFactory);\n                    _channels[channel.Id] = channel;\n                    channel.Completion.ContinueWithSynchronously((Action<Task, object>)OnChannelCompleted, channel).IgnoreAwait(_log);\n                }\n                await _incomingChannelQueue.Out.WriteAsync(channel).ConfigureAwait(false);\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Id)}: {Id}}}\";\n        }\n\n        public void Dispose()\n        {\n            TryTerminate();\n            Completion.IgnoreExceptions().GetResult();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportConnectionFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using System;\n\n    internal sealed class TransportConnectionFactory\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<TransportConnectionFactory>();\n\n        private readonly TransportType _transportType;\n        private readonly ITransportProtocolSerializer _serializer;\n        private readonly ITransportProtocolDeserializer _deserializer;\n\n        public TransportConnectionFactory(TransportType transportType, ITransportProtocolSerializationProvider serializationProvider)\n        {\n            _transportType = transportType;\n            _serializer = serializationProvider.GetSerializer();\n            _deserializer = serializationProvider.GetDeserializer(TransportHeaderPool.Instance);\n        }\n\n        public ITransportConnection Create(ITransmissionConnection transmissionConnection)\n        {\n            try\n            {\n                var sender = new TransportSendProcessor(transmissionConnection, TransportHeaderPool.Instance, _serializer);\n                var receiver = new TransportReceiveProcessor(transmissionConnection, _deserializer);\n                var connection = new TransportConnection(_transportType, sender, receiver, TransportHeaderPool.Instance);\n                Log.Trace(\"New connection created: {0}\", connection.Id);\n                return connection;\n            }\n            catch (Exception ex)\n            {\n                Log.Trace(\"Connection failed: {0}\", ex.FormatTypeAndMessage());\n                transmissionConnection.Dispose();\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportConnectionStateValidator.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using System;\nusing Plexus.Interop.Protocol.Common;\nusing Plexus.Interop.Transport.Protocol;\n\nnamespace Plexus.Interop.Transport.Internal\n{\n    internal sealed class TransportConnectionStateValidator\n    {\n        private readonly TransportHeaderHandler<Nothing, Nothing> _handler;\n        private readonly TransportConnectionHeaderHandler<Nothing, Nothing> _connectionHandler;\n        private State _state = State.NotConnected;\n\n        public TransportConnectionStateValidator()\n        {\n            _handler = new TransportHeaderHandler<Nothing, Nothing>(Handle, Handle);\n            _connectionHandler = new TransportConnectionHeaderHandler<Nothing, Nothing>(Handle, Handle);\n        }\n\n        public bool IsDisconnected => _state == State.Disconnected;\n\n        public bool IsConnected => _state == State.Connected;\n\n        public void OnMessage(ITransportHeader header)\n        {\n            header.Handle(_handler, Nothing.Instance);\n        }\n\n        private Nothing Handle(ITransportChannelHeader header, Nothing _)\n        {\n            switch (_state)\n            {\n                case State.Connected:\n                    break;\n                default:\n                    throw new ProtocolException($\"Received unexpected header of type {header.GetType()} in state {_state}\");\n            }\n            return _;\n        }\n\n        private Nothing Handle(ITransportConnectionHeader header, Nothing _)\n        {\n            return header.Handle(_connectionHandler, _);\n        }\n\n        private Nothing Handle(ITransportConnectionCloseHeader header, Nothing _)\n        {\n            switch (_state)\n            {\n                case State.NotConnected:\n                case State.Connected:\n                    _state = State.Disconnected;\n                    ThrowIfTermination(header);\n                    break;\n                default:\n                    throw new ProtocolException($\"Received unexpected header of type {header.GetType()} in state {_state}\");\n            }\n            return _;\n        }\n\n        private void ThrowIfTermination(ITransportConnectionCloseHeader header)\n        {\n            switch (header.Completion.Status)\n            {\n                case CompletionStatusHeader.Canceled:\n                    throw new OperationCanceledException();\n                case CompletionStatusHeader.Failed:\n                    var error = header.Completion.Error.Value;\n                    throw new RemoteErrorException(error);\n            }\n        }\n\n        private Nothing Handle(ITransportConnectionOpenHeader header, Nothing _)\n        {\n            switch (_state)\n            {\n                case State.NotConnected:\n                    _state = State.Connected;\n                    break;\n                default:\n                    throw new ProtocolException($\"Received unexpected header of type {header.GetType()} in state {_state}\");\n            }\n            return _;\n        }\n\n        private enum State\n        {\n            NotConnected,\n            Connected,\n            Disconnected\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportReceiveProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using System.Runtime.InteropServices;\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using Plexus.Pools;\n    using System.Threading.Tasks;\n\n    internal sealed class TransportReceiveProcessor : ITransportReceiveProcessor\n    {\n        private readonly ILogger _log;\n        private readonly IMessagingReceiveProcessor _receiveProcessor;\n        private readonly TransportConnectionStateValidator _stateValidator = new TransportConnectionStateValidator();\n        private readonly TransportHeaderHandler<Task, Maybe<IPooledBuffer>> _handler;\n        private readonly BufferedChannel<ChannelMessage> _buffer = new BufferedChannel<ChannelMessage>(3);\n\n        public TransportReceiveProcessor(\n            ITransmissionConnection connection,\n            ITransportProtocolDeserializer deserializer)\n        {\n            InstanceId = connection.Id;\n            _log = LogManager.GetLogger<TransportReceiveProcessor>(InstanceId.ToString());\n            _receiveProcessor = new MessagingReceiveProcessor(connection, deserializer);\n            _handler = new TransportHeaderHandler<Task, Maybe<IPooledBuffer>>(\n                HandleConnetionHeaderAsync,\n                HandleChannelHeaderAsync);\n            _buffer.Out.PropagateCompletionFrom(ProcessAsync());\n            In.Completion.LogCompletion(_log);\n        }\n\n        public UniqueId InstanceId { get; }\n\n        public IReadableChannel<ChannelMessage> In => _buffer.In;\n\n        private async Task ProcessAsync()\n        {\n            await _receiveProcessor.In.ConsumeAsync(HandleReceivedAsync).ConfigureAwait(false);\n            if (_stateValidator.IsDisconnected)\n            {\n                _log.Warn(\"Connection completed unexpectedly without close handshake\");\n            }\n        }\n\n        private async Task HandleReceivedAsync(TransportMessage message)\n        {\n            try\n            {\n                _log.Trace(\"Received message: {0}\", message);\n                _stateValidator.OnMessage(message.Header);\n                await message.Header.Handle(_handler, message.Payload).ConfigureAwait(false);\n                _log.Trace(\"Processed message: {0}\", message);\n            }\n            catch\n            {\n                message.Dispose();\n                throw;\n            }\n        }\n\n        private async Task HandleChannelHeaderAsync(ITransportChannelHeader header, Maybe<IPooledBuffer> payload)\n        {\n            var message = new ChannelMessage(header, payload);\n            try\n            {\n                await _buffer.Out.WriteAsync(message).ConfigureAwait(false);\n            }\n            catch\n            {\n                message.Dispose();\n                throw;\n            }\n        }\n\n        private static Task HandleConnetionHeaderAsync(ITransportConnectionHeader header, Maybe<IPooledBuffer> payload)\n        {\n            return TaskConstants.Completed;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol.Common;\n    using Plexus.Interop.Transport.Protocol;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using System;\n    using System.Threading.Tasks;\n\n    internal sealed class TransportSendProcessor : ITransportSendProcessor\n    {\n        private readonly ILogger _log;\n        private readonly ITransportHeaderFactory _transportHeaderFactory;\n        private readonly IMessagingSendProcessor _sendProcessor;\n        private readonly BufferedChannel<ChannelMessage> _buffer = new BufferedChannel<ChannelMessage>(3);\n\n        public TransportSendProcessor(\n            ITransmissionConnection connection,\n            ITransportHeaderFactory transportHeaderFactory,\n            ITransportProtocolSerializer serializer)\n        {\n            _sendProcessor = new MessagingSendProcessor(connection, serializer);\n            _log = LogManager.GetLogger<TransportSendProcessor>(_sendProcessor.Id.ToString());\n            _transportHeaderFactory = transportHeaderFactory;            \n            _sendProcessor.Out.PropagateCompletionFrom(ProcessAsync());\n            Completion = _sendProcessor.Completion.LogCompletion(_log);\n        }\n\n        public UniqueId InstanceId => _sendProcessor.Id;\n\n        public ITerminatableWritableChannel<ChannelMessage> Out => _buffer.Out;\n\n        public Task Completion { get; }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await OpenConnectionAsync().ConfigureAwait(false);\n                await _buffer.In.ConsumeAsync(SendAsync).ConfigureAwait(false);\n                await CloseConnectionAsync().ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                await CloseConnectionAsync(ex).ConfigureAwait(false);\n            }\n        }\n\n        private async Task OpenConnectionAsync()\n        {\n            var openHeader = _transportHeaderFactory.CreateConnectionOpenHeader(InstanceId);\n            await SendAsync(new TransportMessage(openHeader)).ConfigureAwait(false);\n        }\n\n        private async Task CloseConnectionAsync()\n        {\n            var closeHeader = _transportHeaderFactory.CreateConnectionCloseHeader(CompletionHeader.Completed);\n            await SendAsync(new TransportMessage(closeHeader)).ConfigureAwait(false);\n        }\n\n        private async Task CloseConnectionAsync(Exception error)\n        {\n            ITransportConnectionCloseHeader closeHeader;\n            if (error is OperationCanceledException)\n            {\n                closeHeader = _transportHeaderFactory.CreateConnectionCloseHeader(CompletionHeader.Canceled);\n            }\n            else\n            {\n                closeHeader = _transportHeaderFactory.CreateConnectionCloseHeader(CompletionHeader.Failed(TransportUtils.GetErrorHeader(error)));\n            }\n            await SendAsync(new TransportMessage(closeHeader)).ConfigureAwait(false);\n        }\n\n        private Task SendAsync(ChannelMessage message)\n        {\n            return SendAsync((TransportMessage)message);\n        }\n\n        private async Task SendAsync(TransportMessage message)\n        {\n            try\n            {\n                _log.Trace(\"Sending {0}\", message);\n                await _sendProcessor.Out.WriteAsync(message).ConfigureAwait(false);\n            }\n            catch\n            {\n                message.Dispose();\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using Plexus.Processes;\n\n    internal sealed class TransportServer : ProcessBase, ITransportServer\n    {\n        private readonly ITransmissionServer _transmissionServer;\n        private readonly TransportConnectionFactory _connectionFactory;\n        private readonly BufferedChannel<ITransportConnection> _buffer = new BufferedChannel<ITransportConnection>(1);\n\n        public TransportServer(\n            TransportType transportType,\n            ITransmissionServer transmissionServer,\n            ITransportProtocolSerializationProvider serializationProvider)\n        {\n            _connectionFactory = new TransportConnectionFactory(transportType, serializationProvider);\n            _transmissionServer = transmissionServer;\n            _buffer.Out.PropagateCompletionFrom(Completion);\n            OnStop(_transmissionServer.Stop);\n        }\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<TransportServer>();\n\n        public IReadableChannel<ITransportConnection> In => _buffer.In;\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            await _transmissionServer.StartAsync().ConfigureAwait(false);\n            return ProcessAsync();\n        }\n\n        private async Task ProcessAsync()\n        {\n            await _transmissionServer.In.ConsumeAsync(AcceptAsync).ConfigureAwait(false);\n            Log.Debug(\"Transmission server completed\");\n        }\n\n        private async Task AcceptAsync(ITransmissionConnection c)\n        {            \n            try\n            {\n                await _buffer.WriteAsync(_connectionFactory.Create(c), CancellationToken).ConfigureAwait(false);\n                Log.Debug(\"New connection accepted\");\n            }\n            catch\n            {\n                await c.DisconnectAsync().IgnoreExceptions().ConfigureAwait(false);\n                throw;\n            }\n        }\n\n        public override string ToString()\n        {\n            return $\"Transmission server: {_transmissionServer.FormatObject()}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Internal/TransportUtils.cs",
    "content": "﻿/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Internal\n{\n    using Plexus.Interop.Protocol.Common;\n    using Plexus.Interop.Transport.Protocol;\n    using System;\n\n    internal static class TransportUtils\n    {\n        public static ErrorHeader GetErrorHeader(Exception ex)\n            => ex is RemoteErrorException remoteEx\n            ? new ErrorHeader(remoteEx.RemoteMessage, remoteEx.Details, remoteEx.RemoteExceptionName)\n            : new ErrorHeader(ex.Message, ex.FormatToString(), ex.GetBaseException().GetType().Name);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/Plexus.Interop.Transport.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Interop.Transport</AssemblyName>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Contracts\\Plexus.Interop.Transport.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol\\Plexus.Interop.Transport.Protocol.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/TransportChannelUtils.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    public static class TransportChannelUtils\n    {\n        public static async Task<bool> TrySendAsync(this ITransportChannel channel, Stream content, long length)\n        {\n            long sentBytes = 0;\n            bool isLastFrameInMessage;\n            do\n            {\n                int frameLength = (int)(length - sentBytes);\n                if (frameLength > PooledBuffer.MaxSize)\n                {\n                    frameLength = PooledBuffer.MaxSize;\n                    isLastFrameInMessage = false;\n                }\n                else\n                {\n                    isLastFrameInMessage = true;\n                }\n                var payload = await PooledBuffer.Get(content, frameLength).ConfigureAwait(false);\n                try\n                {\n                    var message = new TransportMessageFrame(payload, !isLastFrameInMessage);\n                    if (!await channel.Out.TryWriteAsync(message).ConfigureAwait(false))\n                    {\n                        message.Dispose();\n                        return false;\n                    }\n                }\n                catch\n                {\n                    payload.Dispose();\n                    throw;\n                }\n                sentBytes += frameLength;\n            } while (!isLastFrameInMessage);\n            return true;\n        }\n\n        public static async ValueTask<Maybe<long>> TryReceiveAsync(this ITransportChannel channel, Stream content)\n        {\n            long length = 0;\n            bool hasMoreFrames;\n            do\n            {\n                var result = await channel.In.TryReadAsync().ConfigureAwait(false);\n                if (!result.HasValue)\n                {\n                    return Nothing.Instance;\n                }\n                using (var frame = result.Value)\n                {\n                    var payload = frame.Payload;\n                    await content.WriteAsync(payload.Array, payload.Offset, payload.Count).ConfigureAwait(false);\n                    length += payload.Count;\n                    hasMoreFrames = frame.HasMore;\n                }\n            } while (hasMoreFrames);\n            return length;\n        }\n\n\n        public static async Task SendAsync(this ITransportChannel channel, Stream content, long length)\n        {\n            if (!await channel.TrySendAsync(content, length).ConfigureAwait(false))\n            {\n                throw new OperationCanceledException();\n            }\n        }\n\n        public static async ValueTask<long> ReceiveAsync(this ITransportChannel channel, Stream content, long length)\n        {\n            var result = await channel.TryReceiveAsync(content).ConfigureAwait(false);\n            if (!result.HasValue)\n            {\n                throw new OperationCanceledException();\n            }\n            return result.Value;\n        }\n\n        public static async Task SendMessageAsync(\n            this ITransportChannel channel,\n            byte[] buffer,\n            int offset,\n            int count)\n        {\n            using (var stream = new MemoryStream(buffer, offset, count))\n            {\n                await channel.TrySendAsync(stream, count).ConfigureAwait(false);\n            }\n        }\n\n        public static Task SendMessageAsync(\n            this ITransportChannel channel,\n            ArraySegment<byte> buffer)\n        {\n            return channel.SendMessageAsync(buffer.Array, buffer.Offset, buffer.Count);\n        }\n\n        public static Task SendMessageAsync(\n            this ITransportChannel channel,\n            byte[] buffer)\n        {\n            return channel.SendMessageAsync(buffer, 0, buffer.Length);\n        }\n\n        public static async Task<Maybe<byte[]>> TryReceiveMessageAsync(\n            this ITransportChannel channel)\n        {\n            using (var stream = new MemoryStream())\n            {\n                var result = await channel.TryReceiveAsync(stream).ConfigureAwait(false);\n                if (!result.HasValue)\n                {\n                    return Nothing.Instance;\n                }\n                return stream.ToArray();\n            }\n        }\n\n        public static async Task<byte[]> ReceiveMessageAsync(\n            this ITransportChannel channel)\n        {\n            using (var stream = new MemoryStream())\n            {\n                await channel.TryReceiveAsync(stream).ConfigureAwait(false);\n                return stream.ToArray();\n            }\n        }\n\n        public static async ValueTask<Maybe<long>> ReceiveMessageAsync(\n            this ITransportChannel channel,\n            byte[] buffer,\n            int offset,\n            int count)\n        {\n            using (var stream = new MemoryStream(buffer, offset, count, writable: true))\n            {\n                return await channel.TryReceiveAsync(stream).ConfigureAwait(false);\n            }\n        }\n\n        public static ValueTask<Maybe<long>> ReceiveMessageAsync(\n            this ITransportChannel channel,\n            byte[] buffer)\n        {\n            return channel.ReceiveMessageAsync(buffer, 0, buffer.Length);\n        }\n\n        public static ValueTask<Maybe<long>> ReceiveMessageAsync(\n            this ITransportChannel channel,\n            ArraySegment<byte> buffer)\n        {\n            return channel.ReceiveMessageAsync(buffer.Array, buffer.Offset, buffer.Count);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/TransportClientFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using Plexus.Interop.Transport.Internal;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n\n    public sealed class TransportClientFactory\n    {\n        public static TransportClientFactory Instance = new TransportClientFactory();\n\n        public ITransportClient Create(TransportType transportType, ITransmissionClient transmissionClient, ITransportProtocolSerializationProvider serializationProvider)\n        {\n            return new TransportClient(transportType, transmissionClient, serializationProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport/TransportServerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using Plexus.Interop.Transport.Internal;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n\n    public sealed class TransportServerFactory\n    {\n        public static TransportServerFactory Instance = new TransportServerFactory();\n\n        public ITransportServer Create(TransportType transportType, ITransmissionServer transmissionServer, ITransportProtocolSerializationProvider serializationProvider)\n        {\n            return new TransportServer(transportType, transmissionServer, serializationProvider);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/ITransportChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using Plexus.Channels;\n    using System.Threading.Tasks;\n\n    public interface ITransportChannel : IChannel<TransportMessageFrame>\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/ITransportClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public interface ITransportClient\n    {\n        ValueTask<ITransportConnection> ConnectAsync(string brokerWorkingDir, CancellationToken cancellationToken = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/ITransportConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport\n{\n    using Plexus.Channels;\n    using System;\n    using System.Threading.Tasks;\n\n    public interface ITransportConnection : IDisposable\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n\n        IReadableChannel<ITransportChannel> IncomingChannels { get; }\n\n        TransportType TransportType { get; }\n\n        bool TryComplete();\n\n        bool TryTerminate(Exception ex = null);\n        \n        ValueTask<Maybe<ITransportChannel>> TryCreateChannelSafeAsync();\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/ITransportServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using System;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    public interface ITransportServer : IDisposable\n    {\n        Task Completion { get; }\n\n        IReadableChannel<ITransportConnection> In { get; }\n\n        Task StartAsync();\n\n        void Stop();\n\n        Task StopAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/Plexus.Interop.Transport.Contracts.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/TransportExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using System;\n    using System.Threading.Tasks;\n\n    public static class TransportExtensions\n    {\n        public static async ValueTask<Maybe<ITransportChannel>> TryCreateChannelAsync(this ITransportConnection connection)\n        {\n            var maybeChannel = await connection.TryCreateChannelSafeAsync().ConfigureAwait(false);\n            if (!maybeChannel.HasValue)\n            {\n                await connection.Completion.ConfigureAwait(false);\n            }\n            return maybeChannel;\n        }\n\n        public static async ValueTask<ITransportChannel> CreateChannelAsync(this ITransportConnection connection)\n        {\n            var maybeChannel = await TryCreateChannelAsync(connection).ConfigureAwait(false);\n            if (!maybeChannel.HasValue)\n            {\n                throw new OperationCanceledException();\n            }\n            return maybeChannel.Value;\n        }\n\n        public static async Task CompleteAsync(this ITransportConnection connection)\n        {\n            connection.TryComplete();\n            do\n            {\n                while (connection.IncomingChannels.TryRead(out _))\n                {\n                }\n            } while (await connection.IncomingChannels.WaitReadAvailableAsync().ConfigureAwait(false));\n            await connection.Completion.ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Contracts/TransportMessageFrame.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using Plexus.Pools;\n    using System;\n\n    public struct TransportMessageFrame : IDisposable\n    {\n        public TransportMessageFrame(IPooledBuffer data, bool hasMore = false)\n        {\n            Payload = data;\n            HasMore = hasMore;\n        }\n\n        public IPooledBuffer Payload { get; }\n\n        public bool HasMore { get; }\n\n        public void Dispose()\n        {\n            Payload?.Dispose();\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Payload)}: {Payload}, {nameof(HasMore)}: {HasMore}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Pipes.Tests/PipeTransportTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Pipes\n{\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Transmission.Pipes;\n    using Xunit.Abstractions;\n\n    public sealed class PipeTransportTests : TransportTestsSuite\n    {\n        public PipeTransportTests(ITestOutputHelper output) : base(output)\n        {\n            Server = RegisterDisposable(TransportServerFactory.Instance.Create(\n                TransportType.Pipe,\n                PipeTransmissionServerFactory.Instance.Create(BrokerWorkingDir),\n                new ProtobufTransportProtocolSerializationProvider()));\n            Client = TransportClientFactory.Instance.Create(\n                TransportType.Pipe,\n                PipeTransmissionClientFactory.Instance.Create(),\n                new ProtobufTransportProtocolSerializationProvider());\n        }\n\n        protected override ITransportServer Server { get; }\n\n        protected override ITransportClient Client { get; }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Pipes.Tests/Plexus.Interop.Transport.Pipes.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.Pipes</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Testing\\Plexus.Interop.Transport.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Pipes.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/GetBodyLengthHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class GetBodyLengthHandler : ITransportHeaderHandler<Maybe<int>, Nothing>, ITransportChannelHeaderHandler<Maybe<int>, Nothing>\n    {\n        public static GetBodyLengthHandler Instance = new GetBodyLengthHandler();\n\n        public Maybe<int> Handle(ITransportHeader header)\n        {\n            return header.Handle(new TransportHeaderHandler<Maybe<int>, Nothing>(this), Nothing.Instance);\n        }\n\n        public Maybe<int> Handle(ITransportConnectionHeader header, Nothing _)\n        {\n            return Nothing.Instance;\n        }\n\n        public Maybe<int> Handle(ITransportChannelHeader header, Nothing _)\n        {\n            return header.Handle(new TransportChannelHeaderHandler<Maybe<int>, Nothing>(this), _);\n        }\n\n        public Maybe<int> Handle(ITransportChannelOpenHeader header, Nothing _)\n        {\n            return Nothing.Instance;\n        }\n\n        public Maybe<int> Handle(ITransportChannelCloseHeader header, Nothing _)\n        {\n            return Nothing.Instance;\n        }\n\n        public Maybe<int> Handle(ITransportFrameHeader header, Nothing _)\n        {\n            return header.Length;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/TransportChannelCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System.Collections.Generic;\nusing Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class TransportChannelCloseHeader : PooledObject<TransportChannelCloseHeader>, ITransportChannelCloseHeader\n    {\n        public UniqueId ChannelId { get; set; }\n\n        public CompletionHeader Completion { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var header = obj as TransportChannelCloseHeader;\n            return header != null &&\n                   ChannelId.Equals(header.ChannelId) &&\n                   EqualityComparer<CompletionHeader>.Default.Equals(Completion, header.Completion);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = -1838972392;\n            hashCode = hashCode * -1521134295 + EqualityComparer<UniqueId>.Default.GetHashCode(ChannelId);\n            hashCode = hashCode * -1521134295 + EqualityComparer<CompletionHeader>.Default.GetHashCode(Completion);\n            return hashCode;\n        }\n\n        public T Handle<T, TArgs>(TransportChannelHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(TransportChannelCloseHeader).Name}, {nameof(ChannelId)}: {ChannelId.ToString()}, {nameof(Completion)}: {Completion.ToString()}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ChannelId = default;\n            Completion = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/TransportChannelOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class TransportChannelOpenHeader : PooledObject<TransportChannelOpenHeader>, ITransportChannelOpenHeader\n    {\n        public UniqueId ChannelId { get; set; }\n\n        public T Handle<T, TArgs>(TransportChannelHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public override bool Equals(object obj)\n        {\n            var header = obj as TransportChannelOpenHeader;\n            return header != null &&\n                   ChannelId.Equals(header.ChannelId);\n        }\n\n        public override int GetHashCode()\n        {\n            return -1492472495 + EqualityComparer<UniqueId>.Default.GetHashCode(ChannelId);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(TransportChannelOpenHeader).Name}, {nameof(ChannelId)}: {ChannelId.ToString()}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ChannelId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/TransportConnectionCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System.Collections.Generic;\nusing Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class TransportConnectionCloseHeader : PooledObject<TransportConnectionCloseHeader>, ITransportConnectionCloseHeader\n    {\n        public CompletionHeader Completion { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var header = obj as TransportConnectionCloseHeader;\n            return header != null &&\n                   EqualityComparer<CompletionHeader>.Default.Equals(Completion, header.Completion);\n        }\n\n        public override int GetHashCode()\n        {\n            return 418588383 + EqualityComparer<CompletionHeader>.Default.GetHashCode(Completion);\n        }\n\n        public T Handle<T, TArgs>(TransportConnectionHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(TransportConnectionCloseHeader).Name}, {nameof(Completion)}: {Completion.ToString()}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            Completion = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/TransportConnectionOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class TransportConnectionOpenHeader : PooledObject<TransportConnectionOpenHeader>, ITransportConnectionOpenHeader\n    {\n        public UniqueId ConnectionId { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var header = obj as TransportConnectionOpenHeader;\n            return header != null &&\n                   ConnectionId.Equals(header.ConnectionId);\n        }\n\n        public override int GetHashCode()\n        {\n            return -463474436 + EqualityComparer<UniqueId>.Default.GetHashCode(ConnectionId);\n        }\n\n        public T Handle<T, TArgs>(TransportConnectionHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(TransportConnectionOpenHeader).Name}, {nameof(ConnectionId)} : {ConnectionId.ToString()}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ConnectionId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Internal/TransportFrameHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System.Collections.Generic;\n\nnamespace Plexus.Interop.Transport.Protocol.Internal\n{\n    internal sealed class TransportFrameHeader : PooledObject<TransportFrameHeader>, ITransportFrameHeader\n    {\n        public UniqueId ChannelId { get; set; }\n\n        public int Length { get; set; }\n\n        public bool HasMore { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            var header = obj as TransportFrameHeader;\n            return header != null &&\n                   ChannelId.Equals(header.ChannelId) &&\n                   Length == header.Length &&\n                   HasMore == header.HasMore;\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = -1127539327;\n            hashCode = hashCode * -1521134295 + EqualityComparer<UniqueId>.Default.GetHashCode(ChannelId);\n            hashCode = hashCode * -1521134295 + Length.GetHashCode();\n            hashCode = hashCode * -1521134295 + HasMore.GetHashCode();\n            return hashCode;\n        }\n\n        public T Handle<T, TArgs>(TransportChannelHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default)\n        {\n            return handler.Handle(this, args);\n        }\n\n        public override string ToString()\n        {\n            return $\"{{Type: {typeof(TransportFrameHeader).Name}, {nameof(ChannelId)}: {ChannelId.ToString()}, {nameof(Length)}: {Length.ToString()}, {nameof(HasMore)}: {HasMore.ToString()}}}\";\n        }\n\n        protected override void Cleanup()\n        {\n            ChannelId = default;\n            Length = default;\n            HasMore = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/MessagingReceiveProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Protocol.Internal;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using Plexus.Pools;\n    using System;\n    using System.Threading.Tasks;\n\n    public sealed class MessagingReceiveProcessor : IMessagingReceiveProcessor\n    {\n        private readonly ILogger _log;\n        private readonly IReadableChannel<IPooledBuffer> _connection;\n        private readonly ITransportProtocolDeserializer _deserializer;\n        private readonly IChannel<TransportMessage> _buffer = new BufferedChannel<TransportMessage>(3);\n\n        public MessagingReceiveProcessor(\n            ITransmissionConnection connection,\n            ITransportProtocolDeserializer deserializer)\n        {\n            Id = connection.Id;\n            _log = LogManager.GetLogger<MessagingReceiveProcessor>(Id.ToString());\n            _connection = connection.In;\n            _deserializer = deserializer;\n            In.Completion.LogCompletion(_log);\n            _buffer.Out.PropagateCompletionFrom(ProcessAsync());\n        }\n\n        public UniqueId Id { get; }\n\n        public IReadableChannel<TransportMessage> In => _buffer.In;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _connection.ConsumeAsync(HandleReceivedAsync).ConfigureAwait(false);\n                _log.Trace(\"Receiving completed\");\n            }\n            catch (Exception ex)\n            {                \n                _log.Trace(\"Receiving failed: {0}\", ex.FormatTypeAndMessage());\n                throw;\n            }\n        }\n\n        private async Task HandleReceivedAsync(IPooledBuffer item)\n        {\n            ITransportHeader header;\n            using (item)\n            {\n                header = _deserializer.Deserialize(item);\n            }\n            try\n            {\n                var payload = Maybe<IPooledBuffer>.Nothing;\n                var expectedBodyLength = GetBodyLengthHandler.Instance.Handle(header);\n                if (expectedBodyLength.HasValue)\n                {\n                    var body = await _connection.ReadAsync().ConfigureAwait(false);\n                    if (body.Count != expectedBodyLength.Value)\n                    {\n                        body.Dispose();\n                        throw new InvalidOperationException(\n                            $\"Received body length {body.Count} does not equal to the specified in header: {header}\");\n                    }\n                    payload = new Maybe<IPooledBuffer>(body);\n                }\n                try\n                {\n                    var transportMessage = new TransportMessage(header, payload);\n                    _log.Debug(\"Message received: {0}\", transportMessage);\n                    await _buffer.Out.WriteAsync(transportMessage).ConfigureAwait(false);\n                }\n                catch\n                {\n                    payload.GetValueOrDefault()?.Dispose();\n                    throw;\n                }\n            }\n            catch\n            {\n                header.Dispose();\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/MessagingSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using Plexus.Pools;\n    using System;\n    using System.Threading.Tasks;\n\n    public sealed class MessagingSendProcessor : IMessagingSendProcessor\n    {\n        private readonly ILogger _log;\n        private readonly ITransportProtocolSerializer _serializer;\n        private readonly IChannel<TransportMessage> _buffer = new BufferedChannel<TransportMessage>(3);\n        private readonly ITransmissionConnection _connection;\n\n        public MessagingSendProcessor(\n            ITransmissionConnection connection,\n            ITransportProtocolSerializer serializer)\n        {\n            Id = connection.Id;\n            _connection = connection;\n            _log = LogManager.GetLogger<MessagingSendProcessor>(Id.ToString());\n            _serializer = serializer;            \n            _connection.Out.PropagateCompletionFrom(ProcessAsync());\n            Completion = _connection.Out.Completion.LogCompletion(_log);\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<TransportMessage> Out => _buffer.Out;\n        \n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.In.ConsumeAsync(SendAsync).ConfigureAwait(false);\n                _log.Info(\"Sending completed\");\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(\"Sending failed: {0}\", ex.FormatTypeAndMessage());\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                throw;\n            }\n        }\n\n        private async Task SendAsync(TransportMessage message)\n        {\n            _log.Debug(\"Sending message: {0}\", message);\n            using (var header = message.Header)\n            {\n                var serializedHeader = _serializer.Serialize(header);\n                await SendAsync(serializedHeader, message, true).ConfigureAwait(false);\n                if (message.Payload.HasValue)\n                {\n                    var payload = message.Payload.Value;\n                    await SendAsync(payload, message, false).ConfigureAwait(false);\n                }\n            }\n        }\n\n        private async Task SendAsync(IPooledBuffer message, TransportMessage originalMessage, bool isHeader)\n        {\n            try\n            {\n                await _connection.Out.WriteAsync(message).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                var payloadType = isHeader ? \"header\" : \"payload\";\n                _log.Warn(ex, $\"Exception occurred while sending {payloadType} of message: {originalMessage}\");\n                message.Dispose();\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/Plexus.Interop.Transport.Protocol.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Contracts\\Plexus.Interop.Transport.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol/TransportHeaderPool.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Common;\nusing Plexus.Interop.Transport.Protocol.Internal;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public sealed class TransportHeaderPool : ITransportHeaderFactory\n    {\n        public static readonly TransportHeaderPool Instance = new TransportHeaderPool();\n\n        public ITransportChannelCloseHeader CreateChannelCloseHeader(UniqueId channelId, CompletionHeader completion)\n        {\n            var header = TransportChannelCloseHeader.Rent();\n            header.ChannelId = channelId;\n            header.Completion = completion;\n            return header;\n        }\n\n        public ITransportChannelOpenHeader CreateChannelOpenHeader(UniqueId channelId)\n        {\n            var header = TransportChannelOpenHeader.Rent();\n            header.ChannelId = channelId;\n            return header;\n        }\n\n        public ITransportConnectionCloseHeader CreateConnectionCloseHeader(CompletionHeader completion)\n        {\n            var header = TransportConnectionCloseHeader.Rent();\n            header.Completion = completion;\n            return header;\n        }\n\n        public ITransportConnectionOpenHeader CreateConnectionOpenHeader(UniqueId connectionId)\n        {\n            var header = TransportConnectionOpenHeader.Rent();\n            header.ConnectionId = connectionId;\n            return header;\n        }\n\n        public ITransportFrameHeader CreateFrameHeader(UniqueId channelId, bool hasMore, int length)\n        {\n            var header = TransportFrameHeader.Rent();\n            header.ChannelId = channelId;\n            header.HasMore = hasMore;\n            header.Length = length;\n            return header;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/IChannelHeaderFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface IChannelHeaderFactory\n    {\n        ITransportFrameHeader CreateFrameHeader(UniqueId channelId, bool hasMore, int length);\n\n        ITransportChannelOpenHeader CreateChannelOpenHeader(UniqueId channelId);\n\n        ITransportChannelCloseHeader CreateChannelCloseHeader(UniqueId channelId, CompletionHeader completion);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/IChannelOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface IChannelOpenHeader : ITransportChannelHeader\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/IConnectionHeaderFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface IConnectionHeaderFactory\n    {\n        ITransportConnectionOpenHeader CreateConnectionOpenHeader(UniqueId connectionId);\n\n        ITransportConnectionCloseHeader CreateConnectionCloseHeader(CompletionHeader completion);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/IMessagingReceiveProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using Plexus.Channels;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface IMessagingReceiveProcessor\n    {\n        UniqueId Id { get; }\n\n        IReadableChannel<TransportMessage> In { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/IMessagingSendProcessor.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n using Plexus.Channels;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using System.Threading.Tasks;\n\n    public interface IMessagingSendProcessor\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n\n        ITerminatableWritableChannel<TransportMessage> Out { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportChannelCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportChannelCloseHeader : ITransportChannelHeader\n    {\n        CompletionHeader Completion { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportChannelHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportChannelHeader : ITransportHeader\n    {\n        UniqueId ChannelId { get; }\n\n        T Handle<T, TArgs>(TransportChannelHeaderHandler<T, TArgs> handler, TArgs args = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportChannelHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportChannelHeaderHandler<T, TArgs>\n    {\n        T Handle(ITransportChannelOpenHeader header, TArgs args);\n\n        T Handle(ITransportChannelCloseHeader header, TArgs args);\n\n        T Handle(ITransportFrameHeader header, TArgs args);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportChannelOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportChannelOpenHeader : ITransportChannelHeader\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportConnectionCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protocol.Common;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportConnectionCloseHeader : ITransportConnectionHeader\n    {\n        CompletionHeader Completion { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportConnectionHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportConnectionHeader : ITransportHeader\n    {\n        T Handle<T, TArgs>(TransportConnectionHeaderHandler<T, TArgs> handler, TArgs args = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportConnectionHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportConnectionHeaderHandler<T, TArgs>\n    {\n        T Handle(ITransportConnectionOpenHeader header, TArgs args);\n\n        T Handle(ITransportConnectionCloseHeader header, TArgs args);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportConnectionOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportConnectionOpenHeader : ITransportConnectionHeader\n    {\n        UniqueId ConnectionId { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportFrameHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportFrameHeader : ITransportChannelHeader\n    {\n        int Length { get; }\n\n        bool HasMore { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\nusing System;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportHeader : IPooledObject\n    {\n        T Handle<T, TArgs>(TransportHeaderHandler<T, TArgs> handler, TArgs args = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportHeaderFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportHeaderFactory : IChannelHeaderFactory, IConnectionHeaderFactory\n    {\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ITransportHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol\n{\n    public interface ITransportHeaderHandler<T, TArgs>\n    {\n        T Handle(ITransportConnectionHeader header, TArgs args);\n\n        T Handle(ITransportChannelHeader header, TArgs args);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/MetadataViolationException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing System;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public class MetadataViolationException : ProtocolException\n    {\n        public MetadataViolationException(string remoteMessage, Exception innerException = null) : base(remoteMessage, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/Plexus.Interop.Transport.Protocol.Contracts.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.Protocol</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Protocol.Common.Contracts\\Plexus.Interop.Protocol.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/ProtocolException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using System;\n\n    public class ProtocolException : Exception\n    {\n        public ProtocolException(string remoteMessage, Exception innerException = null) : base(remoteMessage, innerException)\n        {\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/RemoteErrorException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using Plexus.Interop.Protocol.Common;\n\n    public sealed class RemoteErrorException : ProtocolException\n    {\n        public string RemoteMessage { get; }\n        public string Details { get; }\n        public string RemoteExceptionName { get; }\n\n        public RemoteErrorException(ErrorHeader errorHeader)\n            : this(errorHeader.Message, errorHeader.Details, errorHeader.ExceptionName)\n        {\n        }\n\n        public RemoteErrorException(string remoteMessage, string details, string remoteExceptionName)\n            : base(\"Error message received: \" + remoteMessage, new RemoteException(details))\n        {\n            RemoteMessage = remoteMessage;\n            Details = details;\n            RemoteExceptionName = remoteExceptionName;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/RemoteException.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using System;\n\n    public sealed class RemoteException : Exception\n    {\n        public RemoteException(string message)\n            : base(message)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/Serialization/ITransportProtocolDeserializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\n\nnamespace Plexus.Interop.Transport.Protocol.Serialization\n{\n    public interface ITransportProtocolDeserializer\n    {\n        ITransportHeader Deserialize(IPooledBuffer datagram);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/Serialization/ITransportProtocolSerializationProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Serialization\n{\n    public interface ITransportProtocolSerializationProvider\n    {\n        ITransportProtocolSerializer GetSerializer();\n\n        ITransportProtocolDeserializer GetDeserializer(ITransportHeaderFactory headerFactory);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/Serialization/ITransportProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Pools;\n\nnamespace Plexus.Interop.Transport.Protocol.Serialization\n{\n    public interface ITransportProtocolSerializer\n    {\n        IPooledBuffer Serialize(ITransportHeader header);\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/TransportChannelHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public struct TransportChannelHeaderHandler<T, TArgs> : ITransportChannelHeaderHandler<T, TArgs>\n    {\n        private readonly Func<ITransportChannelOpenHeader, TArgs, T> _openHandler;\n        private readonly Func<ITransportChannelCloseHeader, TArgs, T> _closeHandler;\n        private readonly Func<ITransportFrameHeader, TArgs, T> _frameHandler;\n\n        public TransportChannelHeaderHandler(\n            Func<ITransportChannelOpenHeader, TArgs, T> openHandler,\n            Func<ITransportChannelCloseHeader, TArgs, T> closeHandler,\n            Func<ITransportFrameHeader, TArgs, T> frameHandler)\n        {\n            _openHandler = openHandler;\n            _closeHandler = closeHandler;\n            _frameHandler = frameHandler;\n        }\n\n        public TransportChannelHeaderHandler(ITransportChannelHeaderHandler<T, TArgs> handler)\n            : this(handler.Handle, handler.Handle, handler.Handle)\n        {\n        }\n\n        public T Handle(ITransportChannelOpenHeader header, TArgs args)\n        {\n            return _openHandler(header, args);\n        }\n\n        public T Handle(ITransportChannelCloseHeader header, TArgs args)\n        {\n            return _closeHandler(header, args);\n        }\n\n        public T Handle(ITransportFrameHeader header, TArgs args)\n        {\n            return _frameHandler(header, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/TransportConnectionHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public struct TransportConnectionHeaderHandler<T, TArgs> : ITransportConnectionHeaderHandler<T, TArgs>\n    {\n        private readonly Func<ITransportConnectionOpenHeader, TArgs, T> _openHandler;\n        private readonly Func<ITransportConnectionCloseHeader, TArgs, T> _closeHandler;\n\n        public TransportConnectionHeaderHandler(\n            Func<ITransportConnectionOpenHeader, TArgs, T> openHandler,\n            Func<ITransportConnectionCloseHeader, TArgs, T> closeHandler)\n        {\n            _openHandler = openHandler;\n            _closeHandler = closeHandler;\n        }\n\n        public TransportConnectionHeaderHandler(ITransportConnectionHeaderHandler<T, TArgs> handler)\n            : this(handler.Handle, handler.Handle)\n        {\n        }\n\n        public T Handle(ITransportConnectionOpenHeader header, TArgs args)\n        {\n            return _openHandler(header, args);\n        }\n\n        public T Handle(ITransportConnectionCloseHeader header, TArgs args)\n        {\n            return _closeHandler(header, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/TransportHeaderHandler.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public struct TransportHeaderHandler<T, TArgs> : ITransportHeaderHandler<T, TArgs>\n    {\n        private readonly Func<ITransportConnectionHeader, TArgs, T> _handleConnectionHeader;\n        private readonly Func<ITransportChannelHeader, TArgs, T> _handleChannelHeader;\n\n        public TransportHeaderHandler(\n            Func<ITransportConnectionHeader, TArgs, T> handleConnectionHeader,\n            Func<ITransportChannelHeader, TArgs, T> handleChannelHeader)\n        {\n            _handleConnectionHeader = handleConnectionHeader;\n            _handleChannelHeader = handleChannelHeader;\n        }\n\n        public TransportHeaderHandler(ITransportHeaderHandler<T, TArgs> handler)\n            : this(handler.Handle, handler.Handle)\n        {\n        }\n\n        public T Handle(ITransportConnectionHeader header, TArgs args)\n        {\n            return _handleConnectionHeader(header, args);\n        }\n\n        public T Handle(ITransportChannelHeader header, TArgs args)\n        {\n            return _handleChannelHeader(header, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Contracts/TransportMessage.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Collections.Generic;\nusing Plexus.Pools;\n\nnamespace Plexus.Interop.Transport.Protocol\n{\n    public struct TransportMessage : IPooledObject\n    {\n        public TransportMessage(ITransportHeader header) : this(header, Maybe<IPooledBuffer>.Nothing)\n        {\n        }\n\n        public TransportMessage(ITransportHeader header, Maybe<IPooledBuffer> payload)\n        {\n            Header = header;\n            Payload = payload;\n        }\n\n        public ITransportHeader Header { get; }\n\n        public Maybe<IPooledBuffer> Payload { get; }\n\n        public void Retain()\n        {\n            Header.Retain();\n            if (Payload.HasValue)\n            {\n                Payload.Value.Retain();\n            }\n        }\n\n        public void Dispose()\n        {\n            Header.Dispose();\n            if (Payload.HasValue)\n            {\n                Payload.Value.Dispose();\n            }\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is TransportMessage))\n            {\n                return false;\n            }\n\n            var message = (TransportMessage)obj;\n            return EqualityComparer<ITransportHeader>.Default.Equals(Header, message.Header) &&\n                   Payload.Equals(message.Payload);\n        }\n\n        public override int GetHashCode()\n        {\n            var hashCode = 1268427973;\n            hashCode = hashCode * -1521134295 + base.GetHashCode();\n            hashCode = hashCode * -1521134295 + EqualityComparer<ITransportHeader>.Default.GetHashCode(Header);\n            hashCode = hashCode * -1521134295 + EqualityComparer<Maybe<IPooledBuffer>>.Default.GetHashCode(Payload);\n            return hashCode;\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Header)}: {Header}, {nameof(Payload)}: {Payload}}}\";\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ChannelCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ChannelCloseHeader : PooledObject<ChannelCloseHeader>\n    {\n        protected override void Cleanup()\n        {\n            ChannelId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ChannelOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ChannelOpenHeader : PooledObject<ChannelOpenHeader>\n    {\n        protected override void Cleanup()\n        {\n            ChannelId = default;            \n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ConnectionCloseHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConnectionCloseHeader : PooledObject<ConnectionCloseHeader>\n    {\n        protected override void Cleanup()\n        {\n            Completion = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ConnectionOpenHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class ConnectionOpenHeader : PooledObject<ConnectionOpenHeader>\n    {\n        protected override void Cleanup()\n        {\n            ConnectionId = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/Header.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class Header : PooledObject<Header>\n    {\n        protected override void Cleanup()\n        {\n            ClearContent();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/MessageFrameHeader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    using Plexus.Pools;\n\n    internal partial class MessageFrameHeader : PooledObject<MessageFrameHeader>\n    {\n        protected override void Cleanup()\n        {\n            ChannelId = default;\n            HasMore = default;\n            Length = default;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ProtobufTransportProtocolDeserializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing Plexus.Interop.Protobuf;\nusing Plexus.Interop.Transport.Protocol.Serialization;\nusing Plexus.Pools;\n\nnamespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    internal sealed class ProtobufTransportProtocolDeserializer : ITransportProtocolDeserializer\n    {\n        private readonly ILogger _log;\n        \n        private readonly ITransportHeaderFactory _headerFactory;\n\n        public ProtobufTransportProtocolDeserializer(ITransportHeaderFactory headerFactory)\n        {\n            _log = LogManager.GetLogger<ProtobufTransportProtocolDeserializer>();\n            _headerFactory = headerFactory;\n        }\n\n        public ITransportHeader Deserialize(IPooledBuffer datagram)\n        {\n            using (var proto = Header.Rent())\n            {\n                proto.MergeFrom(datagram);\n                var contentCase = proto.ContentCase;\n                ITransportHeader header;\n                switch (contentCase)\n                {\n                    case Header.ContentOneofCase.MessageFrame:\n                        header = ConvertFromProto(proto.MessageFrame);\n                        break;\n                    case Header.ContentOneofCase.ChannelOpen:\n                        header = ConvertFromProto(proto.ChannelOpen);\n                        break;\n                    case Header.ContentOneofCase.ChannelClose:\n                        header = ConvertFromProto(proto.ChannelClose);\n                        break;\n                    case Header.ContentOneofCase.Open:\n                        header = ConvertFromProto(proto.Open);\n                        break;\n                    case Header.ContentOneofCase.Close:\n                        header = ConvertFromProto(proto.Close);\n                        break;\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n                return header;\n            }\n        }\n\n        private ITransportFrameHeader ConvertFromProto(MessageFrameHeader frameHeader)\n        {\n            return _headerFactory.CreateFrameHeader(\n                frameHeader.ChannelId.ConvertFromProtoStrict(),\n                frameHeader.HasMore,\n                (int)frameHeader.Length);\n        }\n\n        private ITransportChannelCloseHeader ConvertFromProto(ChannelCloseHeader proto)\n        {\n            return _headerFactory.CreateChannelCloseHeader(proto.ChannelId.ConvertFromProtoStrict(), proto.Completion.ConvertFromProto());\n        }\n\n        private ITransportChannelOpenHeader ConvertFromProto(ChannelOpenHeader proto)\n        {\n            return _headerFactory.CreateChannelOpenHeader(proto.ChannelId.ConvertFromProtoStrict());\n        }\n\n        private ITransportConnectionOpenHeader ConvertFromProto(ConnectionOpenHeader proto)\n        {\n            return _headerFactory.CreateConnectionOpenHeader(proto.ConnectionId.ConvertFromProtoStrict());\n        }\n\n        private ITransportConnectionCloseHeader ConvertFromProto(ConnectionCloseHeader proto)\n        {\n            return _headerFactory.CreateConnectionCloseHeader(proto.Completion.ConvertFromProto());\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Internal/ProtobufTransportProtocolSerializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Protobuf;\nusing Plexus.Interop.Transport.Protocol.Serialization;\nusing Plexus.Pools;\n\nnamespace Plexus.Interop.Transport.Protocol.Protobuf.Internal\n{\n    internal sealed class ProtobufTransportProtocolSerializer : ITransportProtocolSerializer\n    {\n        private readonly ILogger _log;\n\n        private readonly TransportConnectionHeaderHandler<IPooledBuffer, Nothing> _connectionHeaderHandler;\n        private readonly TransportHeaderHandler<IPooledBuffer, Nothing> _transportHeaderHandler;\n        private readonly TransportChannelHeaderHandler<IPooledBuffer, Nothing> _channelHeaderHandler;\n\n        public ProtobufTransportProtocolSerializer()\n        {\n            _log = LogManager.GetLogger<ProtobufTransportProtocolSerializer>();\n            _transportHeaderHandler = new TransportHeaderHandler<IPooledBuffer, Nothing>(Handle, Handle);\n            _channelHeaderHandler = new TransportChannelHeaderHandler<IPooledBuffer, Nothing>(Handle, Handle, Handle);\n            _connectionHeaderHandler = new TransportConnectionHeaderHandler<IPooledBuffer, Nothing>(Handle, Handle);\n        }\n\n        public IPooledBuffer Serialize(ITransportHeader header)\n        {\n            return header.Handle(_transportHeaderHandler);\n        }\n\n\n        public IPooledBuffer Handle(ITransportConnectionHeader header, Nothing _)\n        {\n            return header.Handle(_connectionHeaderHandler);\n        }\n\n        public IPooledBuffer Handle(ITransportChannelHeader header, Nothing _)\n        {\n            return header.Handle(_channelHeaderHandler);\n        }\n\n        public IPooledBuffer Handle(ITransportFrameHeader header, Nothing _)\n        {\n            using (var headerProto = Header.Rent())\n            using (var frameProto = MessageFrameHeader.Rent())\n            {\n                headerProto.MessageFrame = MergeToProto(frameProto, header);\n                return headerProto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Handle(ITransportChannelCloseHeader header, Nothing _)\n        {\n            using (var headerProto = Header.Rent())\n            using (var channelCloseProto = ChannelCloseHeader.Rent())\n            {\n                headerProto.ChannelClose = MergeToProto(channelCloseProto, header);\n                return headerProto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Handle(ITransportChannelOpenHeader header, Nothing _)\n        {\n            using (var headerProto = Header.Rent())\n            using (var channelOpenProto = ChannelOpenHeader.Rent())\n            {\n                headerProto.ChannelOpen = MergeToProto(channelOpenProto, header);\n                return headerProto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Handle(ITransportConnectionOpenHeader header, Nothing _)\n        {\n            using (var headerProto = Header.Rent())\n            using (var openProto = ConnectionOpenHeader.Rent())\n            {\n                headerProto.Open = MergeToProto(openProto, header);\n                return headerProto.Serialize();\n            }\n        }\n\n        public IPooledBuffer Handle(ITransportConnectionCloseHeader header, Nothing _)\n        {\n            using (var headerProto = Header.Rent())\n            using (var closeProto = ConnectionCloseHeader.Rent())\n            {\n                headerProto.Close = MergeToProto(closeProto, header);\n                return headerProto.Serialize();\n            }\n        }\n\n        private static MessageFrameHeader MergeToProto(MessageFrameHeader proto, ITransportFrameHeader frameMessageHeader)\n        {\n            proto = proto ?? new MessageFrameHeader();\n            proto.ChannelId = proto.ChannelId.MergeFrom(frameMessageHeader.ChannelId);\n            proto.Length = (uint)frameMessageHeader.Length;\n            proto.HasMore = frameMessageHeader.HasMore;\n            return proto;\n        }\n\n        private static ChannelCloseHeader MergeToProto(ChannelCloseHeader proto, ITransportChannelCloseHeader messageHeader)\n        {\n            proto = proto ?? new ChannelCloseHeader();\n            proto.ChannelId = proto.ChannelId.MergeFrom(messageHeader.ChannelId);\n            proto.Completion = proto.Completion.MergeFrom(messageHeader.Completion);\n            return proto;\n        }\n\n        private static ChannelOpenHeader MergeToProto(ChannelOpenHeader proto, ITransportChannelOpenHeader messageHeader)\n        {\n            proto = proto ?? new ChannelOpenHeader();\n            proto.ChannelId = proto.ChannelId.MergeFrom(messageHeader.ChannelId);\n            return proto;\n        }\n\n        private static ConnectionOpenHeader MergeToProto(ConnectionOpenHeader proto, ITransportConnectionOpenHeader messageHeader)\n        {\n            proto = proto ?? new ConnectionOpenHeader();\n            proto.ConnectionId = proto.ConnectionId.MergeFrom(messageHeader.ConnectionId);\n            return proto;\n        }\n\n        private static ConnectionCloseHeader MergeToProto(ConnectionCloseHeader proto, ITransportConnectionCloseHeader messageHeader)\n        {\n            proto = proto ?? new ConnectionCloseHeader();\n            proto.Completion = proto.Completion.MergeFrom(messageHeader.Completion);\n            return proto;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/Plexus.Interop.Transport.Protocol.Protobuf.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <NUGET_PACKAGES Condition=\" '$(NUGET_PACKAGES)' == '' \">$(USERPROFILE)\\.nuget\\packages</NUGET_PACKAGES>\n    <ProtoCompilerPath>$(NUGET_PACKAGES)\\google.protobuf.tools\\3.20.1\\tools\\windows_x86\\protoc</ProtoCompilerPath>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.20.1\" />\n    <PackageReference Include=\"Google.Protobuf.Tools\" Version=\"3.20.1\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Protobuf\\Plexus.Interop.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Contracts\\Plexus.Interop.Transport.Protocol.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <PropertyGroup>\n    <ProtoRoot>$(ProjectDir)../../../protocol/</ProtoRoot>\n    <ProtoOutDir>Internal\\</ProtoOutDir>\n    <ProtoOutDirParam>$(ProtoOutDir)</ProtoOutDirParam>\n    <ProtoOutDirParam Condition=\" '$(ProtoOutDirParam)' == '' \">.</ProtoOutDirParam>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Protobuf Include=\"$(ProtoRoot)plexus.interop.transport.proto\" />\n  </ItemGroup>\n\n  <Target Name=\"ProtoCompile\" BeforeTargets=\"CoreCompile\">\n    <PropertyGroup>\n      <ProtoCCommand>$(ProtoCompilerPath) --csharp_out=internal_access:$(ProtoOutDirParam) --csharp_opt=file_extension=.proto.cs -I $(ProtoRoot) @(Protobuf -> '%(Identity)', ' ')</ProtoCCommand>\n    </PropertyGroup>\n    <Message Importance=\"high\" Text=\"$(ProtoCCommand)\" />\n    <Delete Files=\"$(ProtoOutDir)*.proto.cs\" />\n    <Exec Command=\"$(ProtoCCommand)\" WorkingDirectory=\"$(ProjectDir)\" />\n    <ItemGroup>\n      <Generated Include=\"$(ProtoOutDir)*.proto.cs\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Remove=\"@(Generated)\" />\n    </ItemGroup>\n    <ItemGroup>\n      <Compile Include=\"@(Generated)\" />\n    </ItemGroup>\n  </Target>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Protobuf/ProtobufTransportSerialization.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using Plexus.Interop.Transport.Protocol.Protobuf.Internal;\nusing Plexus.Interop.Transport.Protocol.Serialization;\n\nnamespace Plexus.Interop.Transport.Protocol.Protobuf\n{\n    public sealed class ProtobufTransportProtocolSerializationProvider : ITransportProtocolSerializationProvider\n    {\n        public ITransportProtocolDeserializer GetDeserializer(ITransportHeaderFactory headerFactory)\n        {\n            return new ProtobufTransportProtocolDeserializer(headerFactory);\n        }\n\n        public ITransportProtocolSerializer GetSerializer()\n        {\n            return new ProtobufTransportProtocolSerializer();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Tests/MessagingTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Protocol\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Protocol.Common;\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Protocol.Serialization;\n    using Plexus.Interop.Transport.Transmission;\n    using Plexus.Interop.Transport.Transmission.Pipes;\n    using Plexus.Pools;\n    using Shouldly;\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Xunit;\n\n    public sealed class MessagingTests : TestsSuite\n    {\n        private static readonly ITransportProtocolSerializationProvider SerializationProvider \n            = new ProtobufTransportProtocolSerializationProvider();\n\n        private static readonly string BrokerWorkingDir = Directory.GetCurrentDirectory();\n\n        private readonly ITransmissionServer _server;\n        private readonly ITransmissionClient _client;        \n\n        public MessagingTests()\n        {\n            _server = RegisterDisposable(PipeTransmissionServerFactory.Instance.Create(BrokerWorkingDir));\n            _server.StartAsync().GetResult();\n            _client = PipeTransmissionClientFactory.Instance.Create();\n        }\n\n        private static IEnumerable<TransportMessage> GenerateAllTransportMessages()\n        {\n            yield return new TransportMessage(TransportHeaderPool.Instance.CreateConnectionOpenHeader(UniqueId.Generate()));\n            yield return new TransportMessage(TransportHeaderPool.Instance.CreateChannelOpenHeader(UniqueId.Generate()));\n            yield return new TransportMessage(\n                TransportHeaderPool.Instance.CreateFrameHeader(UniqueId.Generate(), true, 3),\n                new Maybe<IPooledBuffer>(PooledBuffer.Get(new byte[] { 1, 2, 3 })));\n            yield return new TransportMessage(\n                TransportHeaderPool.Instance.CreateChannelCloseHeader(\n                    UniqueId.Generate(),\n                    new CompletionHeader(CompletionStatusHeader.Canceled, Nothing.Instance)));\n            yield return new TransportMessage(\n                TransportHeaderPool.Instance.CreateConnectionCloseHeader(\n                    new CompletionHeader(\n                        CompletionStatusHeader.Failed,\n                        new ErrorHeader(\"Error message\", \"Error details\", nameof(Exception)))));\n        }\n\n        [Fact]\n        public void SendTransportMessageFromClientToServer()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                using (var clientConnection = await _client.ConnectAsync(BrokerWorkingDir))\n                using (var serverConnection = await _server.In.ReadAsync())\n                {\n                    var clientSender = new MessagingSendProcessor(clientConnection, SerializationProvider.GetSerializer());\n                    var serverReceiver = new MessagingReceiveProcessor(serverConnection, SerializationProvider.GetDeserializer(TransportHeaderPool.Instance));\n                    var connectionOpen = new TransportMessage(TransportHeaderPool.Instance.CreateConnectionOpenHeader(UniqueId.Generate()));\n                    var connectionClose = new TransportMessage(TransportHeaderPool.Instance.CreateConnectionCloseHeader(CompletionHeader.Completed));\n                    await clientSender.Out.WriteAsync(connectionOpen);\n                    await clientSender.Out.WriteAsync(connectionClose);\n                    clientSender.Out.TryComplete();\n\n                    var received1 = await serverReceiver.In.ReadAsync();\n                    var received2 = await serverReceiver.In.ReadAsync();\n\n                    Should.CompleteIn(serverReceiver.In.Completion, Timeout1Sec);\n                    received1.Header.ShouldBeAssignableTo<ITransportConnectionOpenHeader>();\n                    received2.Header.ShouldBeAssignableTo<ITransportConnectionCloseHeader>();                    \n                }\n            });\n        }\n\n        [Fact]\n        public void CanSendMessagesOfAllTypes()\n        {\n            var received = new List<TransportMessage>();\n            var serverTask = RunReceiverTaskAsync(() => _server.In.ReadAsync(), async receiver =>\n            {\n                while (true)\n                {\n                    var maybeMessage = await receiver.In.TryReadAsync().ConfigureAwait(false);\n                    if (!maybeMessage.HasValue)\n                    {\n                        Log.Trace(\"Receving terminated for stream {0}\", receiver.Id);\n                        break;\n                    }\n                    Log.Trace(\"Received message from stream {0}: {1}\", receiver.Id, maybeMessage.Value);\n                    received.Add(maybeMessage.Value);\n                }\n                await receiver.In.Completion.ConfigureAwait(false);\n            });\n\n            var testMessages = GenerateAllTransportMessages().ToArray();\n\n            var clientTask = RunSenderTaskAsync(() => _client.ConnectAsync(BrokerWorkingDir), async sender =>\n            {\n                foreach (var transportMessage in testMessages)\n                {\n                    transportMessage.Retain();\n                    await sender.Out.WriteAsync(transportMessage).ConfigureAwait(false);\n                }\n                sender.Out.TryComplete();\n                await sender.Out.Completion.ConfigureAwait(false);\n            });\n\n            Should.CompleteIn(Task.WhenAll(clientTask, serverTask), Timeout1Sec);\n\n            received.Count.ShouldBe(5);\n            using (var enumerator = received.GetEnumerator())\n            {\n                foreach (var expected in testMessages)\n                {\n                    using (expected)\n                    {\n                        enumerator.MoveNext().ShouldBe(true);\n                        using (var actual = enumerator.Current)\n                        {\n                            actual.Header.ShouldBe(expected.Header);\n                            actual.Payload.HasValue.ShouldBe(expected.Payload.HasValue);\n                            if (expected.Payload.HasValue)\n                            {\n                                var actualPayload = actual.Payload.Value.ToArray();\n                                var expectedPayload = expected.Payload.Value.ToArray();\n                                actualPayload.ShouldBe(expectedPayload);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        [Fact]\n        public void StreamFailure()\n        {\n            var receiverTask = TaskRunner.RunInBackground(async () =>\n            {\n                MessagingReceiveProcessor receiver;\n                using (var connection = await _server.In.ReadAsync().ConfigureAwait(false))\n                {\n                    receiver = new MessagingReceiveProcessor(connection, SerializationProvider.GetDeserializer(TransportHeaderPool.Instance));\n                    await receiver.In.TryReadAsync().ConfigureAwait(false);\n                }\n                await receiver.In.ConsumeAsync(x => x.Dispose()).ConfigureAwait(false);\n            });\n\n            var senderTask = TaskRunner.RunInBackground(async () =>\n            {\n                MessagingSendProcessor sender;\n                using (var clientStream = await _client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false))\n                {\n                    sender = new MessagingSendProcessor(clientStream, SerializationProvider.GetSerializer());\n                    var result = true;\n                    while (result)\n                    {\n                        var transportMessage = new TransportMessage(\n                            TransportHeaderPool.Instance.CreateFrameHeader(UniqueId.Generate(), true, 64),\n                            new Maybe<IPooledBuffer>(PooledBuffer.Get(Random.GetRandomBytes(64))));\n                        result = await sender.Out.TryWriteAsync(transportMessage).ConfigureAwait(false);\n                    }\n                }\n                Log.Trace(\"Awaiting completion of sender {0}\", sender.Id);\n                await sender.Out.Completion.ConfigureAwait(false);\n            });\n            Should.Throw<OperationCanceledException>(receiverTask, Timeout1Sec);\n            Should.Throw<Exception>(senderTask, Timeout1Sec);\n            Log.Trace(senderTask.Exception.ExtractInner(), \"Received exception on sending\");\n        }\n\n        private Task RunReceiverTaskAsync(Func<ValueTask<ITransmissionConnection>> connectionFactory, Func<IMessagingReceiveProcessor, Task> action)\n        {\n            return TaskRunner.RunInBackground(async () =>\n            {\n                using (var connection = await connectionFactory().ConfigureAwait(false))\n                {\n                    var receiver = new MessagingReceiveProcessor(connection, SerializationProvider.GetDeserializer(TransportHeaderPool.Instance));\n                    await action(receiver).ConfigureAwait(false);\n                    await receiver.In.Completion.ConfigureAwait(false);\n                    Log.Trace(\"Completing server stream for connection {0}\", connection.Id);\n                    connection.Out.TryComplete();\n                    await connection.Completion.ConfigureAwait(false);\n                }\n            });\n        }\n\n        private Task RunSenderTaskAsync(Func<ValueTask<ITransmissionConnection>> connectionFactory, Func<IMessagingSendProcessor, Task> action)\n        {\n            return TaskRunner.RunInBackground(async () =>\n            {\n                using (var connection = await connectionFactory().ConfigureAwait(false))\n                {\n                    var sender = new MessagingSendProcessor(connection, SerializationProvider.GetSerializer());\n                    await action(sender).ConfigureAwait(false);\n                    sender.Out.TryComplete();\n                    await sender.Out.Completion.ConfigureAwait(false);\n                    Log.Trace(\"Waiting for completion of connection {0}\", connection.Id);\n                    await connection.Completion.ConfigureAwait(false);\n                }\n            });\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Protocol.Tests/Plexus.Interop.Transport.Protocol.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.Protocol</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"AsyncFriendlyStackTrace\" Version=\"1.6.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"Shouldly\" Version=\"3.0.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol\\Plexus.Interop.Transport.Protocol.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Testing/Plexus.Interop.Transport.Testing.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Diagnostics.Tracing\" Version=\"4.3.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport\\Plexus.Interop.Transport.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Testing/TransportTestsSuite.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using Plexus.Channels;\n    using Shouldly;\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Threading.Tasks;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    public abstract class TransportTestsSuite : TestsSuite\n    {\n        protected abstract ITransportServer Server { get; }\n\n        protected abstract ITransportClient Client { get; }\n\n        protected string BrokerWorkingDir { get; } = Directory.GetCurrentDirectory();\n\n        protected TransportTestsSuite(ITestOutputHelper output) : base(output)\n        {\n        }\n\n        public sealed class ChannelExchange : IXunitSerializable\n        {\n            public ChannelExchange()\n            {\n            }\n\n            public ChannelExchange(int[] incomingMessageLengths, int[] outcomingMessageLengths)\n            {\n                ServerMessageLengths = incomingMessageLengths;\n                ClientMessageLengths = outcomingMessageLengths;\n            }\n\n            public int[] ServerMessageLengths { get; set; }\n            public int[] ClientMessageLengths { get; set; }\n\n            public void Deserialize(IXunitSerializationInfo info)\n            {\n                ServerMessageLengths = info.GetValue<int[]>(nameof(ServerMessageLengths));\n                ClientMessageLengths = info.GetValue<int[]>(nameof(ClientMessageLengths));\n            }\n\n            public void Serialize(IXunitSerializationInfo info)\n            {\n                info.AddValue(nameof(ServerMessageLengths), ServerMessageLengths);\n                info.AddValue(nameof(ClientMessageLengths), ClientMessageLengths);\n            }\n\n            public override string ToString()\n            {\n                return $\"{{[{string.Join(\", \", ServerMessageLengths)}], [{string.Join(\",\", ClientMessageLengths)}]}}\";\n            }\n        }        \n\n        [Fact]\n        public void DisposeFromServerSide()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                await Server.StartAsync();\n                using (var clientConnection = await Client.ConnectAsync(BrokerWorkingDir))\n                using (var serverConnection = await Server.In.ReadAsync())\n                {\n                    serverConnection.Dispose();\n\n                    Should.Throw<OperationCanceledException>(serverConnection.Completion, Timeout1Sec);\n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                }\n            });\n        }\n\n        [Fact]\n        public void DisposeFromClientSide()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                await Server.StartAsync();\n                using (var clientConnection = await Client.ConnectAsync(BrokerWorkingDir))\n                using (var serverConnection = await Server.In.ReadAsync())\n                {\n                    clientConnection.Dispose();\n                    \n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                    Should.Throw<OperationCanceledException>(serverConnection.Completion, Timeout1Sec);\n                }\n            });\n        }\n\n        [Fact]\n        public void DisconnectFromClientSide()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                await Server.StartAsync();\n                using (var clientConnection = await Client.ConnectAsync(BrokerWorkingDir))\n                using (var serverConnection = await Server.In.ReadAsync())\n                {\n                    clientConnection.TryTerminate();\n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                    WriteLog(\"Client completed\");\n                    Should.Throw<OperationCanceledException>(serverConnection.Completion, Timeout1Sec);\n                    WriteLog(\"Server completed\");                    \n                }\n            });\n        }\n\n        [Fact]\n        public void DisconnectFromServerSide()\n        {\n            RunWith10SecTimeout(async () =>\n            {\n                await Server.StartAsync();\n                using (var clientConnection = await Client.ConnectAsync(BrokerWorkingDir))\n                using (var serverConnection = await Server.In.ReadAsync())\n                {\n                    serverConnection.TryTerminate();\n                    Should.Throw<OperationCanceledException>(serverConnection.Completion, Timeout1Sec);\n                    WriteLog(\"Server completed\");\n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                    WriteLog(\"Client completed\");\n                }\n            });\n        }\n\n        [Fact]\n        public void TerminateChannelFromClientSide()\n        {\n            RunWith10SecTimeout(\n                async () =>\n                {\n                    await Server.StartAsync().ConfigureAwait(false);\n                    using (var clientConnection = RegisterDisposable(await Client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false)))\n                    using (var serverConnection = RegisterDisposable(await Server.In.ReadAsync().ConfigureAwait(false)))\n                    {\n                        var clientChannel = await clientConnection.CreateChannelAsync().ConfigureAwait(false);\n                        var serverChannel = await serverConnection.IncomingChannels.ReadAsync().ConfigureAwait(false);\n                        WriteLog(\"Terminating client channel\");\n                        clientChannel.Out.TryTerminate();\n                        clientChannel.Out.Completion.IsCanceled.ShouldBe(true);\n                        Should.Throw<OperationCanceledException>(() => clientChannel.Completion, Timeout1Sec);\n                        WriteLog(\"Client channel terminated\");\n                        Should.Throw<OperationCanceledException>(() => serverChannel.Completion, Timeout1Sec);\n                        WriteLog(\"Server channel terminated\");\n                    }\n                });\n        }\n\n        [Fact]\n        public void TerminateChannelFromServerSide()\n        {\n            RunWith10SecTimeout(\n                async () =>\n                {\n                    await Server.StartAsync().ConfigureAwait(false);\n                    var serverConnectionTask = Server.In.ReadAsync();\n                    var clientConnection = RegisterDisposable(await Client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false));\n                    var serverConnection = RegisterDisposable(await serverConnectionTask.ConfigureAwait(false));\n                    var clientChannel = await clientConnection.CreateChannelAsync().ConfigureAwait(false);\n                    var serverChannel = await serverConnection.IncomingChannels.ReadAsync().ConfigureAwait(false);\n                    serverChannel.Out.TryTerminate();\n                    Should.Throw<OperationCanceledException>(() => clientChannel.Completion, Timeout1Sec);\n                    Should.Throw<OperationCanceledException>(() => serverChannel.Completion, Timeout1Sec);\n                });\n        }\n\n        [Fact]\n        public void ShouldNotBePossibleCreateChannelOnClientSideAfterConnectionTerminatedOnServerSide()\n        {\n            RunWith10SecTimeout(\n                async () =>\n                {\n                    await Server.StartAsync();\n                    var serverConnectionTask = Server.In.ReadAsync();\n                    var clientConnection = RegisterDisposable(await Client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false));\n                    var serverConnection = RegisterDisposable(await serverConnectionTask.ConfigureAwait(false));\n                    serverConnection.TryTerminate();\n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                    Should.Throw<OperationCanceledException>(clientConnection.CreateChannelAsync().AsTask(), Timeout1Sec);\n                });\n        }\n\n        [Fact]\n        public void ShouldNotBePossibleCreateChannelOnClientSideAfterConnectionTerminated()\n        {\n            RunWith10SecTimeout(\n                async () =>\n                {\n                    await Server.StartAsync().ConfigureAwait(false);                    \n                    var clientConnection = await Client.ConnectAsync(BrokerWorkingDir);\n                    var serverConnection = await Server.In.ReadAsync();\n                    clientConnection.TryTerminate();\n                    Should.Throw<OperationCanceledException>(clientConnection.CreateChannelAsync().AsTask(), Timeout1Sec);\n                    Should.Throw<OperationCanceledException>(clientConnection.Completion, Timeout1Sec);\n                });\n        }\n\n        public static TheoryData<ChannelExchange[]> SendMessagesInBothDirectionsTestCases =\n            new TheoryData<ChannelExchange[]>\n            {\n                    new ChannelExchange[] { },\n                    new ChannelExchange[] {\n                        new ChannelExchange(new int[] { }, new int[] { }),\n                        new ChannelExchange(new int[] { }, new int[] { })\n                    },\n                    new ChannelExchange[] { new ChannelExchange(new[] { 3 }, new int[] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { }, new [] { 3 }) },\n                    new ChannelExchange[] { new ChannelExchange(new [] { 3 }, new [] { 3 }) },\n                    new ChannelExchange[] { new ChannelExchange(new [] { 3, 5, 1 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int [] { }, new [] { 3, 5, 1 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int [] { }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 0 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { }, new int [] { 0 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { }, new int [] { 5, 0, 10 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 5, 0, 10 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 65000 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { }, new int [] { 65000 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 65000 }, new int [] { 65000 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 65001 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { }, new int [] { 65001 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 65001 }, new int [] { 65001 }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 1024*1024*5 }, new int [] { }) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }) },\n                    new ChannelExchange[] { new ChannelExchange(CreateArray(100, 64), CreateArray(200, 64)) },\n                    new ChannelExchange[] { new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }) },\n                    new ChannelExchange[] {\n                        new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }),\n                        new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }),\n                        new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }),\n                        new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }),\n                        new ChannelExchange(new int[] { 1024*1024*5, 65001, 0, 65001 }, new int [] { 1024 * 1024 * 5, 65001, 0, 65001 }),\n                    },\n                    new ChannelExchange[] {\n                        new ChannelExchange(new int[] { 1024*1024, 65001, 0, 65001 }, new int [] { 1024 * 1024, 0, 65001, 0, 1, 2, 3, 4, 5 }),\n                        new ChannelExchange(new int[] { }, new int [] { 1024 * 1024, 0, 65001, 0 }),\n                        new ChannelExchange(new int[] { 1024*1024, 0, 65001 }, new int [] { })\n                    },\n                    new ChannelExchange[] {\n                        new ChannelExchange(new int[] { 1, 2, 3}, new int [] { 1, 0, 1, 2, 3, 4, 5, 6, 7, 8 }),\n                        new ChannelExchange(new int[] { }, new int [] { 3, 0, 3, 0 }),\n                    },\n                    new ChannelExchange[] {\n                        new ChannelExchange(new int[] { 1024*1024, 65001, 0, 65001 }, new int [] { 1024 * 1024, 0, 65001, 0, 1, 2, 3, 4, 5 }),\n                    },\n            };\n\n        [Theory]\n        [MemberData(nameof(SendMessagesInBothDirectionsTestCases))]\n#pragma warning disable xUnit1026 // Theory methods should use all of their parameters\n        public void SendMessagesInBothDirections(ChannelExchange[] cases)\n#pragma warning restore xUnit1026 // Theory methods should use all of their parameters\n        {\n            var serverSentMessageHashes = new List<List<byte[]>>();\n            var serverReceivedMessageHashes = new List<List<byte[]>>();\n            var clientSentMessageHashes = new List<List<byte[]>>();\n            var clientReceivedMessageHashes = new List<List<byte[]>>();\n\n            async Task HandleChannelAsync(ITransportChannel c, int[] send, List<byte[]> received, List<byte[]> sent)\n            {\n                WriteLog($\"Handling channel {c.Id}\");\n                var receiveTask = TaskRunner.RunInBackground(\n                        async () =>\n                        {\n                            while (true)\n                            {\n                                var receivedMsg = await c.TryReceiveMessageAsync().ConfigureAwait(false);\n                                if (!receivedMsg.HasValue)\n                                {\n                                    break;\n                                }\n                                lock (Sha256)\n                                {\n                                    received.Add(Sha256.ComputeHash(receivedMsg.Value));\n                                }\n                            }\n                        });\n                foreach (var length in send)\n                {\n                    var msg = TestsSuite.Random.GetRandomBytes(length);\n                    await c.SendMessageAsync(msg).ConfigureAwait(false);\n                    lock (Sha256)\n                    {\n                        sent.Add(Sha256.ComputeHash(msg));\n                    }\n                }\n                c.Out.TryComplete();\n                await receiveTask.ConfigureAwait(false);\n                WriteLog($\"Channel handling completed {c.Id}. Received {received.Count} messages.\");\n            }\n\n            ITransportConnection clientConnection = null;\n            ITransportConnection serverConnection = null;\n            var serverTask = TaskRunner.RunInBackground(\n                async () =>\n                {\n                    await Server.StartAsync().ConfigureAwait(false);\n                    serverConnection = await Server.In.ReadAsync().ConfigureAwait(false);\n                    WriteLog(\"Server connection created\");\n                    var channelTasks = new List<Task>();\n                    foreach (var channelExchange in cases)\n                    {\n                        var channel = await serverConnection.CreateChannelAsync().ConfigureAwait(false);\n                        WriteLog(\"Server channel created\");\n                        var rec = new List<byte[]>();\n                        var sent = new List<byte[]>();\n                        clientReceivedMessageHashes.Add(rec);\n                        clientSentMessageHashes.Add(sent);\n                        channelTasks.Add(TaskRunner.RunInBackground(() =>\n                            HandleChannelAsync(channel, channelExchange.ClientMessageLengths, rec, sent)));\n                    }\n                    await Task.WhenAll(channelTasks).ConfigureAwait(false);\n                });\n\n            var clientTask = TaskRunner.RunInBackground(\n                async () =>\n                {\n                    clientConnection = await Client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false);\n                    WriteLog(\"Client connection created\");\n                    var channelTasks = new List<Task>();\n                    foreach (var channelExchange in cases)\n                    {\n                        var channel = await clientConnection.IncomingChannels.ReadAsync().ConfigureAwait(false);\n                        WriteLog(\"Client channel received\");\n                        var rec = new List<byte[]>();\n                        var sent = new List<byte[]>();\n                        serverReceivedMessageHashes.Add(rec);\n                        serverSentMessageHashes.Add(sent);\n                        channelTasks.Add(TaskRunner.RunInBackground(() => HandleChannelAsync(channel, channelExchange.ServerMessageLengths, rec, sent)));\n                    }\n                    await Task.WhenAll(channelTasks).ConfigureAwait(false);\n                });\n\n            Should.CompleteIn(Task.WhenAll(serverTask, clientTask), Timeout30Sec);\n            Should.CompleteIn(clientConnection.CompleteAsync(), Timeout1Sec);\n            Should.CompleteIn(serverConnection.CompleteAsync(), Timeout1Sec);\n\n            WriteLog(\"Tasks completed\");\n            serverReceivedMessageHashes.Count.ShouldBe(cases.Length);\n            serverSentMessageHashes.Count.ShouldBe(cases.Length);\n            clientReceivedMessageHashes.Count.ShouldBe(cases.Length);\n            clientSentMessageHashes.Count.ShouldBe(cases.Length);\n            for (int i = 0; i < serverReceivedMessageHashes.Count; i++)\n            {\n                serverReceivedMessageHashes[i].Count.ShouldBe(clientSentMessageHashes[i].Count);\n                for (int j = 0; j < serverReceivedMessageHashes[i].Count; j++)\n                {\n                    serverReceivedMessageHashes[i][j].ShouldBe(clientSentMessageHashes[i][j]);\n                }\n            }\n            for (int i = 0; i < clientReceivedMessageHashes.Count; i++)\n            {\n                clientReceivedMessageHashes[i].Count.ShouldBe(serverSentMessageHashes[i].Count);\n                for (int j = 0; j < clientReceivedMessageHashes[i].Count; j++)\n                {\n                    clientReceivedMessageHashes[i][j].ShouldBe(serverSentMessageHashes[i][j]);\n                }\n            }\n        }\n\n        private static int[] CreateArray(int count, int value)\n        {\n            var a = new int[count];\n            for (var i = 0; i < count; i++)\n            {\n                a[i] = value;\n            }\n            return a;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Contracts/ITransmissionClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission\n{\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public interface ITransmissionClient\n    {\n        ValueTask<ITransmissionConnection> ConnectAsync(string brokerWorkingDir, CancellationToken cancellationToken = default);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Contracts/ITransmissionConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.Threading.Tasks;\n\n    public interface ITransmissionConnection : IChannel<IPooledBuffer>, IDisposable\n    {\n        UniqueId Id { get; }\n\n        Task Completion { get; }\n\n        Task DisconnectAsync();\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Contracts/ITransmissionServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission\n{\n    using Plexus.Channels;\n    using System;\n    using System.Threading.Tasks;\n\n    public interface ITransmissionServer : IDisposable\n    {   \n        Task Completion { get; }\n\n        IReadableChannel<ITransmissionConnection> In { get; }\n\n        Task StartAsync();\n\n        void Stop();\n\n        Task StopAsync();        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Contracts/Plexus.Interop.Transport.Transmission.Contracts.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.Transmission</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Buffers\" Version=\"4.5.0\" />\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes/Internal/PipeTransmissionClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.Pipes.Internal\n{\n    using System;\n    using System.IO;\n    using System.IO.Pipes;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Interop.Transport.Transmission.Streams;\n\n    internal sealed class PipeTransmissionClient : ITransmissionClient\n    {        \n        private const string ServerName = \"np-v1\";\n\n        private static readonly TimeSpan ConnectTimeoutMs = TimeoutConstants.Timeout20Sec;\n        private static readonly TimeSpan MaxServerInitializationTime = TimeoutConstants.Timeout1Min;\n        private static readonly ILogger Log = LogManager.GetLogger<PipeTransmissionClient>();\n\n        public async ValueTask<ITransmissionConnection> ConnectAsync(string brokerWorkingDir, CancellationToken cancellationToken)\n        {\n            var connection = await StreamTransmissionConnection.CreateAsync(\n                UniqueId.Generate(),\n                () => ConnectStreamAsync(brokerWorkingDir, cancellationToken));\n            Log.Trace(\"Created connection {0}\", connection);\n            return connection;\n        }\n\n        private static async ValueTask<Stream> ConnectStreamAsync(string brokerWorkingDir, CancellationToken cancellationToken)\n        {\n            var pipeName = EnvironmentHelper.GetPipeAddress();\n            if (string.IsNullOrEmpty(pipeName))\n            {\n                var serverStateReader = new ServerStateReader(ServerName, brokerWorkingDir);\n                if (!await serverStateReader\n                    .WaitInitializationAsync(MaxServerInitializationTime, cancellationToken)\n                    .ConfigureAwait(false))\n                {\n                    throw new TimeoutException(\n                        $\"Timeout ({MaxServerInitializationTime.TotalSeconds}sec) while waiting for server \\\"{ServerName}\\\" availability\");\n                }\n\n                pipeName = serverStateReader.ReadSetting(\"address\");\n            }\n\n            if (string.IsNullOrEmpty(pipeName))\n            {\n                throw new InvalidOperationException(\"Cannot find pipe name to connect\");\n            }\n\n            Log.Trace(\"Connecting to pipe\");\n            var pipeClientStream = new NamedPipeClientStream(\".\", pipeName, PipeDirection.InOut, PipeOptions.Asynchronous | PipeOptions.WriteThrough);\n            try\n            {\n                await ConnectAsync(pipeClientStream, cancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                Log.Trace(\"Connection to pipe terminated: {0}\", ex.FormatTypeAndMessage());\n                pipeClientStream.Dispose();\n                cancellationToken.ThrowIfCancellationRequested();\n                throw;\n            }\n            Log.Trace(\"Connected to pipe\");\n            return pipeClientStream;\n        }\n\n#if NET45\n        private static async Task ConnectAsync(\n            NamedPipeClientStream pipeClientStream,\n            CancellationToken cancellationToken)\n        {\n            await TaskRunner\n                .RunInBackground(() => pipeClientStream.Connect((int)ConnectTimeoutMs.TotalMilliseconds), cancellationToken)\n                .WithCancellation(cancellationToken, _ => pipeClientStream.Dispose())\n                .ConfigureAwait(false);\n            pipeClientStream.ReadMode = PipeTransmissionMode.Byte;\n        }\n#else\n        private static async Task ConnectAsync(\n            NamedPipeClientStream pipeClientStream,\n            CancellationToken cancellationToken)\n        {\n            using (var combinedCancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            {\n                combinedCancellation.CancelAfter(ConnectTimeoutMs);\n                try\n                {\n                    await pipeClientStream\n                        .ConnectAsync(cancellationToken)\n                        .ConfigureAwait(false);\n                }\n                catch (OperationCanceledException) when (combinedCancellation.IsCancellationRequested && !cancellationToken.IsCancellationRequested)\n                {\n                    throw new TimeoutException(\n                        $\"Timeout {ConnectTimeoutMs} ms occured while establishing named pipe connection\");\n                }\n            }\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes/Internal/PipeTransmissionServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.Pipes.Internal\n{\n    using System;\n    using System.IO;\n    using System.IO.Pipes;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Transmission.Streams;\n    using Plexus.Processes;\n\n    internal sealed class PipeTransmissionServer : ProcessBase, ITransmissionServer\n    {\n        private const int AcceptedConnectionsBufferSize = 20;\n        private const string ServerName = \"np-v1\";\n\n        private readonly ILogger _log;\n        private readonly IServerStateWriter _settingsWriter;\n        private readonly string _pipeName = \"plexus-interop-broker-\" + Guid.NewGuid();\n        private readonly BufferedChannel<ITransmissionConnection> _buffer \n            = new BufferedChannel<ITransmissionConnection>(AcceptedConnectionsBufferSize);\n\n        public PipeTransmissionServer(string brokerWorkingDir)\n        {\n            _log = LogManager.GetLogger<PipeTransmissionServer>();\n            _settingsWriter = new ServerStateWriter(ServerName, brokerWorkingDir);\n            _buffer.Out.PropagateCompletionFrom(Completion);\n        }\n\n        public IReadableChannel<ITransmissionConnection> In => _buffer.In;\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            _log.Debug(\"Starting\");\n            _settingsWriter.Write(\"address\", _pipeName);\n            _settingsWriter.SignalInitialized();\n            _log.Info(\"Pipe server started: {0}\", _pipeName);\n            return Task.FromResult(ProcessAsync());\n        }\n\n        private async Task ProcessAsync()\n        {\n            using (_settingsWriter)\n            {\n                while (true)\n                {\n                    var connection = await StreamTransmissionConnection\n                        .CreateAsync(UniqueId.Generate(), AcceptStreamAsync)\n                        .ConfigureAwait(false);\n                    try\n                    {\n                        await _buffer.Out\n                            .WriteAsync(connection, CancellationToken)\n                            .ConfigureAwait(false);\n                    }\n                    catch\n                    {\n                        await connection.DisconnectAsync().IgnoreExceptions().ConfigureAwait(false);\n                        throw;\n                    }\n                }\n            }\n        }\n\n        private async ValueTask<Stream> AcceptStreamAsync()\n        {\n            _log.Trace(\"Waiting for connection\");\n            var pipeServerStream = new NamedPipeServerStream(\n                _pipeName,\n                PipeDirection.InOut,\n                -1,\n                PipeTransmissionMode.Byte,\n                PipeOptions.Asynchronous | PipeOptions.WriteThrough);\n            try\n            {\n                await WaitForConnectionAsync(pipeServerStream, CancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _log.Trace(\"Waiting for new connection failed: {0}\", ex.FormatTypeAndMessage());\n                pipeServerStream.Dispose();\n                throw;\n            }\n            _log.Trace(\"Received new connection\");\n            return pipeServerStream;\n        }\n\n#if NET45\n        private static async Task WaitForConnectionAsync(\n            NamedPipeServerStream pipeServerStream,\n            CancellationToken cancellationToken)\n        {\n            try\n            {\n                await Task.Factory\n                    .FromAsync(\n                        pipeServerStream.BeginWaitForConnection,\n                        pipeServerStream.EndWaitForConnection,\n                        null)\n                    .WithCancellation(cancellationToken);\n            }\n            catch\n            {\n                cancellationToken.ThrowIfCancellationRequested();\n                throw;\n            }\n        }\n#else\n        private static async Task WaitForConnectionAsync(NamedPipeServerStream pipeServerStream, CancellationToken cancellationToken)\n        {\n            await pipeServerStream.WaitForConnectionAsync(cancellationToken).ConfigureAwait(false);\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes/PipeTranmissionServerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Transmission.Pipes\n{\n    using Plexus.Interop.Transport.Transmission.Pipes.Internal;\n\n    public sealed class PipeTransmissionServerFactory\n    {\n        public static PipeTransmissionServerFactory Instance = new PipeTransmissionServerFactory();\n\n        public ITransmissionServer Create(string brokerWorkingDir)\n        {\n            return new PipeTransmissionServer(brokerWorkingDir);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes/PipeTransmissionClientFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Transmission.Pipes\n{\n    using Plexus.Interop.Transport.Transmission.Pipes.Internal;\n\n    public sealed class PipeTransmissionClientFactory\n    {\n        public static PipeTransmissionClientFactory Instance = new PipeTransmissionClientFactory();\n\n        public ITransmissionClient Create()\n        {\n            return new PipeTransmissionClient();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes/Plexus.Interop.Transport.Transmission.Pipes.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Streams\\Plexus.Interop.Transport.Transmission.Streams.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Utils\\Plexus.Interop.Transport.Utils.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes.Tests/PipeTransmissionTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.Pipes\n{\n    using Xunit.Abstractions;\n\n    public sealed class PipeTransmissionTests : TransmissionTestsSuite\n    {\n        public PipeTransmissionTests(ITestOutputHelper output) : base(output)\n        {\n        }\n\n        protected override ITransmissionClient CreateClient()\n        {\n            return PipeTransmissionClientFactory.Instance.Create();\n        }\n\n        protected override ITransmissionServer CreateServer()\n        {\n            return RegisterDisposable(PipeTransmissionServerFactory.Instance.Create(BrokerWorkingDir));\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes.Tests/Plexus.Interop.Transport.Transmission.Pipes.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n    <RootNamespace>Plexus.Interop.Transport.Transmission.Pipes</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"Shouldly\" Version=\"3.0.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Testing\\Plexus.Interop.Transport.Transmission.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Pipes.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Streams/Internal/StreamTransmissionReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.Streams.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class StreamTransmissionReader\n    {\n        private const int EndMessage = 65535;\n\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly byte[] _lengthBuffer = new byte[2];\n        private readonly Stream _stream;\n        private readonly CancellationToken _cancellationToken;\n        private readonly ILogger _log;\n        private long _count;\n\n        public StreamTransmissionReader(\n            UniqueId id, \n            Stream stream, \n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<StreamTransmissionReader>(id.ToString());\n            _stream = stream;\n            _cancellationToken = cancellationToken;\n            _buffer.Out.PropagateCompletionFrom(ProcessAsync());\n            _buffer.Out.Completion.LogCompletion(_log);\n        }\n\n        public IReadableChannel<IPooledBuffer> In => _buffer.In;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                while (true)\n                {\n                    _log.Trace(\"Awaiting next message {0}\", _count);\n                    var length = await ReadLengthAsync().ConfigureAwait(false);\n                    if (length == EndMessage)\n                    {\n                        _log.Trace(\"Completing receiving datagrams because <END> message received\");\n                        break;\n                    }\n                    _log.Trace(\"Reading message {0} of length {1}\", _count, length);\n                    var datagram = await ReadDatagram(length);\n                    await WriteDatagram(datagram);\n                    _log.Trace(\"Received message {0} of length {1}\", _count, length);\n                    _count++;\n                }\n                _buffer.Out.TryComplete();\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, \"Process failed\");\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                throw;\n            }\n        }\n\n        private async Task<int> ReadLengthAsync()\n        {\n            try\n            {\n                var readBytes = await ReadAsync(_lengthBuffer, 0, 2);\n                while (readBytes < 2)\n                {\n                    _log.Info($\"Read {readBytes} while reading length. Will try to read next byte\");\n                    readBytes += await ReadAsync(_lengthBuffer, readBytes, 2 - readBytes);\n                }\n                return (_lengthBuffer[0] << 8) | _lengthBuffer[1];\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, \"Caught exception during attempt to read length\");\n                throw;\n            }\n        }\n\n        private async Task<int> ReadAsync(byte[] buffer, int offset, int count)\n        {\n            int readBytes;\n#if NETSTANDARD2_0\n            readBytes = await _stream.ReadAsync(buffer, offset, count, _cancellationToken).ConfigureAwait(false);\n#else\n            readBytes = await _stream.ReadAsync(buffer, offset, count, _cancellationToken).WithCancellation(_cancellationToken).ConfigureAwait(false);\n#endif\n            if (readBytes == 0)\n            {\n                throw new InvalidOperationException(\"Stream completed unexpectedly\");\n            }\n            return readBytes;\n        }\n\n        private async Task<IPooledBuffer> ReadDatagram(int length)\n        {\n            try\n            {\n                var datagram = await PooledBuffer\n                    .Get(_stream, length, _cancellationToken)\n                    .ConfigureAwait(false);\n                return datagram;\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, $\"Caught exception during attempt to read datagram of length {length}\");\n                throw;\n            }\n        }\n\n        private async Task WriteDatagram(IPooledBuffer datagram)\n        {\n            try\n            {\n                await _buffer.Out.WriteAsync(datagram, _cancellationToken).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, $\"Caught exception during attempt to write datagram of length {datagram.Count}\");\n                datagram.Dispose();\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Streams/Internal/StreamTransmissionWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.Streams.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class StreamTransmissionWriter\n    {\n        private const int EndMessage = 65535;\n\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly byte[] _lengthBuffer = new byte[2];\n        private readonly Stream _stream;\n        private readonly CancellationToken _cancellationToken;\n        private readonly ILogger _log;\n        private long _count;\n\n        public StreamTransmissionWriter(\n            UniqueId id, \n            Stream stream, \n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<StreamTransmissionWriter>(id.ToString());\n            _stream = stream;\n            _cancellationToken = cancellationToken;\n            Completion = ProcessAsync().LogCompletion(_log);\n        }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _buffer.Out;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.In.ConsumeAsync(SendAsync, _cancellationToken, CompleteSendingAsync).ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                throw;\n            }\n        }\n\n        private async Task SendAsync(IPooledBuffer datagram)\n        {\n            using (datagram)\n            {\n                var length = datagram.Count;\n                _log.Trace(\"Sending message {0} of length: {1}\", _count, length);\n                await WriteLengthAsync(length).ConfigureAwait(false);\n                await _stream.WriteAsync(datagram.Array, datagram.Offset, length, _cancellationToken)\n                    .ConfigureAwait(false);\n                await _stream.FlushAsync(_cancellationToken).ConfigureAwait(false);\n                _log.Trace(\"Sent message {0} of length {1}\", _count, length);\n                _count++;\n            }\n        }\n\n        private async Task CompleteSendingAsync()\n        {\n            _log.Trace(\"Sending <END> message to complete sending\");\n            await WriteLengthAsync(EndMessage).ConfigureAwait(false);\n            await _stream.FlushAsync(_cancellationToken).ConfigureAwait(false);\n        }\n\n        private async Task WriteLengthAsync(int length)\n        {\n            _lengthBuffer[0] = (byte)(length >> 8);\n            _lengthBuffer[1] = (byte)length;\n            await _stream.WriteAsync(_lengthBuffer, 0, 2, _cancellationToken).ConfigureAwait(false);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Streams/Plexus.Interop.Transport.Transmission.Streams.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Buffers\" Version=\"4.5.0\" />\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Streams/StreamTransmissionConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.Streams\n{\n    using Plexus.Channels;\n    using Plexus.Interop.Transport.Transmission.Streams.Internal;\n    using Plexus.Pools;\n    using System;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public sealed class StreamTransmissionConnection : ITransmissionConnection\n    {\n        public static async ValueTask<ITransmissionConnection> CreateAsync(UniqueId id, Func<ValueTask<Stream>> streamFactory)\n        {\n            var result = await streamFactory().ConfigureAwait(false);\n            return new StreamTransmissionConnection(id, result);\n        }\n\n        private readonly ILogger _log;\n        private readonly StreamTransmissionWriter _writer;\n        private readonly StreamTransmissionReader _reader;\n        private readonly Stream _stream;\n        private readonly CancellationTokenSource _cancellation = new CancellationTokenSource();\n\n        private StreamTransmissionConnection(UniqueId id, Stream stream)\n        {\n            Id = id;\n            _log = LogManager.GetLogger<StreamTransmissionConnection>(id.ToString());\n            _writer = new StreamTransmissionWriter(id, stream, _cancellation.Token);\n            _reader = new StreamTransmissionReader(id, stream, _cancellation.Token);            \n            _stream = stream;\n            Out = _writer.Out;\n            In = _reader.In;\n            Completion = ProcessAsync().LogCompletion(_log);\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out { get; }\n\n        public IReadableChannel<IPooledBuffer> In { get; }\n\n        private async Task ProcessAsync()\n        {\n            using (_stream)\n            {\n                var writerCompletion = GetWriterCompletion();\n                var readerCompletion = GetReaderCompletion();\n                try\n                {\n                    await Task.WhenAny(writerCompletion, readerCompletion).Unwrap().ConfigureAwait(false);\n                }\n                catch (Exception ex)\n                {\n                    _log.Warn(ex, $\"Caught exception during {nameof(ProcessAsync)}\");\n                    _cancellation.Cancel();\n                    throw;\n                }\n                await Task.WhenAll(writerCompletion, readerCompletion).ConfigureAwait(false);\n                _log.Trace(\"Processing completed. Disposing stream.\");\n            }\n        }\n\n        private async Task GetReaderCompletion()\n        {\n            try\n            {\n                await _reader.In.Completion;\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, $\"Caught exception during {nameof(GetReaderCompletion)}\");\n                throw;\n            }\n        }\n\n        private async Task GetWriterCompletion()\n        {\n            try\n            {\n                await _writer.Completion;\n            }\n            catch (Exception ex)\n            {\n                _log.Warn(ex, $\"Caught exception during {nameof(GetWriterCompletion)}\");\n                throw;\n            }\n        }\n\n        public async Task DisconnectAsync()\n        {\n            _log.Trace(\"Disconnecting\");\n            _cancellation.Cancel();\n            await Completion.IgnoreExceptions().ConfigureAwait(false);\n            _log.Trace(\"Disconnected\");\n        }\n\n        public void Dispose()\n        {\n            _log.Trace(\"Disposing\");\n            DisconnectAsync().GetResult();\n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Id)}: {Id}, Type: {GetType()}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Testing/Plexus.Interop.Transport.Transmission.Testing.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.Transmission</RootNamespace>\n    <IsPackable>false</IsPackable>\n\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />    \n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.Testing/TransmissionTestsSuite.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Shouldly;\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Linq;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    public abstract class TransmissionTestsSuite : TestsSuite\n    {\n        protected abstract ITransmissionServer CreateServer();\n        protected abstract ITransmissionClient CreateClient();\n        protected string BrokerWorkingDir { get; } = Directory.GetCurrentDirectory();\n\n        protected TransmissionTestsSuite(ITestOutputHelper output) : base(output)\n        {\n        }\n\n        [Fact]\n        public void SequentialConnect()\n        {\n            RunWith30SecTimeout(async () =>\n            {\n                WriteLog(\"Starting server\");\n                using (var server = CreateServer())\n                {\n                    await server.StartAsync();                    \n                    for (var i=0; i<100; i++)\n                    {\n                        WriteLog($\"Connecting client {i}\");\n                        var serverConnectionTask = server.In.ReadAsync();\n                        var client = CreateClient();\n                        using (var clientConnection = await client.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false))\n                        {\n                            WriteLog($\"Client {i} connected\");\n                            using (var serverConnection = await serverConnectionTask.ConfigureAwait(false))\n                            {\n                                WriteLog($\"Server connection {i} established\");\n\n                                WriteLog($\"Disconnecting client {i}\");\n                                await clientConnection.DisconnectAsync().ConfigureAwait(false);\n                                WriteLog($\"Client {i} disconnected\");\n\n                                WriteLog($\"Disconnecting server {i}\");\n                                await serverConnection.DisconnectAsync().ConfigureAwait(false);                                \n                                WriteLog($\"Server {i} disconnected\");\n                            }\n                        }\n                    }\n\n                    WriteLog(\"Disposing server\");\n                }\n            });\n        }\n\n        [Fact]\n        public void ConcurrentConnect()\n        {\n            RunWith30SecTimeout(async () =>\n            {\n                WriteLog(\"Starting server\");\n                using (var server = CreateServer())\n                {\n                    await server.StartAsync();\n                    WriteLog(\"Connecting clients\");\n                    const int concurrentClientsCount = 5;\n                    var client = CreateClient();\n                    var connectTasks = Enumerable\n                        .Range(0, concurrentClientsCount)\n                        .Select(_ => TaskRunner.RunInBackground(async () => await client.ConnectAsync(BrokerWorkingDir)));\n                    WriteLog(\"Accepting clients\");\n                    server.In.ConsumeAsync(c => { }).IgnoreAwait();\n                    Task.WhenAll(connectTasks).ShouldCompleteIn(Timeout10Sec);\n                    WriteLog(\"Clients connected\");                    \n                }\n            });\n        }\n\n        [Fact]\n        public void CancelConnect() => RunWith10SecTimeout(() =>\n        {\n            // iterating to try cancel connections on different stages\n            for (var i = 0; i < 10; i++)\n            {\n                var timeoutMs = 40 * i;\n                WriteLog($\"Testing cancel after {timeoutMs}ms\");\n                var client = CreateClient();\n                using (var cancellation = new CancellationTokenSource())\n                {\n                    cancellation.CancelAfter(timeoutMs);\n                    client.ConnectAsync(BrokerWorkingDir, cancellation.Token)\n                        .AsTask()\n                        .IgnoreCancellation(cancellation.Token)\n                        .ShouldCompleteIn(Timeout5Sec);\n                }\n            }\n        });\n\n        [Fact]\n        public void SendFromClientToServer()\n        {\n            RunWith5SecTimeout(async () =>\n            {\n                var testMsg = new byte[] {1, 2, 3, 4, 5};\n                IPooledBuffer receivedMsg;\n                WriteLog(\"Starting server\");\n                using (var server = CreateServer())\n                {\n                    await server.StartAsync();\n                    var serverConnectionTask = server.In.ReadAsync();\n                    WriteLog(\"Connecting client\");\n                    var client = CreateClient();\n                    using (var clientConnection = await client.ConnectAsync(BrokerWorkingDir))\n                    {\n                        WriteLog(\"Client connected\");                        \n                        await clientConnection.Out.WriteAsync(PooledBuffer.Get(testMsg));\n                        using (var serverConection = await serverConnectionTask)\n                        {\n                            receivedMsg = await serverConection.In.ReadAsync();\n                            WriteLog(\"Disposing server connection\");\n                        }\n                        WriteLog(\"Disposing client connection\");\n                    }\n                    WriteLog(\"Disposing server\");\n                }\n                receivedMsg.ToArray().ShouldBe(testMsg);\n            });\n        }\n\n        [Fact]\n        public void SendFromServerToClient()\n        {\n            RunWith5SecTimeout(async () =>\n            {\n                var testMsg = new byte[] { 1, 2, 3, 4, 5 };\n                IPooledBuffer receivedMsg;\n                WriteLog(\"Starting server\");\n                using (var server = CreateServer())\n                {\n                    await server.StartAsync();\n                    var serverConnectionTask = server.In.ReadAsync();\n                    WriteLog(\"Connecting client\");\n                    var client = CreateClient();\n                    using (var clientConnection = await client.ConnectAsync(BrokerWorkingDir))\n                    {\n                        WriteLog(\"Client connected\");                        \n                        using (var serverConection = await serverConnectionTask)\n                        {\n                            WriteLog(\"Server connected\");\n                            await serverConection.Out.WriteAsync(PooledBuffer.Get(testMsg));\n                            WriteLog(\"Message written on server side\");\n                            receivedMsg = await clientConnection.In.ReadAsync();\n                            WriteLog(\"Message received on client side\");\n                            WriteLog(\"Disposing server connection\");\n                        }\n                        WriteLog(\"Disposing client connection\");\n                    }\n                    WriteLog(\"Disposing server\");\n                }\n                receivedMsg.ToArray().ShouldBe(testMsg);\n            });\n        }\n\n        public static readonly IEnumerable<object[]> ConcurrentSendAndReceiveTestData = new object[][]\n        {\n            new object[]\n            {\n                new byte[][] { },\n                new byte[][] { }\n            },\n            new object[]\n            {\n                new byte[][] { new byte[] { 1, 2, 3 } },\n                new byte[][] { }\n            },\n            new object[]\n            {\n                new byte[][] { },\n                new byte[][] { new byte[] { 1, 2, 3 } },\n            },\n            new object[]\n            {\n                new byte[][] { new byte[] { 1, 2, 3 } },\n                new byte[][] { new byte[] { 1, 2, 3 } },\n            },\n            new object[]\n            {\n                new byte[][] { new byte[] { } },\n                new byte[][] { },\n            },\n            new object[]\n            {\n                new byte[][] { },\n                new byte[][] { new byte[] { } },\n            },\n            new object[]\n            {\n                new byte[][] { new byte[] { 1, 2, 3 }, new byte[] { }, new byte[] { 5, 4, 3, 2, 1 }},\n                new byte[][] { },\n            },\n            new object[]\n            {\n                new byte[][] { new byte[] { 1, 2, 3 }, new byte[] { }, new byte[] { 5, 4, 3, 2, 1 }},\n                new byte[][] { new byte[] { 1, 2, 3 }, new byte[] { }, new byte[] { 5, 4, 3, 2, 1 }},\n            },\n        };\n\n        [Theory]\n        [MemberData(nameof(ConcurrentSendAndReceiveTestData))]\n        public void ConcurrentSendAndReceive(byte[][] serverMessages, byte[][] clientMessages)\n        {\n            var serverRecevied = new List<byte[]>();\n            var clientReceived = new List<byte[]>();\n\n            var serverTask = TaskRunner.RunInBackground(async () =>\n            {\n                WriteLog($\"Starting server\");\n                var server = RegisterDisposable(CreateServer());\n                await server.StartAsync().ConfigureAwaitWithTimeout(Timeout5Sec);\n                WriteLog($\"Server started\");\n                using (var serverConnection = RegisterDisposable(await server.In.ReadAsync().ConfigureAwait(false)))\n                {\n                    var receiveTask = TaskRunner.RunInBackground(async () =>\n                    {\n                        while (true)\n                        {\n                            var msg = await serverConnection.In.TryReadAsync().ConfigureAwait(false);\n                            if (msg.HasValue)\n                            {\n                                WriteLog($\"Server received message of length {msg.Value.Count}\");\n                                serverRecevied.Add(msg.Value.ToArray());\n                            }\n                            else\n                            {\n                                WriteLog(\"Server receive completed\");\n                                break;\n                            }\n                        }\n                    });\n\n                    var sendTask = TaskRunner.RunInBackground(async () =>\n                    {\n                        foreach (var msg in serverMessages)\n                        {\n                            WriteLog($\"Server sending message of length {msg.Length}\");\n                            await serverConnection.Out.WriteAsync(PooledBuffer.Get(msg)).ConfigureAwait(false);\n                        }\n                        serverConnection.Out.TryComplete();\n                        WriteLog(\"Server send completed\");\n                    });\n\n                    await Task.WhenAll(sendTask, receiveTask, serverConnection.Completion).ConfigureAwait(false);\n\n                    WriteLog(\"Server completed\");\n                }\n            });\n\n            var clientTask = TaskRunner.RunInBackground(async () =>\n            {\n                try\n                {\n                    var clientFactory = CreateClient();\n                    WriteLog(\"Connecting client\");\n                    using (var connection =\n                        RegisterDisposable(await clientFactory.ConnectAsync(BrokerWorkingDir).ConfigureAwait(false)))\n                    {\n                        WriteLog($\"Client connected\");\n                        var receiveTask = TaskRunner.RunInBackground(async () =>\n                        {\n                            while (true)\n                            {\n                                var msg = await connection.In.TryReadAsync().ConfigureAwait(false);\n                                if (msg.HasValue)\n                                {\n                                    WriteLog($\"Client received message of length {msg.Value.Count}\");\n                                    clientReceived.Add(msg.Value.ToArray());\n                                }\n                                else\n                                {\n                                    WriteLog(\"Client receive completed\");\n                                    break;\n                                }\n                            }\n                        });\n\n                        var sendTask = TaskRunner.RunInBackground(async () =>\n                        {\n                            foreach (var msg in clientMessages)\n                            {\n                                WriteLog($\"Client sending message of length {msg.Length}\");\n                                await connection.Out.WriteAsync(PooledBuffer.Get(msg)).ConfigureAwait(false);\n                            }\n\n                            connection.Out.TryComplete();\n                            WriteLog(\"Client send completed\");\n                        });\n\n                        await Task.WhenAll(sendTask, receiveTask, connection.Completion).ConfigureAwait(false);\n\n                        WriteLog(\"Client completed\");\n                    }\n                }\n                catch (Exception ex)\n                {\n                    WriteLog(\"Client exception: \" + ex);\n                    throw;\n                }\n            });\n\n            Should.CompleteIn(Task.WhenAny(serverTask, clientTask).Unwrap(), TimeoutConstants.Timeout10Sec);            \n            Should.CompleteIn(Task.WhenAll(serverTask, clientTask), TimeoutConstants.Timeout10Sec);\n            WriteLog(\"All completed\");\n\n            serverRecevied.Count.ShouldBe(clientMessages.Length);\n            clientReceived.Count.ShouldBe(serverMessages.Length);\n            for (var i = 0; i < clientMessages.Length; i++)\n            {\n                serverRecevied[i].ShouldBe(clientMessages[i]);\n            }\n            for (var i = 0; i < serverMessages.Length; i++)\n            {\n                clientReceived[i].ShouldBe(serverMessages[i]);\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Client/Internal/WebSocketClientTransmissionConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Client.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Plexus.Processes;\n    using SuperSocket.ClientEngine;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using WebSocket4Net;\n\n    internal sealed class WebSocketClientTransmissionConnection : ProcessBase, ITransmissionConnection\n    {\n        private static readonly TimeSpan ConnectionTimeout = TimeoutConstants.Timeout20Sec;\n\n        private readonly ILogger _log;\n        private readonly WebSocket _webSocket;\n        private readonly WebSocketClientTransmissionReader _reader;\n        private readonly WebSocketClientTransmissionWriter _writer;\n        private readonly Promise _connectCompletion = new Promise();\n        private readonly Promise _disconnectCompletion = new Promise();\n\n        public WebSocketClientTransmissionConnection(string url)\n        {\n            _log = LogManager.GetLogger<WebSocketClientTransmissionConnection>(Id.ToString());\n            _disconnectCompletion.Task.PropagateCompletionToPromise(_connectCompletion);\n            _webSocket = new WebSocket(url.Replace(\"http://\", \"ws://\").Replace(\"https://\", \"wss://\"));\n            _webSocket.Opened += OnOpened;\n            _webSocket.Closed += OnClosed;\n            _webSocket.Error += OnError;\n            _webSocket.NoDelay = true;\n            _webSocket.EnableAutoSendPing = true;\n            _webSocket.AutoSendPingInterval = 5000;\n            _webSocket.ReceiveBufferSize = PooledBuffer.MaxSize;\n            _webSocket.Security.AllowNameMismatchCertificate = true;\n            _webSocket.Security.AllowCertificateChainErrors = true;\n            _webSocket.Security.AllowUnstrustedCertificate = true;\n\n            _reader = new WebSocketClientTransmissionReader(Id, _webSocket, CancellationToken);\n            _writer = new WebSocketClientTransmissionWriter(Id, _webSocket, CancellationToken);\n\n            Completion.LogCompletion(_log);\n\n            _log.Trace(\"Created\");\n        }\n\n        private void OnError(object sender, ErrorEventArgs e)\n        {\n            _log.Trace(\"OnError: {0}\", e.Exception.FormatTypeAndMessage());\n            Stop();\n            _disconnectCompletion.TryFail(e.Exception);\n        }\n\n        private void OnClosed(object sender, EventArgs e)\n        {\n            _log.Trace(\"OnClosed\");\n            Stop();\n            _disconnectCompletion.TryComplete();\n        }\n\n        private void OnOpened(object sender, EventArgs e)\n        {\n            _log.Trace(\"OnOpened\");\n            _connectCompletion.TryComplete();\n        }\n\n        public UniqueId Id { get; } = UniqueId.Generate();\n\n        public IReadableChannel<IPooledBuffer> In => _reader.In;\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _writer.Out;\n\n        public async Task ConnectAsync(CancellationToken cancellationToken)\n        {\n            using (var cancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            using (cancellation.Token.Register(Stop, false))\n            {\n                cancellation.CancelAfter(ConnectionTimeout);\n                try\n                {\n                    await StartAsync().ConfigureAwait(false);\n                }\n                finally\n                {\n                    cancellationToken.ThrowIfCancellationRequested();\n                }\n            }\n        }\n\n        public Task DisconnectAsync() => StopAsync();\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            try\n            {\n                if (CancellationToken.IsCancellationRequested)\n                {\n                    _webSocket.Dispose();\n                    return TaskConstants.Completed;\n                }\n                _log.Trace(\"Opening socket\");\n                _webSocket.Open();\n                await _connectCompletion.Task.WithCancellation(CancellationToken).ConfigureAwait(false);\n                _log.Trace(\"Connected\");\n                _writer.Start();\n                return ProcessAsync();\n            }\n            catch\n            {\n                _webSocket.Dispose();\n                throw;\n            }\n        }\n\n        private async Task ProcessAsync()\n        {\n            using (_webSocket)\n            {\n                try\n                {\n                    try\n                    {\n                        await Task.WhenAny(_writer.Completion, _reader.Completion).Unwrap().ConfigureAwait(false);\n                    }\n                    catch (Exception ex)\n                    {\n                        _writer.Out.TryTerminate(ex);\n                        _webSocket.Close();\n                        throw;\n                    }\n                    finally\n                    {\n                        await Task.WhenAll(_writer.Completion, _reader.Completion).ConfigureAwait(false);\n                    }\n                }\n                finally\n                {\n                    _webSocket.Close();\n                    await _disconnectCompletion.Task.ConfigureAwait(false);\n                }\n            }\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Client/Internal/WebSocketClientTransmissionReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.WebSockets.Client.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using SuperSocket.ClientEngine;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using WebSocket4Net;\n\n    internal sealed class WebSocketClientTransmissionReader\n    {\n        private readonly ILogger _log;\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly CancellationToken _cancellationToken;\n        private readonly WebSocket _webSocket;\n\n        public WebSocketClientTransmissionReader(\n            UniqueId id,\n            WebSocket webSocket, \n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<WebSocketClientTransmissionReader>(id.ToString());\n            _cancellationToken = cancellationToken;\n            _webSocket = webSocket;\n            _webSocket.DataReceived += OnDataReceived;\n            _webSocket.MessageReceived += OnMessageReceived;\n            _webSocket.Closed += OnClosed;\n            _webSocket.Error += OnError;\n\n            Completion = ProcessAsync();\n        }\n\n        public Task Completion { get; }\n\n        public IReadableChannel<IPooledBuffer> In => _buffer.In;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.Out.Completion.ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                _webSocket.DataReceived -= OnDataReceived;\n                _webSocket.MessageReceived -= OnMessageReceived;\n                _webSocket.Closed -= OnClosed;\n                _webSocket.Error -= OnError;\n            }\n        }        \n\n        private void OnError(object sender, ErrorEventArgs e)\n        {\n            _log.Trace(\"OnError: {0}\", e.Exception.FormatToString());\n            _buffer.Out.TryTerminate(e.Exception);\n        }\n\n        private void OnClosed(object sender, EventArgs e)\n        {\n            _log.Trace(\"OnClosed\");\n            _buffer.Out.TryTerminate();\n        }\n\n        private void OnMessageReceived(object sender, MessageReceivedEventArgs e)\n        {\n            if (string.Equals(e.Message, \"<END>\"))\n            {\n                _log.Trace(\"Received <END> message\");\n                _buffer.Out.TryComplete();\n            }\n            else\n            {\n                _log.Trace(\"OnMessageReceived: {0}\", e.Message);\n            }\n        }\n\n        private void OnDataReceived(object sender, DataReceivedEventArgs e)\n        {\n            _log.Trace(\"Received message of length={0}\", e.Data.Length);\n            var msg = PooledBuffer.Get(e.Data);\n            try\n            {\n                _buffer.Out.WriteAsync(msg, _cancellationToken).GetResult();\n            }\n            catch (Exception ex)\n            {                \n                _log.Trace(ex, \"Exception in OnDataReceived callback\");\n                msg.Dispose();\n                _buffer.Out.TryTerminate(ex);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Client/Internal/WebSocketClientTransmissionWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.WebSockets.Client.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Plexus.Processes;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using WebSocket4Net;\n\n    internal sealed class WebSocketClientTransmissionWriter : ProcessBase\n    {\n        private readonly ILogger _log;\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly CancellationToken _cancellationToken;\n        private readonly WebSocket _webSocket;\n\n        public WebSocketClientTransmissionWriter(\n            UniqueId id,\n            WebSocket webSocket,\n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<WebSocketClientTransmissionReader>(id.ToString());\n            _cancellationToken = cancellationToken;\n            _webSocket = webSocket;\n        }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _buffer.Out;\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            return Task.FromResult(ProcessAsync());\n        }        \n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.In.ConsumeAsync((Action<IPooledBuffer>) Send, _cancellationToken).ConfigureAwait(false);\n                _log.Trace(\"Sending <END> message\");\n                _webSocket.Send(\"<END>\");\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                throw;\n            }\n        }\n\n        private void Send(IPooledBuffer msg)\n        {\n            using (msg)\n            {\n                _log.Trace(\"Sending message of length {0}\", msg.Count);\n                _webSocket.Send(msg.Array, msg.Offset, msg.Count);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Client/Plexus.Interop.Transport.Transmission.WebSockets.Client.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"WebSocket4Net\" Version=\"0.15.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Utils\\Plexus.Interop.Transport.Utils.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Client/WebSocketTransmissionClient.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Client\n{\n    using Plexus.Interop.Transport.Transmission.WebSockets.Client.Internal;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public sealed class WebSocketTransmissionClient : ITransmissionClient\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<WebSocketTransmissionClient>();\n        private static readonly TimeSpan MaxServerInitializationTime = TimeoutConstants.Timeout1Min;\n\n        private readonly bool _secure;\n        private readonly string _serverName;\n\n        private WebSocketTransmissionClient(bool secure)\n        {\n            _secure = secure;\n            var protocol = secure ? \"wss\" : \"ws\";\n            _serverName = $\"{protocol}-v1\";\n        }\n\n        public static WebSocketTransmissionClient Create() => new WebSocketTransmissionClient(false);\n        public static WebSocketTransmissionClient CreateSecure() => new WebSocketTransmissionClient(true);\n\n        public async ValueTask<ITransmissionConnection> ConnectAsync(string brokerWorkingDir, CancellationToken cancellationToken = default)\n        {\n            var webSocketAddress = _secure\n                ? EnvironmentHelper.GetWebSocketSecureAddress()\n                : EnvironmentHelper.GetWebSocketAddress();\n\n            if (string.IsNullOrEmpty(webSocketAddress))\n            {\n                Log.Trace(\"Waiting initialization of server {0}\", _serverName);\n                var serverStateReader = new ServerStateReader(_serverName, brokerWorkingDir);\n                if (!await serverStateReader\n                    .WaitInitializationAsync(MaxServerInitializationTime, cancellationToken)\n                    .ConfigureAwait(false))\n                {\n                    throw new TimeoutException(\n                        $\"Timeout ({MaxServerInitializationTime.TotalSeconds}sec) while waiting for server \\\"{_serverName}\\\" availability\");\n                }\n\n                webSocketAddress = serverStateReader.ReadSetting(\"address\");\n            }\n\n            if (string.IsNullOrEmpty(webSocketAddress))\n            {\n                throw new InvalidOperationException(\"Cannot find url to connect\");\n            }\n\n            Log.Trace(\"Creating new connection to url {0}\", webSocketAddress);\n            var connection = new WebSocketClientTransmissionConnection(webSocketAddress);\n            await connection.ConnectAsync(cancellationToken).ConfigureAwait(false);\n            Log.Trace(\"Created new connection {0} to url {1}\", connection.Id, webSocketAddress);\n            return connection;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/Internal/WebSocketServerTransmissionConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using System;\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System.Net.WebSockets;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class WebSocketServerTransmissionConnection : ITransmissionConnection\n    {\n        private readonly ILogger _log;\n        private readonly WebSocket _webSocket;\n        private readonly CancellationTokenSource _cancellation;\n        private readonly WebSocketServerTransmissionWriter _writer;\n        private readonly WebSocketServerTransmissionReader _reader;\n        \n        public WebSocketServerTransmissionConnection(WebSocket webSocket, CancellationToken cancellationToken)\n        {\n            Id = UniqueId.Generate();\n            _log = LogManager.GetLogger<WebSocketServerTransmissionConnection>(Id.ToString());\n            _cancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);\n            _webSocket = webSocket;\n            _writer = new WebSocketServerTransmissionWriter(_webSocket, _cancellation.Token);\n            _reader = new WebSocketServerTransmissionReader(_webSocket, _cancellation.Token);\n            Completion = ProcessAsync().LogCompletion(_log);\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _writer.Out;\n\n        public IReadableChannel<IPooledBuffer> In => _reader.In;\n\n        public void Dispose()\n        {\n            _log.Trace(\"Disposing\");\n            DisconnectAsync().GetResult();\n        }\n\n        public async Task DisconnectAsync()\n        {\n            _log.Trace(\"Disconnecting\");\n            _cancellation.Cancel();\n            await Completion.IgnoreExceptions().ConfigureAwait(false);\n            _log.Trace(\"Disconnected\");\n        }\n\n        private async Task ProcessAsync()\n        {\n            using (_webSocket)\n            {\n                try\n                {\n                    await Task.WhenAny(_writer.Completion, _reader.Completion).Unwrap().ConfigureAwait(false);\n                }\n                catch\n                {\n                    _cancellation.Cancel();\n                }\n                await Task.WhenAll(_writer.Completion, _reader.Completion).IgnoreAnyCancellation().ConfigureAwait(false);\n                _log.Trace(\"Closing websocket\");\n                try\n                {\n                    await _webSocket\n                        .CloseOutputAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None)\n                        .ConfigureAwait(false);\n                }\n                catch (Exception ex)\n                {\n                    _log.Warn(ex, \"Exception while closing websocket\");\n                }\n                _log.Trace(\"Disposing websocket\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/Internal/WebSocketServerTransmissionReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.Net.WebSockets;\n    using System.Text;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class WebSocketServerTransmissionReader\n    {\n        private readonly ILogger _log;\n        private readonly WebSocket _webSocket;\n        private readonly IChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly byte[] _receiveBuffer = new byte[PooledBuffer.MaxSize];\n        private readonly CancellationToken _cancellationToken;\n\n        public WebSocketServerTransmissionReader(WebSocket webSocket, CancellationToken cancellationToken)\n        {\n            Id = UniqueId.Generate();\n            _log = LogManager.GetLogger<WebSocketServerTransmissionReader>(Id.ToString());\n            _webSocket = webSocket;\n            _cancellationToken = cancellationToken;\n            Completion = ProcessAsync();\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public IReadableChannel<IPooledBuffer> In => _buffer.In;\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                using (_cancellationToken.Register(() => _buffer.Out.TryTerminate(), false))\n                {\n                    var curMessageLength = 0;\n                    while (!_buffer.Out.IsCompleted())\n                    {\n                        _log.Trace(\"Awaiting next websocket message\");\n                        var result = await _webSocket\n                            .ReceiveAsync(\n                                new ArraySegment<byte>(\n                                    _receiveBuffer,\n                                    curMessageLength,\n                                    _receiveBuffer.Length - curMessageLength),\n                                _cancellationToken)\n                            .WithCancellation(_cancellationToken)\n                            .ConfigureAwait(false);\n                        _log.Trace(\"Received websocket message: {0}\", result.MessageType);\n                        curMessageLength += result.Count;\n                        if (!result.EndOfMessage)\n                        {\n                            continue;\n                        }\n\n                        await HandleReceiveMessageAsync(result, curMessageLength).ConfigureAwait(false);\n                        curMessageLength = 0;\n                    }\n\n                    _buffer.Out.TryComplete();\n                }\n            }\n            catch (Exception ex)\n            {\n                _log.Trace(\"Reading terminated: {0}\", ex.FormatTypeAndMessage());\n                _buffer.Out.TryTerminate(ex);\n                throw;\n            }\n            finally\n            {\n                await _buffer.Out.Completion.ConfigureAwait(false);\n            }\n            _log.Trace(\"Reading completed\");\n        }\n\n        private async Task HandleReceiveMessageAsync(WebSocketReceiveResult result, int curMessageLength)\n        {\n            switch (result.MessageType)\n            {\n                case WebSocketMessageType.Binary:\n                    _log.Trace(\"Received binary message of length {0}\", result.Count);\n                    var msg = PooledBuffer.Get(new ArraySegment<byte>(_receiveBuffer, 0, curMessageLength));\n                    try\n                    {\n                        await _buffer.Out.WriteAsync(msg, _cancellationToken).ConfigureAwait(false);\n                        _log.Trace(\"Received binary message of length {0} added to buffer\", result.Count);\n                    }\n                    catch\n                    {\n                        msg.Dispose();\n                        throw;\n                    }\n                    break;\n                case WebSocketMessageType.Text:\n                    _log.Trace(\"Received text of length {0}\", result.Count);\n                    var text = Encoding.UTF8.GetString(_receiveBuffer, 0, result.Count);\n                    if (string.Equals(text, \"<END>\"))\n                    {\n                        _log.Trace(\"Received <END> message\");\n                        _buffer.Out.TryComplete();\n                    }\n                    else if (string.Equals(text, \"<PING>\"))\n                    {\n                        _log.Trace(\"Received <PING> message\");\n                    }\n                    break;\n                case WebSocketMessageType.Close:\n                    _buffer.Out.TryTerminate();\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/Internal/WebSocketServerTransmissionWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using System;\n    using System.Net.WebSockets;\n    using System.Text;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class WebSocketServerTransmissionWriter\n    {\n        private static readonly byte[] EndMessage = Encoding.UTF8.GetBytes(\"<END>\");\n\n        private readonly ILogger _log;\n        private readonly WebSocket _webSocket;\n        private readonly IChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly CancellationToken _cancellationToken;\n\n        public WebSocketServerTransmissionWriter(WebSocket webSocket, CancellationToken cancellationToken)\n        {\n            Id = UniqueId.Generate();\n            _log = LogManager.GetLogger<WebSocketServerTransmissionWriter>(Id.ToString());\n            _webSocket = webSocket;\n            _cancellationToken = cancellationToken;\n            Completion = ProcessAsync();\n        }\n\n        public UniqueId Id { get; }\n\n        public Task Completion { get; }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _buffer.Out;\n\n        private async Task ProcessAsync()\n        {\n            using (_cancellationToken.Register(() => _buffer.Out.TryTerminate(), false))\n            {\n                try\n                {\n                    await _buffer.In.ConsumeAsync(SendAsync, _cancellationToken).ConfigureAwait(false);\n                    await _webSocket.SendAsync(\n                        new ArraySegment<byte>(EndMessage, 0, EndMessage.Length),\n                        WebSocketMessageType.Text,\n                        true,\n                        _cancellationToken);\n                }\n                catch (Exception ex)\n                {\n                    _log.Trace(\"Writing terminated: {0}\", ex.FormatTypeAndMessage());\n                    _buffer.Out.TryTerminate(ex);\n                    _buffer.In.DisposeBufferedItems();\n                    throw;\n                }\n                _log.Trace(\"Writing completed\");\n            }\n        }\n\n        private async Task SendAsync(IPooledBuffer msg)\n        {\n            using (msg)\n            {\n                await _webSocket\n                    .SendAsync(\n                        new ArraySegment<byte>(msg.Array, msg.Offset, msg.Count),\n                        WebSocketMessageType.Binary,\n                        true,\n                        _cancellationToken)\n                    .ConfigureAwait(false);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/Internal/WebSocketTransmissionServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using Microsoft.AspNetCore.Builder;\n    using Microsoft.AspNetCore.Hosting;\n    using Microsoft.AspNetCore.Hosting.Server.Features;\n    using Microsoft.AspNetCore.Http;\n    using Microsoft.AspNetCore.Server.Kestrel.Https;\n    using Microsoft.Extensions.DependencyInjection;\n    using Microsoft.Extensions.FileProviders;\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Plexus.Processes;\n    using System;\n    using System.IO;\n    using System.Linq;\n    using System.Net;\n    using System.Net.Sockets;\n    using System.Net.WebSockets;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n    using System.Text;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using IMsLoggerFactory = Microsoft.Extensions.Logging.ILoggerFactory;\n\n    internal sealed class WebSocketTransmissionServer : ProcessBase, ITransmissionServer\n    {\n        private const int AcceptedConnectionsBufferSize = 20;\n\n        private readonly X509Certificate2 _certificate = null;\n        private readonly SslProtocols _sslProtocols;\n\n        private IWebHost _host;\n        private readonly IChannel<ITransmissionConnection> _buffer = new BufferedChannel<ITransmissionConnection>(AcceptedConnectionsBufferSize);\n        private readonly IServerStateWriter _stateWriter;\n        private readonly WebSocketTransmissionServerOptions _options;\n        private readonly string _protocol;\n\n        private WebSocketTransmissionServer(WebSocketTransmissionServerOptions options, string protocol)\n        {\n            _options = options;\n            _protocol = protocol;\n            var serverName = $\"{protocol}-v1\";\n            _stateWriter = new ServerStateWriter(serverName, _options.WorkingDir);\n            _buffer.Out.PropagateCompletionFrom(Completion);\n        }\n\n        public WebSocketTransmissionServer(WebSocketTransmissionServerOptions options)\n            : this(options, \"ws\")\n        {\n        }\n\n        public WebSocketTransmissionServer(WebSocketTransmissionServerOptions options, X509Certificate2 certificate, SslProtocols sslProtocols)\n            : this(options, \"wss\")\n        {\n            _certificate = certificate;\n            _sslProtocols = sslProtocols;\n        }\n\n        private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);\n\n        protected override ILogger Log { get; } = LogManager.GetLogger<WebSocketTransmissionServer>();\n\n        public IReadableChannel<ITransmissionConnection> In => _buffer.In;\n\n        public async Task<Task> AcceptConnectionAsync(WebSocket websocket)\n        {\n            var connection = new WebSocketServerTransmissionConnection(websocket, CancellationToken);\n            await _buffer.Out.WriteAsync(connection, CancellationToken).ConfigureAwait(false);\n            Log.Trace(\"Websocket connection accepted\");\n            return connection.Completion;\n        }\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            Log.Trace(\"Starting\");\n            using (_stateWriter)\n            {\n                await Task.Factory\n                    .StartNew(MainThreadAsync, TaskCreationOptions.LongRunning)\n                    .Unwrap()\n                    .ConfigureAwait(false);\n            }\n            return StartCompletion;\n        }\n\n        public void OnListeningStarted()\n        {\n            var feature = _host.ServerFeatures.Get<IServerAddressesFeature>();\n            var url = feature.Addresses.First();\n            _stateWriter.Write(\"address\", url.Replace(\"http://\", \"ws://\").Replace(\"https://\", \"wss://\"));\n            Log.Info(\"Websocket server started: {0}\", url);\n            _stateWriter.SignalInitialized();\n            SetStartCompleted();\n        }\n\n        private async Task MainThreadAsync()\n        {\n            Log.Trace(\"Resolving localhost url\");\n            var hostEntry = Dns.GetHostEntryAsync(\"localhost\").GetResult();\n            var localhostIp = hostEntry.AddressList.First(addr => addr.AddressFamily == AddressFamily.InterNetwork);\n            var port = (int)_options.Port;\n            _host = new WebHostBuilder()\n                .UseKestrel(serverOptions =>\n                {\n                    if (_certificate != null)\n                        serverOptions.Listen(localhostIp, port, o => o.UseHttps(new HttpsConnectionAdapterOptions\n                        {\n                            ServerCertificate = _certificate,\n                            SslProtocols = _sslProtocols\n                        }));\n                    else\n                        serverOptions.Listen(localhostIp, port);\n                })\n                .SuppressStatusMessages(true)\n                .UseContentRoot(Directory.GetCurrentDirectory())\n                .Configure(Configure)\n                .Build();\n\n            Log.Trace($\"Starting server host: {_protocol}://{localhostIp}:{port}\");\n            await _host.RunAsync(CancellationToken).ConfigureAwait(false);\n        }\n\n        private void Configure(IApplicationBuilder app)\n        {\n            Log.Debug(\"Configure\");\n\n            var loggerFactory = app.ApplicationServices.GetRequiredService<IMsLoggerFactory>();\n\n            LogManager.ConfigureLogging(loggerFactory);\n\n            var lifetime = app.ApplicationServices.GetRequiredService<IApplicationLifetime>();\n\n            lifetime.ApplicationStarted.Register(OnListeningStarted, false);\n\n            app.UseWebSockets(new WebSocketOptions\n            {\n                KeepAliveInterval = TimeSpan.FromSeconds(5),\n                ReceiveBufferSize = PooledBuffer.MaxSize\n            });\n\n            foreach (var pair in _options.StaticFileMappings)\n            {\n                if (!Directory.Exists(pair.Value))\n                {\n                    continue;\n                }\n\n                app.UseStaticFiles(new StaticFileOptions\n                {\n                    RequestPath = pair.Key,\n                    FileProvider = new PhysicalFileProvider(pair.Value)\n                });\n            }\n\n            app.Use(async (context, next) =>\n            {\n                if (context.WebSockets.IsWebSocketRequest)\n                {\n                    var urlPath = context.Request.Path.ToString().TrimEnd('/');\n                    if (_options.StaticFileMappings.TryGetValue(urlPath, out var physicalPath))\n                    {\n                        if (File.Exists(physicalPath))\n                        {\n                            using (var webSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false))\n                            {\n                                using (var stream = File.Open(physicalPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n                                using (var streamReader = new StreamReader(stream))\n                                {\n                                    var bytes = Encoding.UTF8.GetBytes(\n                                        await streamReader.ReadToEndAsync().ConfigureAwait(false));\n                                    await webSocket\n                                        .SendAsync(\n                                            new ArraySegment<byte>(bytes),\n                                            WebSocketMessageType.Text,\n                                            true,\n                                            CancellationToken.None)\n                                        .ConfigureAwait(false);\n                                }\n\n                                await webSocket\n                                    .CloseAsync(\n                                        WebSocketCloseStatus.NormalClosure,\n                                        \"Normal Close\",\n                                        CancellationToken.None)\n                                    .ConfigureAwait(false);\n                            }\n\n                            return;\n                        }\n                    }\n\n                    if (string.IsNullOrEmpty(urlPath))\n                    {\n                        try\n                        {\n                            Log.Trace(\"Websocket connection received\");\n                            var connectionTask = await AcceptWebsocketConnectionAsync(context).ConfigureAwait(false);\n                            await connectionTask.ConfigureAwait(false);\n                            Log.Trace(\"Websocket connection completed\");\n                        }\n                        catch (Exception ex)\n                        {\n                            Log.Trace(\"Websocket connection terminated with exception: {0}\", ex.FormatTypeAndMessage());\n                            throw;\n                        }\n\n                        return;\n                    }\n\n                    Log.Trace(\"Unknown websocket request received: {0}\", context.Request.Path);\n                }\n                else\n                {\n                    Log.Trace(\"Unknown request received: {0}\", context.Request.Path);\n                }\n                await next().ConfigureAwait(false);\n            });\n        }\n\n        private async Task<Task> AcceptWebsocketConnectionAsync(HttpContext context)\n        {\n            Task connectionTask;\n            await _semaphore.WaitAsync().ConfigureAwait(false);\n            try\n            {\n                Log.Trace(\"Accepting websocket connection\");\n                var webSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);\n                connectionTask = await AcceptConnectionAsync(webSocket).ConfigureAwait(false);\n                Log.Trace(\"Websocket connection accepted\");\n            }\n            finally\n            {\n                _semaphore.Release();\n            }\n            return connectionTask;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/Plexus.Interop.Transport.Transmission.WebSockets.Server.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <!--\n    HACK: When build only for net4 we don't need this project.\n    Excluded all files from this project when build only for net4 to avoid problems with netstandard dependencies.\n  -->\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' == ''\">netstandard2.0</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <PackageReference Include=\"Microsoft.AspNetCore.Diagnostics\" Version=\"2.2.0\" />\n    <PackageReference Include=\"Microsoft.AspNetCore.Server.Kestrel\" Version=\"2.2.0\" />\n    <PackageReference Include=\"Microsoft.AspNetCore.StaticFiles\" Version=\"2.2.0\" />\n    <PackageReference Include=\"Microsoft.AspNetCore.WebSockets\" Version=\"2.2.1\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\"'$(NET4_ONLY)' == ''\">\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Utils\\Plexus.Interop.Transport.Utils.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\"'$(NET4_ONLY)' != ''\">\n    <Compile Remove=\"**/*cs\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/WebSocketTransmissionServerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Transmission.WebSockets.Server\n{\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n\n    public sealed class WebSocketTransmissionServerFactory\n    {\n        public static WebSocketTransmissionServerFactory Instance = new WebSocketTransmissionServerFactory();\n\n        public ITransmissionServer Create(WebSocketTransmissionServerOptions options)\n        {\n            return new WebSocketTransmissionServer(options);\n        }\n\n        public ITransmissionServer CreateSecure(WebSocketTransmissionServerOptions options, X509Certificate2 certificate, SslProtocols sslProtocols)\n        {\n            return new WebSocketTransmissionServer(options, certificate, sslProtocols);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server/WebSocketTransmissionServerOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server\n{\n    using System.Collections.Generic;\n    using System.Linq;\n\n    public sealed class WebSocketTransmissionServerOptions\n    {\n        public WebSocketTransmissionServerOptions(\n            string workingDir,\n            uint port = 0, \n            IReadOnlyDictionary<string, string> staticFileMappings = null)\n        {\n            WorkingDir = workingDir;\n            Port = port;\n            StaticFileMappings = staticFileMappings != null\n                ? staticFileMappings.ToDictionary(x => x.Key, y => y.Value)\n                : new Dictionary<string, string>();\n        }\n\n        public string WorkingDir { get; }\n\n        public uint Port { get; }\n\n        public IReadOnlyDictionary<string, string> StaticFileMappings { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/Internal/WebSocketServerTransmissionConnection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using global::Fleck;\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Plexus.Processes;\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class WebSocketServerTransmissionConnection : ProcessBase, ITransmissionConnection\n    {\n        private static readonly TimeSpan ConnectionTimeout = TimeoutConstants.Timeout5Sec;\n        private static readonly TimeSpan PingTimeout = TimeoutConstants.Timeout5Sec;\n        private static readonly byte[] EmptyMessage = new byte[0];\n\n        private readonly ILogger _log;\n        private readonly IWebSocketConnection _webSocket;\n        private readonly WebSocketServerTransmissionReader _reader;\n        private readonly WebSocketServerTransmissionWriter _writer;\n        private readonly Promise _connectCompletion = new Promise();\n        private readonly Promise _disconnectCompletion = new Promise();\n\n        protected override ILogger Log => _log;\n\n        public WebSocketServerTransmissionConnection(IWebSocketConnection websocket)\n        {            \n            _log = LogManager.GetLogger<WebSocketServerTransmissionConnection>(Id.ToString());\n            _webSocket = websocket;\n            _disconnectCompletion.Task.PropagateCompletionToPromise(_connectCompletion);\n\n            _reader = new WebSocketServerTransmissionReader(Id, _webSocket, CancellationToken);\n            _writer = new WebSocketServerTransmissionWriter(Id, _webSocket, CancellationToken);\n\n            _webSocket.OnOpen += OnOpened;\n            _webSocket.OnClose += OnClosed;\n            _webSocket.OnError += OnError;\n            _webSocket.OnPing += OnPing;\n            _webSocket.OnPong += OnPong;\n\n            Completion.LogCompletion(_log);\n\n            _log.Trace(\"Created\");\n        }\n\n        private void OnPong(byte[] obj)\n        {\n            _log.Trace(\"Pong received\");\n        }\n\n        private void OnPing(byte[] obj)\n        {\n            _log.Trace(\"Ping received\");\n            TaskRunner.RunInBackground(() => _webSocket.SendPong(obj)).LogAndIgnoreExceptions(_log);\n        }\n\n        private void OnError(Exception e)\n        {\n            _log.Warn(\"OnError: {0}\", e.FormatTypeAndMessage());\n            _reader.OnError(e);\n            Stop();\n            _disconnectCompletion.TryFail(e);\n        }\n\n        private void OnClosed()\n        {\n            _log.Debug(\"OnClosed\");\n            _reader.OnClose();\n            Stop();\n            _disconnectCompletion.TryComplete();\n        }\n\n        private void OnOpened()\n        {\n            _log.Debug(\"OnOpened\");\n            _connectCompletion.TryComplete();\n        }\n\n        public UniqueId Id { get; } = UniqueId.Generate();\n\n        public IReadableChannel<IPooledBuffer> In => _reader.In;\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _writer.Out;\n\n        public async Task ConnectAsync(CancellationToken cancellationToken)\n        {\n            using (var cancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            using (cancellation.Token.Register(Stop, false))\n            {\n                cancellation.CancelAfter(ConnectionTimeout);\n                try\n                {\n                    await StartAsync().ConfigureAwait(false);\n                }\n                finally\n                {\n                    cancellationToken.ThrowIfCancellationRequested();\n                }\n            }\n        }\n\n        public Task DisconnectAsync() => StopAsync();\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            try\n            {\n                if (CancellationToken.IsCancellationRequested)\n                {\n                    _webSocket.Close();\n                    return Task.FromResult(TaskConstants.Completed);\n                }        \n                await _connectCompletion.Task.WithCancellation(CancellationToken).ConfigureAwait(false);\n                StartPinging();\n                _writer.Start();\n                _log.Trace(\"Connected\");\n                return ProcessAsync();\n            }\n            catch\n            {\n                _webSocket.Close();\n                throw;\n            }\n        }\n\n        private void StartPinging()\n        {\n            TaskRunner.RunInBackground(async () =>\n            {\n                _log.Info(\"Starting ping loop\");\n                try\n                {\n                    while (!CancellationToken.IsCancellationRequested)\n                    {\n                        _log.Trace(\"Sending ping\");\n                        await _webSocket.SendPing(EmptyMessage);\n                        _log.Trace(\"Ping sent\");\n                        await Task.Delay(PingTimeout, CancellationToken);\n                    }\n                }\n                catch (OperationCanceledException) when (CancellationToken.IsCancellationRequested)\n                {                    \n                }\n                catch (Exception ex)\n                {\n                    _log.Error(ex, \"Ping loop terminated because of the exception\");\n                }\n                _log.Info(\"Ping loop finished\");\n            });\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                try\n                {\n                    await Task.WhenAny(_writer.Completion, _reader.Completion).Unwrap().ConfigureAwait(false);\n                }\n                catch (Exception ex)\n                {\n                    _writer.Out.TryTerminate(ex);\n                    _webSocket.Close();\n                    throw;\n                }\n                finally\n                {\n                    await Task.WhenAll(_writer.Completion, _reader.Completion).ConfigureAwait(false);\n                }\n            }\n            finally\n            {                \n                await _disconnectCompletion.Task.ConfigureAwait(false);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/Internal/WebSocketServerTransmissionReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using global::Fleck;\n    using Plexus.Channels;\n    using Plexus.Pools;\n\n    internal sealed class WebSocketServerTransmissionReader\n    {\n        private readonly ILogger _log;\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly CancellationToken _cancellationToken;\n        private readonly IWebSocketConnection _webSocket;\n\n        public WebSocketServerTransmissionReader(\n            UniqueId id,\n            IWebSocketConnection webSocket, \n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<WebSocketServerTransmissionReader>(id.ToString());\n            _cancellationToken = cancellationToken;\n            _webSocket = webSocket;\n            _webSocket.OnBinary += OnDataReceived;\n            _webSocket.OnMessage += OnMessageReceived;\n\n            Completion = ProcessAsync();\n        }\n\n        public Task Completion { get; }\n\n        public IReadableChannel<IPooledBuffer> In => _buffer.In;\n\n        public void OnClose()\n        {\n            _log.Debug(\"OnClose\");\n            _buffer.Out.TryComplete();\n        }\n\n        public void OnError(Exception ex)\n        {\n            _log.Debug(\"OnError \" + ex.GetType() + \": \" + ex.Message);\n            _buffer.Out.TryTerminate(ex);\n        }\n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.Out.Completion.ConfigureAwait(false);\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.DisposeBufferedItems();\n                throw;\n            }\n            finally\n            {\n                _webSocket.OnBinary -= OnDataReceived;\n                _webSocket.OnMessage -= OnMessageReceived;\n            }\n        }        \n\n        private void OnMessageReceived(string message)\n        {\n            if (string.Equals(message, \"<END>\"))\n            {\n                _log.Trace(\"Received <END> message\");\n                _buffer.Out.TryComplete();\n            }\n            else\n            {\n                _log.Trace(\"OnMessageReceived: {0}\", message);\n            }\n        }\n\n        private void OnDataReceived(byte[] data)\n        {\n            _log.Trace(\"Received message of length={0}\", data.Length);\n            var msg = PooledBuffer.Get(data);\n            try\n            {\n                _buffer.Out.WriteAsync(msg, _cancellationToken).GetResult();\n            }\n            catch (Exception ex)\n            {                \n                _log.Trace(ex, \"Exception in OnDataReceived callback\");\n                msg.Dispose();\n                _buffer.Out.TryTerminate(ex);\n            }\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/Internal/WebSocketServerTransmissionWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n namespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Fleck;\n    using Plexus.Channels;\n    using Plexus.Pools;\n    using Plexus.Processes;\n\n    internal sealed class WebSocketServerTransmissionWriter : ProcessBase\n    {\n        private readonly ILogger _log;\n        private readonly BufferedChannel<IPooledBuffer> _buffer = new BufferedChannel<IPooledBuffer>(3);\n        private readonly CancellationToken _cancellationToken;\n        private readonly IWebSocketConnection _webSocket;\n\n        public WebSocketServerTransmissionWriter(\n            UniqueId id,\n            IWebSocketConnection webSocket,\n            CancellationToken cancellationToken)\n        {\n            _log = LogManager.GetLogger<WebSocketServerTransmissionWriter>(id.ToString());\n            _cancellationToken = cancellationToken;\n            _webSocket = webSocket;\n        }\n\n        public ITerminatableWritableChannel<IPooledBuffer> Out => _buffer.Out;\n\n        protected override Task<Task> StartCoreAsync()\n        {\n            return Task.FromResult(ProcessAsync());\n        }        \n\n        private async Task ProcessAsync()\n        {\n            try\n            {\n                await _buffer.In.ConsumeAsync(SendAsync, _cancellationToken).ConfigureAwait(false);\n                _log.Trace(\"Sending <END> message\");\n                await _webSocket.Send(\"<END>\").ConfigureAwait(false);\n                _log.Trace(\"Sent <END> message\");\n            }\n            catch (Exception ex)\n            {\n                _buffer.Out.TryTerminate(ex);\n                _buffer.In.DisposeBufferedItems();\n                throw;\n            }\n        }\n\n        private async Task SendAsync(IPooledBuffer msg)\n        {\n            using (msg)\n            {\n                _log.Trace(\"Sending message of length {0}\", msg.Count);\n                await _webSocket.Send(msg.ToArray()).WithCancellation(_cancellationToken).ConfigureAwait(false);\n                _log.Trace(\"Sent message of length {0}\", msg.Count);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/Internal/WebSocketTransmissionServer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal\n{\n    using Fleck;\n    using Plexus.Channels;\n    using Plexus.Processes;\n    using System;\n    using System.IO;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n    using System.Threading.Tasks;\n\n    internal sealed class WebSocketTransmissionServer : ProcessBase, ITransmissionServer\n    {\n        private const int AcceptedConnectionsBufferSize = 20;\n\n        private readonly string _protocol = \"ws\";\n        private readonly X509Certificate2 _certificate = null;\n        private readonly SslProtocols _sslProtocols;\n\n        private readonly WebSocketTransmissionServerOptions _options;\n        private WebSocketServer _server;\n\n        private readonly IChannel<ITransmissionConnection> _buffer = new BufferedChannel<ITransmissionConnection>(AcceptedConnectionsBufferSize);\n        private readonly IServerStateWriter _stateWriter;\n\n        private WebSocketTransmissionServer(WebSocketTransmissionServerOptions options, string protocol)\n        {\n            _options = options;\n            _protocol = protocol;\n            var serverName = $\"{protocol}-v1\";\n            _stateWriter = new ServerStateWriter(serverName, _options.WorkingDir);\n            _buffer.Out.PropagateCompletionFrom(Completion);\n        }\n\n        public WebSocketTransmissionServer(WebSocketTransmissionServerOptions options)\n            : this(options, \"ws\")\n        {\n        }\n\n        public WebSocketTransmissionServer(WebSocketTransmissionServerOptions options, X509Certificate2 certificate, SslProtocols sslProtocols)\n            : this(options, \"wss\")\n        {\n            _certificate = certificate;\n            _sslProtocols = sslProtocols;\n        }\n\n        public IReadableChannel<ITransmissionConnection> In => _buffer.In;\n\n        protected override async Task<Task> StartCoreAsync()\n        {\n            FleckLog.Level = LogLevel.Debug;\n            FleckLog.LogAction = (lvl, msg, exc) =>\n            {\n                Log.Debug(exc, msg);\n            };\n            using (_stateWriter)\n            using (_server = CreateWebSocketServerWithRetry(_options.Port))\n            {\n                var address = $\"{_protocol}://{_server.ListenerSocket.LocalEndPoint}\";\n                _stateWriter.Write(\"address\", address);\n                _stateWriter.SignalInitialized();\n                SetStartCompleted();\n                Log.Info(\"WebSocket server started on {0}\", address);\n                await CancellationToken.ToAwaitable().AsTask().IgnoreAnyCancellation().ConfigureAwait(false);\n            }\n            return TaskConstants.Completed;\n        }\n\n        private WebSocketServer CreateWebSocketServerWithRetry(uint port)\n            => StartWebSocketServer($\"{_protocol}://127.0.0.1:{port}\", true)\n            ?? StartWebSocketServer($\"{_protocol}://127.0.0.1:{port}\", false)\n            ?? StartWebSocketServer($\"{_protocol}://localhost:{port}\", true)\n            ?? StartWebSocketServer($\"{_protocol}://localhost:{port}\", false)\n            ?? StartWebSocketServer($\"{_protocol}://[::1]:{port}\", true)\n            ?? StartWebSocketServer($\"{_protocol}://[::1]:{port}\", false)\n            ?? throw new InvalidOperationException(\"Failed to start websocket server\");\n\n        private WebSocketServer StartWebSocketServer(string url, bool supportDualStack)\n        {\n            var server = new WebSocketServer(url, supportDualStack);\n            try\n            {\n                server.RestartAfterListenError = true;\n                server.ListenerSocket.NoDelay = true;\n                if (_certificate != null)\n                {\n                    server.Certificate = _certificate;\n                    server.EnabledSslProtocols = _sslProtocols;\n                }\n                server.Start(OnSocketConnection);\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Exception while starting websocket server with url={0} and supportDualStack={1}\", url, supportDualStack);\n                try\n                {\n                    server.Dispose();\n                }\n                catch\n                {\n                    // skip\n                }\n                return null;\n            }\n            return server;\n        }\n\n        private void OnSocketConnection(IWebSocketConnection websocket)\n        {\n            Log.Debug(\"Handling websocket connection {0}: path={1}\", websocket.ConnectionInfo.Id, websocket.ConnectionInfo.Path);\n            var urlPath = websocket.ConnectionInfo.Path.TrimEnd('/');\n            if (string.IsNullOrEmpty(urlPath))\n            {\n                var connection = new WebSocketServerTransmissionConnection(websocket);\n                TaskRunner.RunInBackground(AcceptWebSocketConnectionAsync, connection).IgnoreAwait(Log);\n            }\n            else\n            {\n                var connectedCompletion = new Promise();\n                void OnOpened() => connectedCompletion.TryComplete();\n                void OnClosed() => connectedCompletion.TryFail(new Exception(\"Websocket unexpectedly closed\"));\n                void OnError(Exception ex) => connectedCompletion.TryFail(new Exception(\"Websocket exception occurred\", ex));\n                websocket.OnOpen = OnOpened;\n                websocket.OnClose = OnClosed;\n                websocket.OnError = OnError;\n                TaskRunner.RunInBackground(async () =>\n                {\n                    try\n                    {\n                        await connectedCompletion.Task;\n                    }\n                    finally\n                    {\n                        // ReSharper disable DelegateSubtraction\n                        websocket.OnOpen -= OnOpened;\n                        websocket.OnClose -= OnClosed;\n                        websocket.OnError -= OnError;\n                        // ReSharper restore DelegateSubtraction\n                    }\n                    await ReadFileAsync(websocket, urlPath);\n                }).IgnoreAwait(Log);\n            }\n        }\n\n        private async Task ReadFileAsync(IWebSocketConnection webSocket, string urlPath)\n        {\n            try\n            {\n                if (_options.StaticFileMappings.TryGetValue(urlPath, out var physicalPath) && File.Exists(physicalPath))\n                {\n                    using (var stream = File.Open(physicalPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n                    using (var streamReader = new StreamReader(stream))\n                    {\n                        await webSocket.Send(await streamReader.ReadToEndAsync()).ConfigureAwait(false);\n                    }\n                }\n                else\n                {\n                    webSocket.Close();\n                }\n            }\n            catch (Exception ex)\n            {\n                Log.Warn(ex, \"Exception while serving static file via websocket\");\n                webSocket.Close();\n            }\n        }\n\n        private async Task AcceptWebSocketConnectionAsync(object arg)\n        {\n            var connection = (WebSocketServerTransmissionConnection) arg;\n            try\n            {                \n                connection.Start();\n                using (CancellationToken.Register(connection.Stop))\n                {\n                    await _buffer.Out.WriteAsync(connection, CancellationToken).ConfigureAwait(false);\n                    Log.Debug(\"Websocket connection {0} accepted\", connection.Id);\n                    await connection.Completion.ConfigureAwait(false);\n                    Log.Debug(\"Websocket connection {0} completed\", connection.Id);\n                }\n            }\n            catch (Exception ex)\n            {                \n                Log.Warn(ex, \"Websocket connection {0} completed with exception\", connection.Id);\n                connection.Stop();\n            }\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck</AssemblyName>\n    <RootNamespace>Plexus.Interop.Transport.Transmission.WebSockets.Server</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Fleck\" Version=\"1.1.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Utils\\Plexus.Interop.Transport.Utils.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/WebSocketTransmissionServerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport.Transmission.WebSockets.Server\n{\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server.Internal;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n\n    public sealed class WebSocketTransmissionServerFactory\n    {\n        public static WebSocketTransmissionServerFactory Instance = new WebSocketTransmissionServerFactory();\n\n        public ITransmissionServer Create(WebSocketTransmissionServerOptions options)\n        {\n            return new WebSocketTransmissionServer(options);\n        }\n\n        public ITransmissionServer CreateSecure(WebSocketTransmissionServerOptions options, X509Certificate2 certificate, SslProtocols sslProtocols)\n        {\n            return new WebSocketTransmissionServer(options, certificate, sslProtocols);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck/WebSocketTransmissionServerOptions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets.Server\n{\n    using System.Collections.Generic;\n    using System.Linq;\n\n    public sealed class WebSocketTransmissionServerOptions\n    {\n        public WebSocketTransmissionServerOptions(\n            string workingDir,\n            uint port = 0, \n            IReadOnlyDictionary<string, string> staticFileMappings = null)\n        {\n            WorkingDir = workingDir;\n            Port = port;\n            StaticFileMappings = staticFileMappings != null\n                ? staticFileMappings.ToDictionary(x => x.Key, y => y.Value)\n                : new Dictionary<string, string>();\n        }\n\n        public string WorkingDir { get; }\n\n        public uint Port { get; }\n\n        public IReadOnlyDictionary<string, string> StaticFileMappings { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Tests/Plexus.Interop.Transport.Transmission.WebSockets.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n    <RootNamespace>Plexus.Interop.Transport.Transmission.WebSockets</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.Testing\\Plexus.Interop.Transport.Transmission.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Client\\Plexus.Interop.Transport.Transmission.WebSockets.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck.csproj\" Condition=\"'$(TargetFramework)' == 'net452'\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server\\Plexus.Interop.Transport.Transmission.WebSockets.Server.csproj\" Condition=\"'$(TargetFramework)' == 'netcoreapp2.1'\" />\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Content Include=\"..\\TestData\\test-cert.pfx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <ItemGroup>\n    <Service Include=\"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}\" />\n  </ItemGroup>\n\n  <Target Name=\"WorkaroundAppConfigPathTooLong\" BeforeTargets=\"GenerateBindingRedirects\">\n    <PropertyGroup>\n      <_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).config</_GenerateBindingRedirectsIntermediateAppConfig>\n    </PropertyGroup>\n  </Target>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Tests/WebSocketSecureTransmissionTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets\n{\n    using Plexus.Interop.Transport.Transmission.WebSockets.Client;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    [Collection(\"WebSockets\")]\n    public sealed class WebSocketSecureTransmissionTests : TransmissionTestsSuite\n    {\n        public WebSocketSecureTransmissionTests(ITestOutputHelper output) : base(output)\n        {\n        }\n\n        protected override ITransmissionServer CreateServer()\n        {\n            var cert = new X509Certificate2(\"test-cert.pfx\", \"god\");\n            return WebSocketTransmissionServerFactory.Instance.CreateSecure(new WebSocketTransmissionServerOptions(BrokerWorkingDir), cert, SslProtocols.None);\n        }\n\n        protected override ITransmissionClient CreateClient()\n        {\n            return WebSocketTransmissionClient.CreateSecure();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Tests/WebSocketTransmissionTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.Transmission.WebSockets\n{\n    using Plexus.Interop.Transport.Transmission.WebSockets.Client;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    [Collection(\"WebSockets\")]\n    public sealed class WebSocketTransmissionTests : TransmissionTestsSuite\n    {\n        public WebSocketTransmissionTests(ITestOutputHelper output) : base(output)\n        {\n        }\n\n        protected override ITransmissionServer CreateServer()\n        {\n            return WebSocketTransmissionServerFactory.Instance.Create(new WebSocketTransmissionServerOptions(BrokerWorkingDir));\n        }\n\n        protected override ITransmissionClient CreateClient()\n        {\n            return WebSocketTransmissionClient.Create();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Transmission.WebSockets.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true,\n  \"shadowCopy\": false\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/IServerStateReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public interface IServerStateReader\n    {\n        Task<bool> WaitInitializationAsync(TimeSpan timeout, CancellationToken cancellationToken = default(CancellationToken));\n\n        string ReadSetting(string key);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/IServerStateWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using System;\n\n    public interface IServerStateWriter : IDisposable\n    {\n        void SignalInitialized();\n\n        void Write(string key, string value);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/Plexus.Interop.Transport.Utils.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/ServerStateReader.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using System;\n    using System.Diagnostics;\n    using System.IO;\n    using System.Linq;\n    using System.Text;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    public sealed class ServerStateReader : IServerStateReader\n    {\n        private const string ReadyMarker = \"ready\";\n        private static readonly TimeSpan PollPeriod = TimeoutConstants.Timeout250Ms;        \n        private static readonly ILogger Log = LogManager.GetLogger<ServerStateReader>();\n\n        private readonly string _eventName;\n        private readonly string _settingsDir;\n        private readonly string _lockFilePath;\n\n        public ServerStateReader(string serverName, string brokerWorkingDir)\n        {\n            brokerWorkingDir = Path.GetFullPath(brokerWorkingDir ?? Directory.GetCurrentDirectory());\n            _eventName = ServerStateUtils.GetServerIntiializationEventName(serverName, brokerWorkingDir);\n            _settingsDir = ServerStateUtils.GetServerSettingsDirectory(serverName, brokerWorkingDir);\n            _lockFilePath = Path.Combine(_settingsDir, \"lock\");\n        }\n\n        public async Task<bool> WaitInitializationAsync(TimeSpan timeout, CancellationToken cancellationToken)\n        {\n            Log.Debug(\"Waiting initialization {0}\", _eventName);\n            using (var waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset, _eventName))\n            using (var cancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))\n            {\n                var waitHandleTimeout = WaitHandleTimeout(waitHandle, timeout, cancellation.Token);\n                var pollFileTimeout = PollFileTimeout(timeout, cancellation.Token);\n                var firstCompleted = await Task.WhenAny(waitHandleTimeout, pollFileTimeout).ConfigureAwait(false);\n                if (firstCompleted.GetResult())\n                {\n                    cancellation.Cancel();\n                    await Task.WhenAll(waitHandleTimeout.IgnoreExceptions(), pollFileTimeout.IgnoreExceptions());\n                    return true;\n                }\n                var allCompleted = await Task.WhenAll(waitHandleTimeout, pollFileTimeout).ConfigureAwait(false);\n                cancellationToken.ThrowIfCancellationRequested();\n                return allCompleted.Any(x => x);\n            }\n        }\n\n        public string ReadSetting(string key)\n        {\n            var file = Path.Combine(_settingsDir, key);\n            var repeat = 10;\n            while (!File.Exists(file) && repeat-- > 0)\n            {\n                Task.Delay(100).GetResult();\n            }\n            return File.Exists(file) ? File.ReadAllText(file, Encoding.UTF8) : null;\n        }\n\n        private async Task<bool> PollFileTimeout(TimeSpan timeout, CancellationToken cancellationToken)\n        {\n            var stopwatch = new Stopwatch();\n            stopwatch.Start();\n            while (!IsFileLocked(_lockFilePath) && stopwatch.Elapsed <= timeout)\n            {\n                await Task.Delay(PollPeriod, cancellationToken);\n            }\n            while (IsFileLocked(_lockFilePath) && stopwatch.Elapsed <= timeout && !IsReadyMarkerSet(_lockFilePath))\n            {\n                await Task.Delay(PollPeriod, cancellationToken);\n            }\n            return IsReadyMarkerSet(_lockFilePath) && stopwatch.Elapsed <= timeout;\n        }\n\n        private static bool IsReadyMarkerSet(string path)\n        {\n            return string.Equals(ReadyMarker, TryReadFromFile(path), StringComparison.InvariantCultureIgnoreCase);\n        }\n\n        private static string TryReadFromFile(string path)\n        {\n            try\n            {\n                using (var reader =\n                    new StreamReader(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite),\n                        Encoding.UTF8))\n                {\n                    return reader.ReadToEnd();\n                }\n            }\n            catch\n            {\n                return null;\n            }\n        }\n\n        private static bool IsFileLocked(string path)\n        {\n            try\n            {\n                using (File.Open(path, FileMode.Open, FileAccess.ReadWrite, FileShare.Read))\n                {\n                }\n            }\n            catch (IOException)\n            {\n                return true;\n            }\n            catch\n            {\n                // file does not exist yet or cannot be open by some other reason\n            }\n            return false;\n        }\n\n        private static Task<bool> WaitHandleTimeout(WaitHandle handle, TimeSpan timeout, CancellationToken cancellationToken)\n        {\n            return TaskRunner.RunInBackground(() =>\n            {\n                var alreadySignaled = handle.WaitOne(0);\n                if (alreadySignaled)\n                {\n                    return true;\n                }\n\n                if (timeout == TimeSpan.Zero)\n                {\n                    return false;\n                }\n\n                var completedIndex = WaitHandle.WaitAny(new[] {handle, cancellationToken.WaitHandle}, timeout);\n                cancellationToken.ThrowIfCancellationRequested();\n                return completedIndex == 0;\n            }, cancellationToken);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/ServerStateUtils.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport\n{\n    using System.IO;\n\n    internal static class ServerStateUtils\n    {\n        public static string GetServerSettingsDirectory(string serverName, string brokerWorkingDir)\n        {\n            return Path.Combine(brokerWorkingDir, \"servers\", serverName);\n        }\n\n        public static string GetServerIntiializationEventName(string serverName, string brokerWorkingDir)\n        {\n            return \"plexus-interop-server-\" + GetServerSettingsDirectory(serverName, brokerWorkingDir).Replace(Path.DirectorySeparatorChar, ':');\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.Utils/ServerStateWriter.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Interop.Transport\n{\n    using System.IO;\n    using System.Text;\n    using System.Threading;\n\n    public sealed class ServerStateWriter : IServerStateWriter\n    {\n        private static readonly byte[] ReadyBytes = Encoding.UTF8.GetBytes(\"ready\");\n\n        private static readonly ILogger Log = LogManager.GetLogger<ServerStateWriter>();\n\n        private int _disposed;\n        private readonly DirectoryInfo _settingsDir;\n        private readonly EventWaitHandle _waitHandle;\n        private readonly string _eventName;\n        private readonly FileStream _lockFileStream;\n\n        public ServerStateWriter(string serverName, string workingDir = null)\n        {\n            workingDir = Path.GetFullPath(workingDir ?? Directory.GetCurrentDirectory());\n            _eventName = ServerStateUtils.GetServerIntiializationEventName(serverName, workingDir);\n            _settingsDir = new DirectoryInfo(ServerStateUtils.GetServerSettingsDirectory(serverName, workingDir));\n            var lockFilePath = Path.Combine(_settingsDir.FullName, \"lock\");\n            _settingsDir.Create();\n            _lockFileStream = File.Open(lockFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);\n            _lockFileStream.SetLength(0);            \n            _lockFileStream.Flush(true);\n            _waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset, _eventName);\n            _waitHandle.Reset();\n            Cleanup();\n        }\n\n        public void SignalInitialized()\n        {\n            Log.Debug(\"Signalling initialization {0}\", _eventName);\n            _waitHandle.Set();\n            _lockFileStream.Write(ReadyBytes, 0, ReadyBytes.Length);\n            _lockFileStream.Flush(true);\n        }\n\n        public void Write(string key, string value)\n        {\n            _settingsDir.Create();\n            var filePath = Path.Combine(_settingsDir.FullName, key);\n            using (var fileStream =\n                new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite))\n            {\n                var bytes = Encoding.UTF8.GetBytes(value);\n                fileStream.SetLength(0);\n                fileStream.Write(bytes, 0, bytes.Length);\n                fileStream.Flush();\n                fileStream.Close();\n            }\n        }\n\n        public void Dispose()\n        {\n            if (Interlocked.Exchange(ref _disposed, 1) == 1)\n            {\n                return;\n            }\n            _waitHandle.Reset();\n            _waitHandle.Dispose();\n            _lockFileStream.Dispose();\n            Cleanup();\n        }\n\n        private void Cleanup()\n        {\n            try\n            {\n                if (_settingsDir.Exists)\n                {\n                    _settingsDir.Delete(true);\n                }\n            }\n            catch\n            {\n                // ignore\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.WebSockets.Tests/Plexus.Interop.Transport.WebSockets.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus.Interop.Transport.WebSockets</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Testing\\Plexus.Interop.Transport.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Client\\Plexus.Interop.Transport.Transmission.WebSockets.Client.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck.csproj\" Condition=\"'$(TargetFramework)' == 'net452'\" />\n    <ProjectReference Include=\"..\\Plexus.Interop.Transport.Transmission.WebSockets.Server\\Plexus.Interop.Transport.Transmission.WebSockets.Server.csproj\" Condition=\"'$(TargetFramework)' == 'netcoreapp2.1'\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Content Include=\"..\\TestData\\test-cert.pfx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Update=\"xunit.runner.json\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.WebSockets.Tests/WebSocketSecureTransportTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.WebSockets\n{\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Client;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server;\n    using System.Security.Authentication;\n    using System.Security.Cryptography.X509Certificates;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    [Collection(\"WebSockets\")]\n    public sealed class WebSocketSecureTransportTests : TransportTestsSuite\n    {\n        public WebSocketSecureTransportTests(ITestOutputHelper output) : base(output)\n        {\n            var cert = new X509Certificate2(\"test-cert.pfx\", \"god\");\n            Server = RegisterDisposable(TransportServerFactory.Instance.Create(\n                TransportType.Wss,\n                WebSocketTransmissionServerFactory.Instance.CreateSecure(new WebSocketTransmissionServerOptions(BrokerWorkingDir), cert, SslProtocols.None),\n                new ProtobufTransportProtocolSerializationProvider()));\n            Client = TransportClientFactory.Instance.Create(\n                TransportType.Wss,\n                WebSocketTransmissionClient.CreateSecure(),\n                new ProtobufTransportProtocolSerializationProvider());\n        }\n\n        protected override ITransportServer Server { get; }\n\n        protected override ITransportClient Client { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.WebSockets.Tests/WebSocketTransportTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Interop.Transport.WebSockets\n{\n    using Plexus.Interop.Transport.Protocol.Protobuf;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Client;\n    using Plexus.Interop.Transport.Transmission.WebSockets.Server;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    [Collection(\"WebSockets\")]\n    public sealed class WebSocketTransportTests : TransportTestsSuite\n    {\n        public WebSocketTransportTests(ITestOutputHelper output) : base(output)\n        {\n            Server = RegisterDisposable(TransportServerFactory.Instance.Create(\n                TransportType.Ws,\n                WebSocketTransmissionServerFactory.Instance.Create(new WebSocketTransmissionServerOptions(BrokerWorkingDir)),\n                new ProtobufTransportProtocolSerializationProvider()));\n            Client = TransportClientFactory.Instance.Create(\n                TransportType.Ws,\n                WebSocketTransmissionClient.Create(),\n                new ProtobufTransportProtocolSerializationProvider());\n        }\n\n        protected override ITransportServer Server { get; }\n\n        protected override ITransportClient Client { get; }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.Transport.WebSockets.Tests/xunit.runner.json",
    "content": "﻿{\n  \"longRunningTestSeconds\": 10,\n  \"parallelizeAssembly\": false,\n  \"parallelizeTestCollections\": false,\n  \"preEnumerateTheories\": true,\n  \"diagnosticMessages\": true\n}"
  },
  {
    "path": "desktop/src/Plexus.Interop.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30709.132\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{21157EE9-F291-48DA-B411-731A21AAF6AD}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\README.txt = ..\\README.txt\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Transport\", \"Transport\", \"{D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Utils\", \"Plexus.Utils\\Plexus.Utils.csproj\", \"{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport\", \"Plexus.Interop.Transport\\Plexus.Interop.Transport.csproj\", \"{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Utils.Testing\", \"Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\", \"{B089A539-9AA0-4156-B8E7-CB44564EBFD1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Contracts\", \"Plexus.Interop.Transport.Contracts\\Plexus.Interop.Transport.Contracts.csproj\", \"{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Common.Contracts\", \"Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\", \"{C439A91C-B618-44A4-A14C-1672094BFED8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Logging\", \"Plexus.Logging\\Plexus.Logging.csproj\", \"{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Logging.NLog\", \"Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\", \"{A5D769B2-08A3-4FB6-8808-52E6AC23665C}\"\nEndProject\nProject(\"{D954291E-2A0B-460D-934E-DC6B0785DB48}\") = \"Plexus.Utils.Testing.Shared\", \"Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.shproj\", \"{ADA01827-8218-4182-AD83-A25FC36DDD95}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Utils.Tests\", \"Plexus.Utils.Tests\\Plexus.Utils.Tests.csproj\", \"{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Streams\", \"Plexus.Interop.Transport.Transmission.Streams\\Plexus.Interop.Transport.Transmission.Streams.csproj\", \"{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Contracts\", \"Plexus.Interop.Transport.Transmission.Contracts\\Plexus.Interop.Transport.Transmission.Contracts.csproj\", \"{76A57645-A17F-4211-8FE9-FA0C2A321D35}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Protocol.Contracts\", \"Plexus.Interop.Transport.Protocol.Contracts\\Plexus.Interop.Transport.Protocol.Contracts.csproj\", \"{09DB94B2-0FD8-429B-9073-936130C4FA03}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Protocol.Protobuf\", \"Plexus.Interop.Transport.Protocol.Protobuf\\Plexus.Interop.Transport.Protocol.Protobuf.csproj\", \"{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Pipes\", \"Plexus.Interop.Transport.Transmission.Pipes\\Plexus.Interop.Transport.Transmission.Pipes.csproj\", \"{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Pipes.Tests\", \"Plexus.Interop.Transport.Transmission.Pipes.Tests\\Plexus.Interop.Transport.Transmission.Pipes.Tests.csproj\", \"{BCECDE18-E331-445C-A501-19B9B7D1BB3B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Protocol\", \"Plexus.Interop.Transport.Protocol\\Plexus.Interop.Transport.Protocol.csproj\", \"{C1BE90CA-7F16-470A-BF71-5B43F845DE64}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Protocol.Tests\", \"Plexus.Interop.Transport.Protocol.Tests\\Plexus.Interop.Transport.Protocol.Tests.csproj\", \"{215B0F69-FAB6-402F-AEE7-7A68076605E6}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.WebSockets.Server\", \"Plexus.Interop.Transport.Transmission.WebSockets.Server\\Plexus.Interop.Transport.Transmission.WebSockets.Server.csproj\", \"{15477A03-DAEF-4D18-9915-F4AF2126D423}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.WebSockets.Client\", \"Plexus.Interop.Transport.Transmission.WebSockets.Client\\Plexus.Interop.Transport.Transmission.WebSockets.Client.csproj\", \"{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.WebSockets.Tests\", \"Plexus.Interop.Transport.Transmission.WebSockets.Tests\\Plexus.Interop.Transport.Transmission.WebSockets.Tests.csproj\", \"{8C1CF325-B2E8-44EB-930D-210ABCFE505F}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.Testing\", \"Plexus.Interop.Transport.Transmission.Testing\\Plexus.Interop.Transport.Transmission.Testing.csproj\", \"{B1301BA6-9693-41B7-98E4-D879299CA781}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol.Protobuf\", \"Plexus.Interop.Protocol.Protobuf\\Plexus.Interop.Protocol.Protobuf.csproj\", \"{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Broker\", \"Plexus.Interop.Broker\\Plexus.Interop.Broker.csproj\", \"{1E084712-9A9F-4635-9B47-E4BAD924175B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol.Contracts\", \"Plexus.Interop.Protocol.Contracts\\Plexus.Interop.Protocol.Contracts.csproj\", \"{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protobuf\", \"Plexus.Interop.Protobuf\\Plexus.Interop.Protobuf.csproj\", \"{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol.Common.Contracts\", \"Plexus.Interop.Protocol.Common.Contracts\\Plexus.Interop.Protocol.Common.Contracts.csproj\", \"{037DE041-C2C3-4355-B37D-848BB14F81AC}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol\", \"Plexus.Interop.Protocol\\Plexus.Interop.Protocol.csproj\", \"{40774592-A7CB-42F8-9A67-F3CDF85918F8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Broker.Core\", \"Plexus.Interop.Broker.Core\\Plexus.Interop.Broker.Core.csproj\", \"{6A302542-4EB4-4E80-BBF7-0B2235AF2873}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Tests\", \"Plexus.Interop.Tests\\Plexus.Interop.Tests.csproj\", \"{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Apps.Manager\", \"Plexus.Interop.Apps.Manager\\Plexus.Interop.Apps.Manager.csproj\", \"{30667250-0A0C-427D-8EEB-70DE3201AFF0}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Utils\", \"Utils\", \"{BC748110-6B70-4E55-AE09-684577217BD9}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Protocol\", \"Protocol\", \"{D4C42A41-34F1-44C3-82EB-C91495A368B9}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\..\\protocol\\plexus.interop.proto = ..\\..\\protocol\\plexus.interop.proto\n\t\t..\\..\\protocol\\plexus.interop.transport.proto = ..\\..\\protocol\\plexus.interop.transport.proto\n\t\t..\\..\\protocol\\plexus.proto = ..\\..\\protocol\\plexus.proto\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Broker\", \"Broker\", \"{D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Client\", \"Client\", \"{37B50996-7A29-4F19-AC26-85953814B33E}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"IntegrationTests\", \"IntegrationTests\", \"{5DC3E899-B07F-4956-AD21-2B712A67456E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client.Core\", \"Plexus.Interop.Client.Core\\Plexus.Interop.Client.Core.csproj\", \"{62636D0B-B120-4889-92A2-07E95B72F039}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client.Marshalling.Contracts\", \"Plexus.Interop.Client.Marshalling.Contracts\\Plexus.Interop.Client.Marshalling.Contracts.csproj\", \"{0205606B-8D46-49CE-91F9-937209F4206E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client.Marshalling.Protobuf\", \"Plexus.Interop.Client.Marshalling.Protobuf\\Plexus.Interop.Client.Marshalling.Protobuf.csproj\", \"{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client\", \"Plexus.Interop.Client\\Plexus.Interop.Client.csproj\", \"{86FA0447-5E15-4758-8D1C-8AB413CF0097}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Testing\", \"Plexus.Interop.Testing\\Plexus.Interop.Testing.csproj\", \"{78B22006-0BC7-4F30-990D-2F1B06FC23B4}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Utils\", \"Plexus.Interop.Transport.Utils\\Plexus.Interop.Transport.Utils.csproj\", \"{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Pipes.Tests\", \"Plexus.Interop.Transport.Pipes.Tests\\Plexus.Interop.Transport.Pipes.Tests.csproj\", \"{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Testing\", \"Plexus.Interop.Transport.Testing\\Plexus.Interop.Transport.Testing.csproj\", \"{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.WebSockets.Tests\", \"Plexus.Interop.Transport.WebSockets.Tests\\Plexus.Interop.Transport.WebSockets.Tests.csproj\", \"{CB185812-DEAD-4E84-8F69-C2570E3DA38A}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Channels\", \"Plexus.Channels\\Plexus.Channels.csproj\", \"{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Metamodel\", \"Plexus.Interop.Metamodel\\Plexus.Interop.Metamodel.csproj\", \"{B0BAB9D3-0889-41C3-9238-59E1C93EE721}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Metamodel.Json\", \"Plexus.Interop.Metamodel.Json\\Plexus.Interop.Metamodel.Json.csproj\", \"{AF3239E1-4625-4792-8288-101D0AC13BFC}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Metamodel.Contracts\", \"Plexus.Interop.Metamodel.Contracts\\Plexus.Interop.Metamodel.Contracts.csproj\", \"{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Metamodel.Json.Tests\", \"Plexus.Interop.Metamodel.Json.Tests\\Plexus.Interop.Metamodel.Json.Tests.csproj\", \"{FDE6BDBB-B755-43A8-9528-4729826FD375}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Protocol.Protobuf.Tests\", \"Plexus.Interop.Protocol.Protobuf.Tests\\Plexus.Interop.Protocol.Protobuf.Tests.csproj\", \"{2692D84D-B028-496D-A417-D08489C02E4D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Host\", \"Plexus.Host\\Plexus.Host.csproj\", \"{62F457D0-223A-4694-AC35-A855C43AEBDC}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Samples\", \"Samples\", \"{441CC140-366E-46D6-B294-3E9DA10809B4}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Samples.GreetingServer\", \"Plexus.Interop.Samples.GreetingServer\\Plexus.Interop.Samples.GreetingServer.csproj\", \"{65A131FC-0E7A-44BD-A587-2D27D23A7D44}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Samples.GreetingClient\", \"Plexus.Interop.Samples.GreetingClient\\Plexus.Interop.Samples.GreetingClient.csproj\", \"{843B6A56-9564-4739-9E5D-D684BD6DB489}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Apps.Manager.Contracts\", \"Plexus.Interop.Apps.Manager.Contracts\\Plexus.Interop.Apps.Manager.Contracts.csproj\", \"{02458864-185B-402F-A945-E9766395EF21}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Samples.Metadata\", \"Plexus.Interop.Samples.Metadata\\Plexus.Interop.Samples.Metadata.csproj\", \"{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Samples.CcyPairRateViewer\", \"Plexus.Interop.Samples.CcyPairRateViewer\\Plexus.Interop.Samples.CcyPairRateViewer.csproj\", \"{CECD4C54-D668-4467-ABAC-6F7E629BABA6}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Samples.CcyPairRateProvider\", \"Plexus.Interop.Samples.CcyPairRateProvider\\Plexus.Interop.Samples.CcyPairRateProvider.csproj\", \"{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Client.Marshalling.Protobuf.Tests\", \"Plexus.Interop.Client.Marshalling.Protobuf.Tests\\Plexus.Interop.Client.Marshalling.Protobuf.Tests.csproj\", \"{16653188-657E-4A2B-A967-7516F87FF516}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Logging.CommonLogging\", \"Plexus.Logging.CommonLogging\\Plexus.Logging.CommonLogging.csproj\", \"{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Broker.Core.Tests\", \"Plexus.Interop.Broker.Core.Tests\\Plexus.Interop.Broker.Core.Tests.csproj\", \"{4384F339-BA87-4D49-92F4-F7BC768AFDD1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\", \"Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\\Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck.csproj\", \"{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}\"\nEndProject\nGlobal\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{16653188-657e-4a2b-a967-7516f87ff516}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{215b0f69-fab6-402f-aee7-7a68076605e6}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{2692d84d-b028-496d-a417-d08489c02e4d}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{413fdf9e-d3b8-4060-b047-adf5df7674d3}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{431a3352-9191-40f3-bdc6-9b36aefe8bce}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{8c1cf325-b2e8-44eb-930d-210abcfe505f}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{ada01827-8218-4182-ad83-a25fc36ddd95}*SharedItemsImports = 13\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{b1301ba6-9693-41b7-98e4-d879299ca781}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{b9ade812-6919-4b86-bd1c-0123dbb95fcb}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{bcecde18-e331-445c-a501-19b9b7d1bb3b}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{cb185812-dead-4e84-8f69-c2570e3da38a}*SharedItemsImports = 5\n\t\tPlexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems*{fde6bdbb-b755-43a8-9528-4729826fd375}*SharedItemsImports = 5\n\tEndGlobalSection\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|x64.Build.0 = Release|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9}.Release|x86.Build.0 = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|x64.Build.0 = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1}.Release|x86.Build.0 = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|x64.Build.0 = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC}.Release|x86.Build.0 = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|x64.Build.0 = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8}.Release|x86.Build.0 = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|x64.Build.0 = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C}.Release|x86.Build.0 = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|x64.Build.0 = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE}.Release|x86.Build.0 = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|x64.Build.0 = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0}.Release|x86.Build.0 = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|x64.Build.0 = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35}.Release|x86.Build.0 = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|x64.Build.0 = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03}.Release|x86.Build.0 = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|x64.Build.0 = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05}.Release|x86.Build.0 = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|x64.Build.0 = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B}.Release|x86.Build.0 = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|x64.Build.0 = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64}.Release|x86.Build.0 = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|x64.Build.0 = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6}.Release|x86.Build.0 = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|x64.Build.0 = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423}.Release|x86.Build.0 = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|x64.Build.0 = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781}.Release|x86.Build.0 = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|x64.Build.0 = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C}.Release|x86.Build.0 = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|x64.Build.0 = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B}.Release|x86.Build.0 = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|x64.Build.0 = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB}.Release|x86.Build.0 = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|x64.Build.0 = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114}.Release|x86.Build.0 = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|x64.Build.0 = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC}.Release|x86.Build.0 = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|x64.Build.0 = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8}.Release|x86.Build.0 = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|x64.Build.0 = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873}.Release|x86.Build.0 = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|x64.Build.0 = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3}.Release|x86.Build.0 = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|x64.Build.0 = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0}.Release|x86.Build.0 = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|x64.Build.0 = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039}.Release|x86.Build.0 = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|x64.Build.0 = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2}.Release|x86.Build.0 = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|x64.Build.0 = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097}.Release|x86.Build.0 = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|x64.Build.0 = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4}.Release|x86.Build.0 = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|x64.Build.0 = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4}.Release|x86.Build.0 = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|x64.Build.0 = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A}.Release|x86.Build.0 = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|x64.Build.0 = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721}.Release|x86.Build.0 = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|x64.Build.0 = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1}.Release|x86.Build.0 = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|x64.Build.0 = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375}.Release|x86.Build.0 = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|x64.Build.0 = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D}.Release|x86.Build.0 = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|x64.Build.0 = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC}.Release|x86.Build.0 = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|x64.Build.0 = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44}.Release|x86.Build.0 = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|x64.Build.0 = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489}.Release|x86.Build.0 = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|x64.Build.0 = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{02458864-185B-402F-A945-E9766395EF21}.Release|x86.Build.0 = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|x64.Build.0 = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13}.Release|x86.Build.0 = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|x64.Build.0 = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6}.Release|x86.Build.0 = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|x64.Build.0 = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26}.Release|x86.Build.0 = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|x64.Build.0 = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{16653188-657E-4A2B-A967-7516F87FF516}.Release|x86.Build.0 = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|x64.Build.0 = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B}.Release|x86.Build.0 = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|x64.Build.0 = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1}.Release|x86.Build.0 = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|x64.Build.0 = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{E64A6BC5-E141-4DC9-8F9B-3DCABE37EFF9} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{6958A076-8D0A-433B-BBF1-6AF782E8FFD0} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{B089A539-9AA0-4156-B8E7-CB44564EBFD1} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{04B6F57B-79F0-4D94-948D-A5B06B0A63AC} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{C439A91C-B618-44A4-A14C-1672094BFED8} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{CCBDCF7A-06C0-4842-AB20-BCAFADB8FFFF} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{A5D769B2-08A3-4FB6-8808-52E6AC23665C} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{ADA01827-8218-4182-AD83-A25FC36DDD95} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{431A3352-9191-40F3-BDC6-9B36AEFE8BCE} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{C6F54CAC-3BCC-4ABB-852E-1EA18F3FDFB0} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{76A57645-A17F-4211-8FE9-FA0C2A321D35} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{09DB94B2-0FD8-429B-9073-936130C4FA03} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{789DDB55-3F31-41FD-B1BF-D54EF0E46E7D} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{B9A61072-E5C4-4CEA-83EA-BEEA4E1B4F05} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{BCECDE18-E331-445C-A501-19B9B7D1BB3B} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{C1BE90CA-7F16-470A-BF71-5B43F845DE64} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{215B0F69-FAB6-402F-AEE7-7A68076605E6} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{15477A03-DAEF-4D18-9915-F4AF2126D423} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{A7EE4E71-3D2B-469D-9E4E-552D9F81E459} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{8C1CF325-B2E8-44EB-930D-210ABCFE505F} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{B1301BA6-9693-41B7-98E4-D879299CA781} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{AFA0961A-CEA1-49FF-812A-8B166B34AF6C} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{1E084712-9A9F-4635-9B47-E4BAD924175B} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{AD1EE352-CBED-43DF-999B-5F1AFFE7CACB} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{E7197407-ECD1-4BB9-83DE-CCD56DA9F114} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{037DE041-C2C3-4355-B37D-848BB14F81AC} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{40774592-A7CB-42F8-9A67-F3CDF85918F8} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{6A302542-4EB4-4E80-BBF7-0B2235AF2873} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{413FDF9E-D3B8-4060-B047-ADF5DF7674D3} = {5DC3E899-B07F-4956-AD21-2B712A67456E}\n\t\t{30667250-0A0C-427D-8EEB-70DE3201AFF0} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{62636D0B-B120-4889-92A2-07E95B72F039} = {37B50996-7A29-4F19-AC26-85953814B33E}\n\t\t{0205606B-8D46-49CE-91F9-937209F4206E} = {37B50996-7A29-4F19-AC26-85953814B33E}\n\t\t{B73ECE12-4DFE-4B2D-B79E-7E96169F59E2} = {37B50996-7A29-4F19-AC26-85953814B33E}\n\t\t{86FA0447-5E15-4758-8D1C-8AB413CF0097} = {37B50996-7A29-4F19-AC26-85953814B33E}\n\t\t{78B22006-0BC7-4F30-990D-2F1B06FC23B4} = {5DC3E899-B07F-4956-AD21-2B712A67456E}\n\t\t{66D22EE5-D153-4248-87B5-F3D4D86DC1F8} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{B9ADE812-6919-4B86-BD1C-0123DBB95FCB} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{8D3A03B6-B4FC-4658-B488-8388E2D15CE4} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{CB185812-DEAD-4E84-8F69-C2570E3DA38A} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\t\t{821D505F-6EAC-4C7D-8A4E-5D5CA44A8977} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{B0BAB9D3-0889-41C3-9238-59E1C93EE721} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{AF3239E1-4625-4792-8288-101D0AC13BFC} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{B87D2027-2A94-4E3A-A7D8-9F0B73F76EE1} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{FDE6BDBB-B755-43A8-9528-4729826FD375} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{2692D84D-B028-496D-A417-D08489C02E4D} = {D4C42A41-34F1-44C3-82EB-C91495A368B9}\n\t\t{62F457D0-223A-4694-AC35-A855C43AEBDC} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{65A131FC-0E7A-44BD-A587-2D27D23A7D44} = {441CC140-366E-46D6-B294-3E9DA10809B4}\n\t\t{843B6A56-9564-4739-9E5D-D684BD6DB489} = {441CC140-366E-46D6-B294-3E9DA10809B4}\n\t\t{02458864-185B-402F-A945-E9766395EF21} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{F2B5D2A5-AF4D-4356-A023-FA8B589DEE13} = {441CC140-366E-46D6-B294-3E9DA10809B4}\n\t\t{CECD4C54-D668-4467-ABAC-6F7E629BABA6} = {441CC140-366E-46D6-B294-3E9DA10809B4}\n\t\t{F29AD7B2-3886-48D0-AEB0-7AB2ABF32D26} = {441CC140-366E-46D6-B294-3E9DA10809B4}\n\t\t{16653188-657E-4A2B-A967-7516F87FF516} = {37B50996-7A29-4F19-AC26-85953814B33E}\n\t\t{9F279FCA-29F3-4E36-8DCB-B7744E4C2D4B} = {BC748110-6B70-4E55-AE09-684577217BD9}\n\t\t{4384F339-BA87-4D49-92F4-F7BC768AFDD1} = {D183E4A6-8BB1-4E52-9B5B-8BDB7770B5C5}\n\t\t{2ECB2C1B-CD26-42D0-B9DB-AC34CF37D7EC} = {D40CE3C7-0F51-4D5D-94AD-5DBBAAB940B4}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {42E89A57-F634-4DB0-B861-EC0B713FE368}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "desktop/src/Plexus.Interop.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue\">True</s:Boolean>\n        <s:String x:Key=\"/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue\">CSharp72</s:String>\n\t<s:Boolean x:Key=\"/Default/UserDictionary/Words/=Metamodel/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/ILogger.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public interface ILogger\n    {\n        /// <summary>\n        /// Name of the logger.\n        /// </summary>\n        string Name { get; }\n\n        /// <summary>\n        /// Returns bool indicating whether the specified <paramref name=\"level\"/> is enabled.\n        /// </summary>\n        /// <param name=\"level\">Log level to check.</param>\n        bool IsLogLevelEnabled(LogLevel level);        \n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        void Log(LogLevel logLevel, [CanBeNull] Exception exception, string message);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1, T2>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1, T2, T3>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1, T2, T3, T4>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1, T2, T3, T4, T5>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        /// <param name=\"arg6\">The sixth argument for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"format\")]\n        void Log(LogLevel logLevel, [CanBeNull] Exception exception, string message, params object[] args);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/ILoggerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    public interface ILoggerFactory\n    {\n        ILogger Create(string name);\n\n#if NETSTANDARD2_0\n        void Configure(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);\n#endif\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LogConfig.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    public static class LogConfig\n    {\n        private static ILoggerFactory _loggerFactory = NoopLoggerFactory.Instance;\n\n        public static ILoggerFactory LoggerFactory\n        {\n            get => _loggerFactory;\n            set => _loggerFactory = value ?? NoopLoggerFactory.Instance;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LogLevel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus\n{\n    /// <summary>\n    /// 7 possible logging levels\n    /// </summary>\n    [Flags]\n    public enum LogLevel\n    {\n        /// <summary>\n        /// All logging levels\n        /// </summary>\n        All = 0,\n        /// <summary>\n        /// A trace logging level\n        /// </summary>\n        Trace = 1,\n        /// <summary>\n        /// A debug logging level\n        /// </summary>\n        Debug = 2,\n        /// <summary>\n        /// A info logging level\n        /// </summary>\n        Info = 4,\n        /// <summary>\n        /// A warn logging level\n        /// </summary>\n        Warn = 8,\n        /// <summary>\n        /// An error logging level\n        /// </summary>\n        Error = 16,\n        /// <summary>\n        /// A fatal logging level\n        /// </summary>\n        Fatal = 32,\n        /// <summary>\n        /// Do not log anything.\n        /// </summary>\n        Off = 64,\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Logging/LogManager.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Runtime.CompilerServices;\n\n    public static class LogManager\n    {\n#if NETSTANDARD2_0\n        public static void ConfigureLogging(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)\n        {\n            LogConfig.LoggerFactory.Configure(loggerFactory);\n        }\n#endif\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger(string name)\n        {\n            return LogConfig.LoggerFactory.Create(name);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger(string name, string id)\n        {\n            return LogConfig.LoggerFactory.Create(name + \".\" + id);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger(Type type, string id)\n        {\n            return GetLogger(type.FormatName() + \".\" + id);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger(Type type)\n        {\n            return GetLogger(type.FormatName());\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger<T>()\n        {\n            return GetLogger(typeof(T).FormatName());\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ILogger GetLogger<T>(string id)\n        {\n            return GetLogger(typeof(T).FormatName() + \".\" + id);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Any.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log(this ILogger logger, LogLevel logLevel, string message)\n        {\n            logger.Log(logLevel, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log<T1>(this ILogger logger, LogLevel logLevel, string message, T1 arg1)\n        {\n            logger.Log(logLevel, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log<T1, T2>(this ILogger logger, LogLevel logLevel, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(logLevel, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log<T1, T2, T3>(this ILogger logger, LogLevel logLevel, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(logLevel, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log<T1, T2, T3, T4>(this ILogger logger, LogLevel logLevel, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(logLevel, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log<T1, T2, T3, T4, T5>(this ILogger logger, LogLevel logLevel, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(logLevel, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with the specified <paramref name=\"logLevel\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"logLevel\">The level of log entry.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Log(this ILogger logger, LogLevel logLevel, string message, params object[] args)\n        {\n            logger.Log(logLevel, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Debug.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Debug\"/> is enabled.\n        /// </summary>        \n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsDebugEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Debug);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Debug, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Debug, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Debug, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Debug, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Debug, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Debug, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Debug, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]        \n        public static void Debug(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Debug, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Debug, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Debug, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Debug, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Debug, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Debug, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Debug\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Debug(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Debug, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Error.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Error\"/> is enabled.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsErrorEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Error);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Error, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Error, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Error, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Error, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Error, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Error, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Error, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]        \n        public static void Error(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Error, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Error, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Error, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Error, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Error, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Error, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Error\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Error(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Error, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Fatal.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Fatal\"/> is enabled.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsFatalEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Fatal);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Fatal, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Fatal, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Fatal, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Fatal, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Fatal, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Fatal, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Fatal, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Fatal, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Fatal\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Fatal(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Fatal, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Info.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Info\"/> is enabled.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsInfoEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Info);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Info, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Info, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Info, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Info, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Info, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Info, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Info, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Info, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        /// <param name=\"arg6\">The sixth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info<T1, T2, T3, T4, T5, T6>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)\n        {\n            logger.Log(LogLevel.Info, null, message, arg1, arg2, arg3, arg4, arg5, arg6);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Info\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Info(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Info, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Trace.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Trace\"/> is enabled.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsTraceEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Trace);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Trace, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Trace, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Trace, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Trace, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Trace, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Trace, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Trace, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Trace, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Trace, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Trace, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Trace, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Trace, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Trace, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Trace\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Trace(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Trace, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/LoggerExtensions.Warn.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\nusing JetBrains.Annotations;\n\nnamespace Plexus\n{\n    public static partial class LoggerExtensions\n    {\n        /// <summary>\n        /// Returns bool indicating whether the specified <see cref=\"LogLevel.Warn\"/> is enabled.\n        /// </summary>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static bool IsWarnEnabled(this ILogger logger)\n        {\n            return logger.IsLogLevelEnabled(LogLevel.Warn);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        [StringFormatMethod(\"message\")]\n        public static void Warn(this ILogger logger, [CanBeNull] Exception exception, string message)\n        {\n            logger.Log(LogLevel.Warn, exception, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Warn, exception, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Warn, exception, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Warn, exception, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3, T4>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Warn, exception, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3, T4, T5>(this ILogger logger, [CanBeNull] Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Warn, exception, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"exception\">The exception to log.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn(this ILogger logger, [CanBeNull] Exception exception, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Warn, exception, message, args);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn(this ILogger logger, string message)\n        {\n            logger.Log(LogLevel.Warn, null, message);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1>(this ILogger logger, string message, T1 arg1)\n        {\n            logger.Log(LogLevel.Warn, null, message, arg1);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2>(this ILogger logger, string message, T1 arg1, T2 arg2)\n        {\n            logger.Log(LogLevel.Warn, null, message, arg1, arg2);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            logger.Log(LogLevel.Warn, null, message, arg1, arg2, arg3);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3, T4>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            logger.Log(LogLevel.Warn, null, message, arg1, arg2, arg3, arg4);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"arg1\">The first argument for message formatting.</param>\n        /// <param name=\"arg2\">The second argument for message formatting.</param>\n        /// <param name=\"arg3\">The third argument for message formatting.</param>\n        /// <param name=\"arg4\">The fourth argument for message formatting.</param>\n        /// <param name=\"arg5\">The fifth argument for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn<T1, T2, T3, T4, T5>(this ILogger logger, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            logger.Log(LogLevel.Warn, null, message, arg1, arg2, arg3, arg4, arg5);\n        }\n\n        /// <summary>\n        /// Log a message with level <see cref=\"LogLevel.Warn\"/>.\n        /// </summary>\n        /// <param name=\"logger\">The logger.</param>\n        /// <param name=\"message\">The format of the message object to log.<see cref=\"string.Format(string,object[])\"/> </param>\n        /// <param name=\"args\">Arguments for message formatting.</param>\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void Warn(this ILogger logger, string message, params object[] args)\n        {\n            logger.Log(LogLevel.Warn, null, message, args);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/NoopLogger.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Runtime.CompilerServices;\n\nnamespace Plexus\n{\n    public sealed class NoopLogger : ILogger\n    {\n        public static readonly NoopLogger Instance = new NoopLogger();\n\n        public string Name => \"NoopLogger\";\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsLogLevelEnabled(LogLevel level)\n        {\n            return true;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1>(LogLevel logLevel, Exception exception, string message, T1 arg1)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4, T5>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n        }\n\n        public void Log<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)\n        {\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message, params object[] args)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/NoopLoggerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System.Runtime.CompilerServices;\n\nnamespace Plexus\n{\n    public sealed class NoopLoggerFactory : ILoggerFactory\n    {\n        public static readonly NoopLoggerFactory Instance = new NoopLoggerFactory();\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public ILogger Create(string name)\n        {\n            return NoopLogger.Instance;\n        }\n\n#if NETSTANDARD2_0       \n        public void Configure(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)\n        {\n        }\n#endif\n\n        public void Dispose()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging/Plexus.Logging.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <RootNamespace>Plexus</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"AsyncFriendlyStackTrace\" Version=\"1.6.0\" />\n    <PackageReference Include=\"JetBrains.Annotations\" Version=\"2018.3.0\" PrivateAssets=\"All\" />\n    <PackageReference Condition=\"'$(TargetFramework)' == 'netstandard2.0'\" Include=\"Microsoft.Extensions.Logging.Abstractions\" Version=\"1.1.2\" />\n  </ItemGroup>\n  \n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Logging/TypeExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\n\nnamespace Plexus\n{\n    public static class TypeExtensions\n    {\n        public static bool IsGenericType(this Type t)\n        {\n#if NET452\n            return t.IsGenericType;\n#else\n            return t.GetTypeInfo().IsGenericType;\n#endif\n        }\n\n        public static Type[] GetGenericArguments(this Type t)\n        {\n#if NET452\n            return t.GetGenericArguments();\n#else\n            return t.GetTypeInfo().GenericTypeArguments;\n#endif\n        }\n\n        public static string FormatName(this Type t)\n        {\n            if (!t.IsGenericType())\n            {\n                return t.FullName;\n            }\n            var sb = new StringBuilder();\n            t.AppendGenericTypeName(sb, t.FullName);\n            return sb.ToString();\n        }\n\n        private static void AppendGenericTypeName(this Type t, StringBuilder sb, string fullName)\n        {\n            if (!t.IsGenericType())\n            {\n                sb.Append(fullName);\n                return;\n            }\n            var index = fullName.LastIndexOf(\"`\");\n            if (index == -1)\n            {\n                sb.Append(fullName);\n            }\n            else\n            {\n                sb.Append(fullName.Substring(0, index));\n            }\n            sb.Append(\"<\");\n            var genericTypes = t.GetGenericArguments();\n            for (int i = 0; i < genericTypes.Length; i++)\n            {\n                if (i > 0)\n                {\n                    sb.Append(\", \");\n                }\n                genericTypes[i].AppendGenericTypeName(sb, genericTypes[i].Name);\n            }\n            sb.Append(\">\");\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.CommonLogging/Logger.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.CommonLogging\n{\n#if NETSTANDARD2_0\n    using Microsoft.Extensions.Logging;\n#endif\n    using System;\n    using System.Runtime.CompilerServices;\n    using ICommonLogger = Common.Logging.ILog;\n    using ILogger = ILogger;\n    using LogLevel = LogLevel;\n\n    internal sealed class Logger : ILogger\n#if NETSTANDARD2_0\n        , Microsoft.Extensions.Logging.ILogger\n#endif\n    {\n        private static readonly object[] EmptyArgs = new object[0];\n\n        public Logger(ICommonLogger logger, string name)\n        {\n            _logger = logger;\n            Name = name;\n        }\n\n        private readonly ICommonLogger _logger;\n\n        public string Name { get; }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsLogLevelEnabled(LogLevel level)\n        {\n            switch (level)\n            {\n                case LogLevel.All:\n                    return _logger.IsTraceEnabled;\n                case LogLevel.Trace:\n                    return _logger.IsTraceEnabled;\n                case LogLevel.Debug:\n                    return _logger.IsDebugEnabled;\n                case LogLevel.Info:\n                    return _logger.IsInfoEnabled;\n                case LogLevel.Warn:\n                    return _logger.IsWarnEnabled;\n                case LogLevel.Error:\n                    return _logger.IsErrorEnabled;\n                case LogLevel.Fatal:\n                    return _logger.IsFatalEnabled;\n                case LogLevel.Off:\n                    return false;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(level), level, null);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, EmptyArgs);\n            }\n        }        \n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1>(LogLevel logLevel, Exception exception, string message, T1 arg1)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1, arg2);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1, arg2, arg3);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1, arg2, arg3, arg4);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4, T5>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1, arg2, arg3, arg4, arg5);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                LogInternal(logLevel, exception, message, arg1, arg2, arg3, arg4, arg5, arg6);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message, params object[] args)\n        {\n            LogInternal(logLevel, exception, message, args);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void LogInternal(LogLevel logLevel, Exception exception, string message, params object[] args)\n        {\n            if (IsLogLevelEnabled(logLevel))\n            {\n                switch (logLevel)\n                {\n                    case LogLevel.All:\n                        _logger.TraceFormat(message, exception, args);\n                        break;\n                    case LogLevel.Trace:\n                        _logger.TraceFormat(message, exception, args);\n                        break;\n                    case LogLevel.Debug:\n                        _logger.DebugFormat(message, exception, args);\n                        break;\n                    case LogLevel.Info:\n                        _logger.InfoFormat(message, exception, args);\n                        break;\n                    case LogLevel.Warn:\n                        _logger.WarnFormat(message, exception, args);\n                        break;\n                    case LogLevel.Error:\n                        _logger.ErrorFormat(message, exception, args);\n                        break;\n                    case LogLevel.Fatal:\n                        _logger.FatalFormat(message, exception, args);\n                        break;\n                    case LogLevel.Off:\n                        break;\n                    default:\n                        throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);\n                }\n            }\n        }\n#if NETSTANDARD2_0\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)\n        {\n            var lvl = Convert(logLevel);\n            if (IsLogLevelEnabled(lvl))\n            {\n                Log(lvl, exception, formatter(default(TState), exception));\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsEnabled(Microsoft.Extensions.Logging.LogLevel logLevel)\n        {\n            return IsLogLevelEnabled(Convert(logLevel));\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public IDisposable BeginScope<TState>(TState state)\n        {\n            // Empty implementation as Common.Logging does not support scoping\n            return EmptyScope.Instance;\n        }        \n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private LogLevel Convert(Microsoft.Extensions.Logging.LogLevel msLogLevel)\n        {\n            switch (msLogLevel)\n            {\n                case Microsoft.Extensions.Logging.LogLevel.Trace:\n                    return LogLevel.Trace;\n                case Microsoft.Extensions.Logging.LogLevel.Debug:\n                    return LogLevel.Debug;\n                case Microsoft.Extensions.Logging.LogLevel.Information:\n                    return LogLevel.Info;\n                case Microsoft.Extensions.Logging.LogLevel.Warning:\n                    return LogLevel.Warn;\n                case Microsoft.Extensions.Logging.LogLevel.Error:\n                    return LogLevel.Error;\n                case Microsoft.Extensions.Logging.LogLevel.Critical:\n                    return LogLevel.Fatal;\n                case Microsoft.Extensions.Logging.LogLevel.None:\n                    return LogLevel.Off;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(msLogLevel), msLogLevel, null);\n            }\n        }\n        \n        private class EmptyScope : IDisposable\n        {\n            public static readonly EmptyScope Instance = new EmptyScope();\n\n            public void Dispose()\n            {\n            }\n        }\n#endif\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Logging.CommonLogging/LoggerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.CommonLogging\n{\n#if NETSTANDARD2_0\n    using Microsoft.Extensions.Logging;\n#endif\n    using Common.Logging;    \n    using ILogger = Plexus.ILogger;\n    using ILoggerFactory = Plexus.ILoggerFactory;\n\n    internal sealed class LoggerFactory : ILoggerFactory\n#if NETSTANDARD2_0\n        ,ILoggerProvider\n#endif\n    {\n        public ILogger Create(string name)\n        {\n            return new Logger(LogManager.GetLogger(name), name);\n        }\n\n#if NETSTANDARD2_0\n        public void Configure(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)\n        {\n            loggerFactory.AddProvider(this);\n        }\n\n        public void Dispose()\n        {\n        }\n\n        public Microsoft.Extensions.Logging.ILogger CreateLogger(string categoryName)\n        {\n            return new Logger(LogManager.GetLogger(categoryName), categoryName);\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.CommonLogging/LoggingInitializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.CommonLogging\n{\n    using System;\n\n    public sealed class LoggingInitializer : IDisposable\n    {\n        private readonly LoggerFactory _loggerFactory = new LoggerFactory();\n        private readonly ILogger _logger;\n\n        public LoggingInitializer()\n        {\n            LogConfig.LoggerFactory = _loggerFactory;\n            _logger = LogManager.GetLogger<LoggingInitializer>();\n            _logger.Info(\"---------- Common Logging initialized ----------\");\n        }\n\n        public void Dispose()\n        {\n            _logger.Info(\"---------- Common Logging uninitialized---------\");\n            LogConfig.LoggerFactory = null;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.CommonLogging/Plexus.Logging.CommonLogging.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Common.Logging\" Version=\"3.4.1\" />\n    <PackageReference Condition=\"'$(TargetFramework)' == 'netstandard2.0'\" Include=\"Microsoft.Extensions.Logging.Abstractions\" Version=\"1.1.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/AsyncExceptionLayoutRenderer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.NLog\n{\n    using AsyncFriendlyStackTrace;\n    using global::NLog.Config;\n    using global::NLog.LayoutRenderers;\n    using System;\n    using System.Text;\n\n    [LayoutRenderer(\"exception\")]\n    [ThreadAgnostic]\n    public class AsyncExceptionLayoutRenderer : ExceptionLayoutRenderer\n    {\n        protected override void AppendToString(StringBuilder sb, Exception ex)\n        {\n            sb.Append(ex.ToAsyncString());\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/Logger.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.NLog\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using INLogLogger = global::NLog.ILogger;\n    using NLogLevel = global::NLog.LogLevel;\n\n    internal sealed class Logger : ILogger\n    {\n        private static readonly object[] EmptyArgs = new object[0];\n\n        public Logger(INLogLogger logger)\n        {\n            _logger = logger;\n        }\n\n        private readonly INLogLogger _logger;\n\n        public string Name => _logger.Name;\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public bool IsLogLevelEnabled(LogLevel level)\n        {\n            return _logger.IsEnabled(ConvertLevel(level));\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {                \n                _logger.Log(level, exception, message, EmptyArgs);\n            }\n        }        \n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1>(LogLevel logLevel, Exception exception, string message, T1 arg1)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {                \n                _logger.Log(level, exception, message, arg1);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, arg1, arg2);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, arg1, arg2, arg3);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, arg1, arg2, arg3, arg4);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4, T5>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, arg1, arg2, arg3, arg4, arg5);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, Exception exception, string message, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, arg1, arg2, arg3, arg4, arg5, arg6);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public void Log(LogLevel logLevel, Exception exception, string message, params object[] args)\n        {\n            var level = ConvertLevel(logLevel);\n            if (_logger.IsEnabled(level))\n            {\n                _logger.Log(level, exception, message, args);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static NLogLevel ConvertLevel(LogLevel level)\n        {\n            switch (level)\n            {\n                case LogLevel.All:\n                    return NLogLevel.Trace;\n                case LogLevel.Trace:\n                    return NLogLevel.Trace;\n                case LogLevel.Debug:\n                    return NLogLevel.Debug;\n                case LogLevel.Info:\n                    return NLogLevel.Info;\n                case LogLevel.Warn:\n                    return NLogLevel.Warn;\n                case LogLevel.Error:\n                    return NLogLevel.Error;\n                case LogLevel.Fatal:\n                    return NLogLevel.Fatal;\n                case LogLevel.Off:\n                    return NLogLevel.Off;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(level), level, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/LoggerFactory.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Logging.NLog\n{\n    using global::NLog.Config;\n    using System;\n    using System.IO;\n    using System.Runtime.CompilerServices;\n    using System.Threading.Tasks;\n    using NLogManager = global::NLog.LogManager;\n#if NETSTANDARD2_0\n    using global::NLog.Extensions.Logging;\n#endif\n\n    internal sealed class LoggerFactory : ILoggerFactory\n    {\n        public LoggerFactory()\n        {\n            if (!TryLoadFromWorkDir(\"Nlog.config\"))\n            {\n                TryLoadFromWorkDir(\"nlog.config\");\n            }\n        }\n\n        private static bool TryLoadFromWorkDir(string fileName)\n        {\n            var pathToCheck = Path.Combine(Directory.GetCurrentDirectory(), fileName);\n            if (File.Exists(pathToCheck))\n            {\n                NLogManager.Configuration = new XmlLoggingConfiguration(pathToCheck);\n                NLogManager.ReconfigExistingLoggers();\n                return true;\n            }\n            return false;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public ILogger Create(string name)\n        {\n            return new Logger(NLogManager.GetLogger(name));\n        }\n\n#if NETSTANDARD2_0\n        public void Configure(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)\n        {\n            loggerFactory.AddNLog();\n        }\n#endif\n\n        public Task FlushAsync(TimeSpan timeout)\n        {\n            var tcs = new TaskCompletionSource<object>();\n            NLogManager.Flush(\n                e =>\n                {\n                    if (e != null)\n                    {\n                        tcs.TrySetException(e);\n                    }\n                    else\n                    {\n                        tcs.TrySetResult(null);\n                    }\n                },\n                timeout);\n            return tcs.Task;\n        }\n\n        public void Flush(TimeSpan timeout)\n        {\n            NLogManager.Flush(timeout);\n        }\n\n        public void Flush()\n        {\n            NLogManager.Flush();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/LoggingInitializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing System;\n\nnamespace Plexus.Logging.NLog\n{\n    public sealed class LoggingInitializer : IDisposable\n    {\n        private readonly LoggerFactory _loggerFactory = new LoggerFactory();\n        private readonly ILogger _logger;\n\n        public LoggingInitializer()\n        {\n            LogConfig.LoggerFactory = _loggerFactory;\n            _logger = LogManager.GetLogger<LoggingInitializer>();\n            _logger.Info(\"---------- NLog Logging initialized ----------\");\n        }\n\n        public void Dispose()\n        {\n            _loggerFactory.Flush();\n            _logger.Info(\"---------- NLog Logging uninitialized---------\");\n            LogConfig.LoggerFactory = null;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/Plexus.Logging.NLog.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"NLog\" Version=\"4.5.11\" />\n    <PackageReference Condition=\"'$(TargetFramework)' == 'netstandard2.0'\" Include=\"NLog.Extensions.Logging\" Version=\"1.1.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Logging.NLog/WorkDirLayoutRenderer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Logging.NLog\n{\n    using global::NLog;\n    using global::NLog.LayoutRenderers;\n    using System.IO;\n    using System.Text;\n\n    [LayoutRenderer(\"workDir\")]\n    public class WorkDirLayoutRenderer : LayoutRenderer\n    {\n        protected override void Append(StringBuilder builder, LogEventInfo logEvent)\n        {\n            builder.Append(Directory.GetCurrentDirectory());\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/ArrayConstants.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    internal static class ArrayConstants<T>\n    {\n        public static readonly T[] Empty = new T[0];\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/AsyncHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal static class AsyncHelper\n    {\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> ToAwaitable<T>(this Exception exception)\n        {\n            if (exception is AggregateException aggregateException)\n            {\n                exception = aggregateException.ExtractInner();\n            }\n            var tcs = new TaskCompletionSource<T>();\n            tcs.SetException(exception);\n            return tcs.Task;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static AwaitableCancellationToken<T> ToAwaitable<T>(this CancellationToken cancellationToken)\n        {\n            return new AwaitableCancellationToken<T>(cancellationToken);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static AwaitableCancellationToken<Nothing> ToAwaitable(this CancellationToken cancellationToken)\n        {\n            return new AwaitableCancellationToken<Nothing>(cancellationToken);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/AwaitableCancellationToken.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal struct AwaitableCancellationToken<T> : IDisposable\n    {\n        private readonly Task<T> _task;\n        private readonly CancellationTokenRegistration _registration;\n\n        public AwaitableCancellationToken(CancellationToken cancellationToken)\n        {            \n            if (cancellationToken.IsCancellationRequested)\n            {\n                _task = TaskConstants<T>.Canceled;\n                _registration = default;\n            }\n            else if (cancellationToken.CanBeCanceled)\n            {\n                var promise = new Promise<T>();\n                _task = promise.Task;\n                _registration = promise.AssignCancellationToken(cancellationToken);\n            }\n            else\n            {\n                _task = TaskConstants<T>.Infinite;\n                _registration = default;\n            }\n        }\n\n        public Task<T> AsTask()\n        {\n            return _task ?? TaskConstants<T>.Infinite;\n        }\n\n        public TaskAwaiter<T> GetAwaiter()\n        {\n            return _task.GetAwaiter();\n        }\n\n        public ConfiguredTaskAwaitable<T> ConfigureAwait(bool continueOnCapturedContext)\n        {\n            return _task.ConfigureAwait(continueOnCapturedContext);\n        }\n\n        public void Dispose()\n        {\n            _registration.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/BaseJsonFileRegistryProvider.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.IO;\n    using System.Security.Cryptography;\n    using System.Text;\n    using System.Threading;\n\n    public abstract class BaseJsonFileRegistryProvider<T> : IDisposable\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<BaseJsonFileRegistryProvider<T>>();\n\n        public T Current { get; private set; }\n\n        public event Action<T> Updated;\n\n        private readonly string _jsonFileName;\n        private readonly FileSystemWatcher _watcher;\n        private readonly object _timerLock = new object();\n        private volatile Timer _reloadTimer;\n\n        protected BaseJsonFileRegistryProvider(string jsonFileName)\n        {\n            _jsonFileName = Path.GetFullPath(jsonFileName);\n\n            var jsonFileDirectory = Path.GetDirectoryName(_jsonFileName) ?? throw new InvalidOperationException();\n            Current = LoadRegistry(_jsonFileName);\n            _watcher = new FileSystemWatcher(jsonFileDirectory)\n            {\n                EnableRaisingEvents = true,\n                Filter = Path.GetFileName(_jsonFileName),\n                NotifyFilter = NotifyFilters.LastWrite,\n            };\n            _watcher.Changed += OnFileChanged;\n        }\n\n        private void OnFileChanged(object sender, FileSystemEventArgs e)\n        {\n            try\n            {\n                if (e.ChangeType == WatcherChangeTypes.Changed && string.Equals(e.FullPath, _jsonFileName))\n                {\n                    Log.Info($\"Registry file {_jsonFileName} have changed. Launching registry reload\");\n                    lock (_timerLock)\n                    {\n                        if (_reloadTimer == null)\n                        {\n                            _reloadTimer = new Timer(OnReloadTimerTick, null, TimeSpan.FromMilliseconds(100), Timeout.InfiniteTimeSpan);\n                        }\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Exception during handling change event of file {0}\", _jsonFileName);\n            }\n        }\n\n        private void OnReloadTimerTick(object state)\n        {\n            try\n            {\n                lock (_timerLock)\n                {\n                    _reloadTimer.Dispose();\n                    _reloadTimer = null;\n                }\n\n                Current = LoadRegistry(_jsonFileName);\n                Updated?.Invoke(Current);\n            }\n            catch (Exception ex)\n            {\n                Log.Error(ex, \"Exception during loading interop registry from {0}\", _jsonFileName);\n            }\n        }\n\n        public void Dispose()\n        {\n            _watcher.Dispose();\n        }\n\n        public abstract T ParseRegistry(string registryContent);\n\n        private T LoadRegistry(string jsonFileName)\n        {\n            Log.Info($\"Loading registry from {jsonFileName}\");\n\n            using (var fileStream = File.Open(jsonFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n            using (var memoryStream = new MemoryStream())\n            {\n                T registry;\n                fileStream.CopyTo(memoryStream);\n\n                memoryStream.Position = 0;\n                using (var reader = new StreamReader(memoryStream, Encoding.UTF8, true, 4096, true))\n                {\n                    var stringContent = reader.ReadToEnd();\n                    registry = ParseRegistry(stringContent);\n                }\n\n                memoryStream.Position = 0;\n                var sha1 = CalculateSha1(memoryStream);\n                var creationTime = File.GetCreationTime(jsonFileName);\n                var lastWriteTime = File.GetLastWriteTime(jsonFileName);\n                var length = memoryStream.Length;\n\n                Log.Info($\"Successfully loaded registry from {jsonFileName}. CreationTime: {creationTime}; LastWriteTime: {lastWriteTime}; Length: {length}; SHA1: {sha1}\");\n\n                return registry;\n            }\n        }\n\n\n        private string CalculateSha1(Stream stream)\n        {\n            try\n            {\n                using (var sha1 = SHA1.Create())\n                {\n                    var hash = sha1.ComputeHash(stream);\n                    return ToHashString(hash);\n                }\n            }\n            catch (Exception ex)\n            {\n                Log.Warn(ex, \"Failed to calculate SHA1 hash\");\n                return string.Empty;\n            }\n        }\n\n        private static string ToHashString(byte[] array)\n        {\n            if (array == null)\n            {\n                return null;\n            }\n            StringBuilder sb = new StringBuilder(array.Length * 2);\n            foreach (byte bt in array)\n            {\n                sb.Append(bt.ToString(\"x2\"));\n            }\n\n            return sb.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Channels/BufferedChannel.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Channels\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class BufferedChannel<T> : IChannel<T>, IReadableChannel<T>, ITerminatableWritableChannel<T>\n    {        \n        private readonly object _sync = new object();\n        private readonly Queue<T> _buffer = new Queue<T>();        \n        private readonly Promise _readCompletion = new Promise();\n        private readonly Promise _writeCompletion = new Promise();\n        private readonly int _bufferSize;\n\n        private Promise<bool> _readAvailable = new Promise<bool>();\n        private Promise<bool> _writeAvailable = new Promise<bool>();\n\n        private readonly Timer _writeTimeoutTracker;\n        private readonly TimeSpan _writeTimeout;\n\n        public BufferedChannel(int bufferSize, TimeSpan writeTimeout = default)\n        {\n            if (bufferSize < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, \"Buffer size must be non-negative\");\n            }\n            _bufferSize = bufferSize;\n            _writeTimeout = writeTimeout == default ? Timeout.InfiniteTimeSpan : writeTimeout;\n            _writeTimeoutTracker = new Timer(OnWriteTimeout, null, _writeTimeout, Timeout.InfiniteTimeSpan);\n            OnBalanceChanged();\n        }\n\n        public Task Completion => _readCompletion.Task;\n\n        Task IWritableChannel<T>.Completion => _writeCompletion.Task;\n\n        public ITerminatableWritableChannel<T> Out => this;\n\n        public IReadableChannel<T> In => this;        \n\n        public bool TryRead(out T item)\n        {\n            lock (_sync)\n            {\n                if (_buffer.Count == 0)\n                {\n                    item = default;\n                    return false;\n                }\n                item = _buffer.Dequeue();\n                OnBalanceChanged();\n                return true;\n            }\n        }\n\n        public bool TryWrite(T item)\n        {\n            lock (_sync)\n            {\n                if (_writeCompletion.Task.IsCompleted || _buffer.Count >= _bufferSize)\n                {\n                    return false;\n                }\n                _buffer.Enqueue(item);\n                OnBalanceChanged();\n                return true;\n            }\n        }\n\n        public Task<bool> WaitReadAvailableAsync(CancellationToken cancellationToken = default)\n        {\n            lock (_sync)\n            {\n                return _readAvailable.Task.WithCancellation(cancellationToken);\n            }\n        }\n\n        public Task<bool> WaitWriteAvailableAsync(CancellationToken cancellationToken = default)\n        {\n            lock (_sync)\n            {\n                return _writeAvailable.Task.WithCancellation(cancellationToken);\n            }\n        }\n\n        public bool TryComplete()\n        {\n            lock (_sync)\n            {\n                if (!_writeCompletion.TryComplete())\n                {\n                    return false;\n                }\n                OnBalanceChanged();\n                return true;\n            }\n        }\n\n        public bool TryTerminate(Exception error = null)\n        {\n            lock (_sync)\n            {\n                var result = error == null || error is OperationCanceledException\n                    ? _writeCompletion.TryCancel()\n                    : _writeCompletion.TryFail(error);\n                if (result)\n                {\n                    OnBalanceChanged();\n                }\n                return result;\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void OnBalanceChanged()\n        {\n            if (_writeCompletion.Task.IsCompleted)\n            {\n                ComputeAvailabilityFromCompletion(_writeCompletion.Task, ref _writeAvailable);\n            }\n            else if (_buffer.Count < _bufferSize)\n            {\n                _writeAvailable.TryComplete(true);\n                _writeTimeoutTracker.Change(Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan);\n            }\n            else if (_writeAvailable.Task.IsCompleted && _writeAvailable.Task.Result)\n            {\n                _writeAvailable = new Promise<bool>();\n                _writeTimeoutTracker.Change(_writeTimeout, Timeout.InfiniteTimeSpan);\n            }\n\n            TryCompleteRead();\n\n            if (_readCompletion.Task.IsCompleted)\n            {\n                ComputeAvailabilityFromCompletion(_readCompletion.Task, ref _readAvailable);\n            }\n            else if (_buffer.Count > 0)\n            {\n                _readAvailable.TryComplete(true);\n            }\n            else if (_readAvailable.Task.IsCompleted && _readAvailable.Task.Result)\n            {\n                _readAvailable = new Promise<bool>();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void ComputeAvailabilityFromCompletion(Task completion, ref Promise<bool> availability)\n        {\n            if (availability.Task.IsCompleted)\n            {\n                availability = new Promise<bool>();\n            }\n            if (completion.IsCanceled)\n            {\n                availability.TryCancel();\n            }\n            else if (completion.IsFaulted)\n            {\n                if (completion.Exception != null)\n                {\n                    availability.TryFail(completion.Exception.InnerExceptions);\n                }\n                else\n                {\n                    availability.TryCancel();\n                }\n            }\n            else\n            {\n                availability.TryComplete(false);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void TryCompleteRead()\n        {\n            if (_buffer.Count != 0)\n            {\n                return;\n            }            \n            if (!_writeCompletion.Task.IsCompleted)\n            {\n                return;\n            }\n            if (_readCompletion.Task.IsCompleted)\n            {\n                return;\n            }\n            if (_writeCompletion.Task.IsCanceled)\n            {\n                _readCompletion.TryCancel();\n            }\n            else if (_writeCompletion.Task.IsFaulted && _writeCompletion.Task.Exception != null)\n            {\n                _readCompletion.TryFail(_writeCompletion.Task.Exception.InnerExceptions);\n            }\n            else\n            {\n                _readCompletion.TryComplete();\n            }            \n        }\n\n        private void OnWriteTimeout(object state)\n        {\n            TryTerminate(new ChannelWriteTimeoutException(_writeTimeout));\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils/Channels/ChannelUtils.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Channels\n{\n    using System;\n    using System.Threading.Tasks;\n\n    internal static class ChannelUtils\n    {\n        public static void PropagateTerminationFrom<T>(this ITerminatableWritableChannel<T> channel, Task completion)\n        {\n            completion.SuppressUnobservedExceptions();\n\n            void OnCompleted(Task task, object state)\n            {\n                var c = (ITerminatableWritableChannel<T>)state;\n                if (task.IsFaulted)\n                {\n                    c.TryTerminate(task.Exception.ExtractInner());\n                }\n                else if (task.IsCanceled)\n                {\n                    c.TryTerminate();\n                }\n            }\n            \n            Task.WhenAny(channel.Completion, completion).Unwrap().ContinueWithSynchronously((Action<Task, object>)OnCompleted, channel);\n        }\n\n        public static void PropagateCompletionFrom<T>(this ITerminatableWritableChannel<T> channel, Task completion)\n        {\n            completion.SuppressUnobservedExceptions();\n\n            void OnCompleted(Task task, object state)\n            {\n                var c = (ITerminatableWritableChannel<T>)state;\n                if (task.IsFaulted)\n                {\n                    c.TryTerminate(task.Exception.ExtractInner());\n                }\n                else if (task.IsCanceled)\n                {\n                    c.TryTerminate();\n                }\n                else\n                {\n                    c.TryComplete();\n                }\n            }\n\n            Task.WhenAny(channel.Completion, completion).Unwrap().ContinueWithSynchronously((Action<Task, object>)OnCompleted, channel);\n        }\n\n        public static void PropagateExceptionFrom<T>(this ITerminatableWritableChannel<T> channel, Task completion)\n        {\n            completion.SuppressUnobservedExceptions();\n\n            void OnCompleted(Task task, object state)\n            {\n                var c = (ITerminatableWritableChannel<T>)state;\n                if (task.IsFaulted)\n                {\n                    c.TryTerminate(task.Exception.ExtractInner());\n                }\n                else if (task.IsCanceled)\n                {\n                    c.TryTerminate();\n                }\n            }\n\n            Task.WhenAny(channel.Completion, completion).Unwrap().ContinueWithSynchronously((Action<Task, object>)OnCompleted, channel);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/EqualityHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    using System.Collections.Generic;\n\n    internal static class EqualityHelper\n    {\n        public static int GetEnumerableHashCode<T>(this IEnumerable<T> enumerable)\n        {\n            var hashCode = 0;\n            foreach (var x in enumerable)\n            {\n                hashCode += (hashCode * 397) ^ (x == null ? 0 : x.GetHashCode());\n            }\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/ExceptionHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using AsyncFriendlyStackTrace;\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Runtime.ExceptionServices;\n\n    internal static class ExceptionHelper\n    {\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Exception ExtractInner(this AggregateException exception)\n        {\n            return exception?.InnerExceptions.Count == 1 ? exception.InnerExceptions[0] : exception;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void RethrowToKeepStackTrace(this Exception ex)\n        {\n            ExceptionDispatchInfo.Capture(ex).Throw();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string FormatTypeAndMessage(this Exception ex)\n        {\n            if (ex == null)\n            {\n                return string.Empty;\n            }\n            return ex.GetType() + \": \" + ex.Message;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string FormatToString(this Exception ex)\n        {\n            if (ex == null)\n            {\n                return string.Empty;\n            }\n            return ex.ToAsyncString();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/FileSystemUtils.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    using System.IO;\n\n    internal static class FileSystemUtils\n    {\n        public static void DeleteDir(string dir)\n        {\n            try\n            {\n                if (Directory.Exists(dir))\n                {\n                    Directory.Delete(dir, true);\n                }\n            }\n            catch (DirectoryNotFoundException)\n            {\n                // ignore\n            }\n        }\n\n        public static void CopyDir(string sourceDir, string targetDir)\n        {\n            foreach (var dirPath in Directory.GetDirectories(sourceDir, \"*\", SearchOption.AllDirectories))\n            {\n                Directory.CreateDirectory(dirPath.Replace(sourceDir, targetDir));\n            }\n            foreach (var newPath in Directory.GetFiles(sourceDir, \"*.*\", SearchOption.AllDirectories))\n            {\n                File.Copy(newPath, newPath.Replace(sourceDir, targetDir), true);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/FormattingUtils.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Collections.Generic;\n    using System.Linq;\n\n    internal static class FormattingUtils\n    {\n        public static string FormatEnumerableObjects<T>(this IEnumerable<T> enumerable)\n        {\n            return enumerable == null ? string.Empty : $\"[{string.Join(\", \", enumerable.Select(FormatObject))}]\";\n        }\n\n        public static string FormatEnumerable<T>(this IEnumerable<T> enumerable)\n        {\n            return enumerable == null ? string.Empty : $\"[{string.Join(\", \", enumerable)}]\";\n        }\n\n        public static string FormatObject<T>(this T obj)\n        {\n            return $\"{{{obj}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/JsonConvert.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.IO;\n    using System.Runtime.Serialization.Json;\n    using System.Text;\n\n    public static class JsonConvert {\n        internal static readonly Encoding NoBomUtf8Encoding = new UTF8Encoding(false);\n\n        public static T DeserializeFromFile<T>(string filePath) => JsonConvert<T>.DeserializeFromFile(filePath);\n        public static T Deserialize<T>(Stream jsonStream) => JsonConvert<T>.Deserialize(jsonStream);\n        public static T Deserialize<T>(string jsonText) => JsonConvert<T>.Deserialize(jsonText);\n        public static string Serialize<T>(T obj) => JsonConvert<T>.Serialize(obj);\n        public static void Serialize<T>(T obj, Stream stream) => JsonConvert<T>.Serialize(obj);\n    }\n\n    public static class JsonConvert<T>\n    {\n        private static readonly DataContractJsonSerializer Serializer = new DataContractJsonSerializer(typeof(T), new DataContractJsonSerializerSettings { UseSimpleDictionaryFormat = true });        \n\n        public static T DeserializeFromFile(string jsonFilePath)\n        {\n            using (var stream = File.Open(jsonFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\n            {\n                return Deserialize(stream);\n            }\n        }\n\n        public static T Deserialize(Stream jsonStream)\n        {\n            using (var reader = new StreamReader(jsonStream, Encoding.UTF8))\n            {\n                return Deserialize(reader.ReadToEnd());\n            }\n        }\n\n        public static T Deserialize(string jsonText)\n        {\n            using (var memoryStream = new MemoryStream())\n            using (var streamWriter = new StreamWriter(memoryStream, JsonConvert.NoBomUtf8Encoding))\n            {\n                streamWriter.Write(jsonText);\n                streamWriter.Flush();\n                memoryStream.Position = 0;            \n                return (T)Serializer.ReadObject(memoryStream);\n            }\n        }\n\n        public static string Serialize(T obj)\n        {\n            using (var stream = new MemoryStream())\n            {\n                Serialize(obj, stream);\n                stream.Position = 0;\n                using (var reader = new StreamReader(stream, JsonConvert.NoBomUtf8Encoding))\n                {\n                    return reader.ReadToEnd();\n                }\n            }\n        }\n\n        public static void Serialize(T obj, Stream stream)\n        {\n            Serializer.WriteObject(stream, obj);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Latch.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Threading;\n\n    internal sealed class Latch\n    {\n        private volatile int _entered;\n\n        public bool TryEnter()\n        {\n            return Interlocked.Exchange(ref _entered, 1) == 0;\n        }\n\n        public bool IsEntered => _entered == 1;\n\n        public void Reset()\n        {\n            _entered = 0;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Plexus.Utils.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Utils</AssemblyName>\n    <PackageId>Plexus.Utils</PackageId>\n    <RootNamespace>Plexus</RootNamespace>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"JetBrains.Annotations\" Version=\"2018.3.0\" PrivateAssets=\"All\" />\n    <PackageReference Include=\"SmartThreadPool.dll\" Version=\"2.2.6\" Condition=\"'$(TargetFramework)' == 'net45'\" />\n    <PackageReference Include=\"System.Buffers\" Version=\"4.5.0\" />\n    <PackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.5.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Channels\\Plexus.Channels.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Common.Contracts\\Plexus.Common.Contracts.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Pools/ObjectPool.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Pools\n{\n    using System;\n    using System.Collections.Concurrent;\n\n    internal static class ObjectPool\n    {\n        public static ObjectPool<T> Create<T>(Func<T> objectGenerator, int maxRetainedObjects = default)\n        {\n            return new ObjectPool<T>(objectGenerator, maxRetainedObjects);\n        }\n\n        public static ObjectPool<T> Create<T>(int maxRetainedObjects = default) where T : new()\n        {\n            return new ObjectPool<T>(() => new T());\n        }\n    }\n\n    internal sealed class ObjectPool<T>\n    {\n        private readonly ConcurrentBag<T> _objects;\n        private readonly Func<T> _objectGenerator;\n        private readonly int _maxRetainedObjects;\n\n        internal ObjectPool(Func<T> objectGenerator, int maxRetainedObjects = default)\n        {\n            _objectGenerator = objectGenerator ?? throw new ArgumentNullException(nameof(objectGenerator));\n            _maxRetainedObjects = maxRetainedObjects == default ? Environment.ProcessorCount * 2 : maxRetainedObjects;\n            _objects = new ConcurrentBag<T>();\n        }\n\n        public int Count => _objects.Count;\n\n        public T GetObject()\n        {\n            if (!_objects.TryTake(out T item))\n            {\n                item = _objectGenerator();\n            }\n            return item;\n        }\n\n        public void PutObject(T item)\n        {\n            if (_objects.Count < _maxRetainedObjects)\n            {\n                _objects.Add(item);\n            }\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils/Pools/PooledBuffer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Pools\n{\n    using System;\n    using System.Buffers;\n    using System.IO;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class PooledBuffer : PooledObject<PooledBuffer>, IPooledBuffer\n    {\n        public const int MaxSize = 65000;\n\n        private static readonly ArrayPool<byte> ArrayPool = ArrayPool<byte>.Create(MaxSize, 50);\n\n        public static async ValueTask<IPooledBuffer> Get(\n            Stream fromStream,\n            int length,\n            CancellationToken cancellationToken = default)\n        {\n            if (length > MaxSize)\n            {\n                throw new ArgumentException($\"Requested length {length} exceeds limit {MaxSize}\", nameof(length));\n            }\n            var buffer = Rent();\n            try\n            {\n                var count = 0;\n                while (count < length)\n                {\n                    var received = await fromStream.ReadAsync(buffer.Array, count, length - count, cancellationToken).ConfigureAwait(false);\n                    if (received == 0)\n                    {\n                        throw new InvalidOperationException(\"Unexpected end of stream received\");\n                    }\n                    count += received;\n                }\n                buffer.Count = count;\n                return buffer;\n            }\n            catch\n            {\n                buffer.Dispose();\n                throw;\n            }\n        }\n\n        public static IPooledBuffer Get(byte[] fromBuffer)\n        {\n            return Get(new ArraySegment<byte>(fromBuffer));\n        }\n\n        public static IPooledBuffer Get(ArraySegment<byte> fromBuffer)\n        {\n            var buffer = Rent();\n            try\n            {\n                System.Array.Copy(fromBuffer.Array ?? throw new InvalidOperationException(), fromBuffer.Offset, buffer.Array, 0, fromBuffer.Count);\n                buffer.Offset = fromBuffer.Offset;\n                buffer.Count = fromBuffer.Count;\n                return buffer;\n            }\n            catch\n            {\n                buffer.Dispose();\n                throw;\n            }\n        }\n\n        public static IPooledBuffer Get(Action<MemoryStream> writeAction)\n        {\n            var buffer = Rent();\n            try\n            {\n                int length;\n                using (var stream = new MemoryStream(buffer.Array, 0, MaxSize))\n                {\n                    writeAction(stream);\n                    length = (int)stream.Position;\n                }\n                buffer.Count = length;\n                return buffer;\n            }\n            catch\n            {\n                buffer.Dispose();\n                throw;\n            }\n        }\n\n        public byte[] Array { get; set; }\n\n        public int Offset { get; set; }\n\n        public int Count { get; set; }\n\n        protected override void Cleanup()\n        {\n            if (Array != null)\n            {\n                ArrayPool.Return(Array);\n            }\n            Array = default;\n            Offset = default;\n            Count = default;\n        }\n\n        protected override void Init()\n        {\n            base.Init();\n            Array = ArrayPool.Rent(MaxSize);\n            Count = MaxSize;\n            Offset = 0;            \n        }\n\n        public override string ToString()\n        {\n            return $\"{{{nameof(Array)}: blob, {nameof(Offset)}: {Offset}, {nameof(Count)}: {Count}}}\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Pools/PooledBufferExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Pools\n{\n    using System;\n\n    internal static class PooledBufferExtensions\n    {\n        public static byte[] ToArray(this IPooledBuffer data)\n        {\n            if (data.Array == null)\n            {\n                return null;\n            }\n            var array = new byte[data.Count];\n            Array.Copy(data.Array, data.Offset, array, 0, data.Count);\n            return array;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Pools/PooledObject.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus.Pools\n{\n    using System;\n    using System.Diagnostics;\n    using System.Threading;\n\n    internal static class PooledObject\n    {\n        public static long Counter;\n    }\n\n    internal abstract class PooledObject<T> : IPooledObject\n        where T : PooledObject<T>, new()\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<PooledObject<T>>();\n\n        private static readonly ObjectPool<T> Pool = ObjectPool.Create(() => new T(), 32);     \n\n        private readonly long _id;\n\n        protected PooledObject()\n        {\n            _refCount = 1;\n            _id = Interlocked.Increment(ref PooledObject.Counter);\n            Log.Trace(\"Creating {0}. Current ref count: {1}\", _id, _refCount);\n        }\n\n        public static T Rent()\n        {\n            Log.Trace(\"Rent. Objects in pool: {0}\", Pool.Count);\n            var obj = Pool.GetObject();\n            if (obj._isSuspended)\n            {\n                obj.Resurrect();                \n            }\n            else\n            {\n                obj.Cleanup();                \n            }\n            obj.Init();\n            return obj;\n        }\n\n        private bool _isSuspended;\n        private int _refCount;\n\n        protected virtual void Init()\n        {\n            Log.Trace(\"Init {0}. Current ref count: {1}\", _id, _refCount);\n        }\n\n        private void Resurrect()\n        {\n            _isSuspended = false;\n            var refCount = Interlocked.Exchange(ref _refCount, 1);            \n            Log.Trace(\"Resurrect {0}. Current ref count: {1}\", _id, _refCount);\n            if (refCount != 0)\n            {\n                if (Log.IsWarnEnabled())\n                {\n                    Log.Warn(\"Invalid ref count after dispose {0}: {1}\\n{2}\", _id, refCount, Environment.StackTrace);\n                }\n#if DEBUG\n                throw new InvalidOperationException($\"Invalid ref count {refCount} after resurrecting pooled object {_id} of type {GetType()}\");\n#endif\n            }\n        }\n\n        protected abstract void Cleanup();\n\n        public void Retain()\n        {            \n            Interlocked.Increment(ref _refCount);\n            Log.Trace(\"Retain {0}. Current ref count: {1}\", _id, _refCount);\n        }\n\n        [Conditional(\"DEBUG\")]\n        protected void CheckNotDisposed()\n        {\n            if (_refCount <= 0)\n            {\n                throw new InvalidOperationException(\"refCount < 0\");\n            }\n        }\n\n        public void Dispose()\n        {            \n            var refCount = Interlocked.Decrement(ref _refCount);\n            Log.Trace(\"Dispose {0}. Current ref count: {1}\", _id, refCount);\n            if (refCount == 0)\n            {\n                Cleanup();\n                _isSuspended = true;\n                Pool.PutObject((T)this);                \n                Log.Trace(\"Returned to pool {0}. Objects in pool: {1}\", _id, Pool.Count);\n            }\n            else if (refCount < 0)\n            {\n                if (Log.IsWarnEnabled())\n                {\n                    Log.Warn(\"Invalid ref count after dispose {0}: {1}\\n{2}\", _id, refCount, Environment.StackTrace);\n                }\n#if DEBUG\n                throw new InvalidOperationException($\"Invalid ref count {refCount} after disposing pooled object {_id} of type {GetType()}\");\n#endif\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Processes/ProcessBase.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Processes\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal abstract class ProcessBase : IDisposable\n    {\n        private readonly Latch _started = new Latch();\n        private readonly Latch _stopped = new Latch();\n        private readonly Promise _completion = new Promise();\n        private readonly Promise _startCompletion = new Promise();\n        private readonly CancellationTokenSource _cancellation = new CancellationTokenSource();\n\n        private readonly ConcurrentBag<CancellationTokenRegistration> _registrations \n            = new ConcurrentBag<CancellationTokenRegistration>();\n\n        protected ProcessBase()\n        {\n            Completion.ContinueWithSynchronously((Action<Task>)DisposeRegistrations).IgnoreAwait();\n        }\n\n        private void DisposeRegistrations(Task completion)\n        {\n            Log.Debug(\"Process completed in state {0}\", completion.GetCompletionDescription());\n            Stop();\n            while (_registrations.TryTake(out var registration))\n            {\n                registration.Dispose();\n            }\n        }\n\n        protected virtual ILogger Log { get; } = NoopLogger.Instance;\n\n        public Task Completion => _completion.Task;\n\n        public Task StartCompletion => _startCompletion.Task;\n\n        protected CancellationToken CancellationToken => _cancellation.Token;\n\n        protected void OnStop(Action action)\n        {\n            _registrations.Add(CancellationToken.Register(action, false));\n        }\n\n        protected virtual Task OnCompletedAsync(Task completion)\n        {\n            return completion;\n        }\n\n        protected abstract Task<Task> StartCoreAsync();\n\n        public void Start()\n        {\n            if (!_started.TryEnter())\n            {\n                return;\n            }\n            if (_stopped.IsEntered)\n            {\n                _startCompletion.TryComplete();\n                _completion.TryComplete();\n                return;\n            }\n            Log.Debug(\"Starting process\");\n            _startCompletion.Task.ContinueWithSynchronously(\n                t => Log.Debug(\"Start of process completed in state {0}\", t.GetCompletionDescription()),\n                CancellationToken.None);\n            var startTask = StartCoreAsync();\n            startTask.PropagateCompletionToPromise(_startCompletion);\n            startTask\n                .Unwrap()\n                .ContinueWithSynchronously(OnCompletedAsync, CancellationToken.None)\n                .PropagateCompletionToPromise(_completion);\n        }\n\n        public Task StartAsync()\n        {\n            Start();\n            return StartCompletion;\n        }\n\n        public void Stop()\n        {\n            if (!_stopped.TryEnter())\n            {\n                return;\n            }\n            Log.Debug(\"Stopping\");\n            _cancellation.Cancel();\n            Start();\n        }\n\n        public async Task StopAsync()\n        {\n            Stop();\n            await Completion.IgnoreExceptions().ConfigureAwait(false);\n        }\n\n        public virtual void Dispose()\n        {\n            Log.Debug(\"Disposing\");\n            StopAsync().GetResult();\n            Log.Debug(\"Disposed\");\n        }\n\n        protected void SetStartCompleted()\n        {\n            Log.Debug(\"Setting start completed\");\n            _startCompletion.TryComplete();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/Promise.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading;\n    using System.Threading.Tasks;\n#if  NET45\n    using Amib.Threading;\n#endif\n\n    internal sealed class Promise\n    {\n        #if NET45        \n\n        // In .NET 4.5 there is no option TaskCreationOptions.RunContinuationsAsynchronously available for TaskCompletionSource class.\n        // It means that we need to implicitly complete TaskCompletionSource on thread pool to avoid blocking calling thread and re-entrance deadlocks.\n        // However completing on .NET default thread pool leads to thread starvation, so we need to use the separate thread pool to schedule completion and continuations.\n\n        private static readonly SmartThreadPool SmartThreadPool = \n            new SmartThreadPool(new STPStartInfo\n            {\n                MinWorkerThreads = 8,\n                MaxWorkerThreads = 1000,\n                ApartmentState = ApartmentState.MTA,\n                AreThreadsBackground = true,\n                IdleTimeout = (int)TimeSpan.FromSeconds(20).TotalMilliseconds,\n                UseCallerCallContext = false,\n                UseCallerHttpContext = false,\n                WorkItemPriority = WorkItemPriority.Normal,\n            });\n\n        static Promise()\n        {            \n            SmartThreadPool.Start();\n        }\n\n        internal static void ScheduleCompletionAction(Action action)\n        {\n            SmartThreadPool.QueueWorkItem(action);\n        }\n\n        #endif\n\n        private readonly Promise<Nothing> _inner = new Promise<Nothing>();\n\n        public Task Task => _inner.Task;\n\n        public bool TryComplete() => _inner.TryComplete(Nothing.Instance);\n\n        public bool TryCancel() => _inner.TryCancel();\n\n        public bool TryFail(Exception error) => _inner.TryFail(error);\n\n        public bool TryFail(IEnumerable<Exception> errors) => _inner.TryFail(errors);\n\n        public void PropagateCompletionFrom(Task task)\n        {\n            task.PropagateCompletionToPromise(this);\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils/Promise`1.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal sealed class Promise<T>\n    {\n#if NET45\n        private readonly TaskCompletionSource<T> _completion = new TaskCompletionSource<T>(TaskCreationOptions.None);\n\n        public Promise()\n        {\n            Task = _completion.Task;\n        }\n\n        private int _isCompleted;\n\n        public Task<T> Task { get; }\n\n        private static void ScheduleCompletionAction(Action action)\n        {\n            Promise.ScheduleCompletionAction(action);\n        }\n\n        public bool TryComplete(T result)\n        {\n            bool completed;\n            if (Interlocked.Exchange(ref _isCompleted, 1) == 0)\n            {\n                ScheduleCompletionAction(() => _completion.SetResult(result));\n                completed = true;\n            }\n            else\n            {\n                completed = false;\n            }\n            try\n            {\n                Task.Wait();\n            }\n            catch\n            {\n                // ignored\n            }\n            return completed;\n        }\n\n        public bool TryCancel()\n        {\n            bool completed;\n            if (Interlocked.Exchange(ref _isCompleted, 1) == 0)\n            {\n                ScheduleCompletionAction(() => _completion.SetCanceled());\n                completed = true;\n            }\n            else\n            {\n                completed = false;\n            }\n            try\n            {\n                Task.Wait();\n            }\n            catch\n            {\n                // ignored\n            }\n            return completed;\n        }\n\n        public bool TryFail(Exception error)\n        {\n            if (error is OperationCanceledException)\n            {\n                return TryCancel();\n            }\n            bool completed;\n            if (Interlocked.Exchange(ref _isCompleted, 1) == 0)\n            {\n                ScheduleCompletionAction(() => _completion.SetException(error));\n                completed = true;\n            }\n            else\n            {\n                completed = false;\n            }\n            try\n            {\n                Task.Wait();\n            }\n            catch\n            {\n                // ignored\n            }\n            return completed;\n        }\n\n        public bool TryFail(IEnumerable<Exception> errors)\n        {\n            bool completed;\n            if (Interlocked.Exchange(ref _isCompleted, 1) == 0)\n            {\n                ScheduleCompletionAction(() => _completion.SetException(errors));\n                completed = true;\n            }\n            else\n            {\n                completed = false;\n            }\n            try\n            {\n                Task.Wait();\n            }\n            catch\n            {\n                // ignored\n            }\n            return completed;\n        }\n\n#else\n        private readonly TaskCompletionSource<T> _completion = new TaskCompletionSource<T>(TaskCreationOptions.RunContinuationsAsynchronously);\n\n        public Promise()\n        {\n            Task = _completion.Task;\n            Task.SuppressUnobservedExceptions();\n        }\n\n        public Task<T> Task { get; }\n\n        public bool TryComplete(T result) => _completion.TrySetResult(result);\n\n        public bool TryCancel() => _completion.TrySetCanceled();\n\n        public bool TryFail(Exception error)\n        {\n            if (error is OperationCanceledException)\n            {\n                return TryCancel();\n            }\n            return _completion.TrySetException(error);\n        }\n\n        public bool TryFail(IEnumerable<Exception> errors) => _completion.TrySetException(errors);\n#endif\n\n        public void PropagateCompletionFrom(Task<T> task)\n        {\n            task.PropagateCompletionToPromise(this);\n        }\n\n        public CancellationTokenRegistration AssignCancellationToken(CancellationToken cancellationToken)\n        {\n            if (!cancellationToken.CanBeCanceled)\n            {\n                return default;\n            }\n            if (cancellationToken.IsCancellationRequested)\n            {\n                TryCancel();\n                return default;\n            }\n            var registration = cancellationToken.Register(CancelPromiseOnCancellationRequested, this, false);\n            Task.ContinueWithSynchronously(DisposeCancellationRegistrationOnPromiseCompleted, registration, CancellationToken.None);\n            return registration;\n        }\n\n        private static Task<TResult> DisposeCancellationRegistrationOnPromiseCompleted<TResult>(Task<TResult> task, object state)\n        {\n            var r = (CancellationTokenRegistration) state;\n            r.Dispose();\n            return task;\n        }\n\n        private static void CancelPromiseOnCancellationRequested(object obj)\n        {\n            var p = (Promise<T>) obj;\n            p.TryCancel();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils/Properties/AssemblyInfo.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing System.Runtime.CompilerServices;\n\n[assembly: InternalsVisibleTo(\"Plexus.Utils.Tests\")]\n[assembly: InternalsVisibleTo(\"Plexus.Utils.Testing\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Pipes\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Protocol\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Protocol.Protobuf\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Protocol.Tests\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Testing\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.Pipes\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.Streams\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.Testing\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.WebSockets.Client\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.WebSockets.Server\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Transmission.WebSockets.Server.Fleck\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Transport.Utils\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Protobuf\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Protocol\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Protocol.Protobuf\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Testing\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Tests\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Client\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Client.Core\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Client.Marshalling.Protobuf\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Client.Marshalling.Protobuf.Tests\")]\n[assembly: InternalsVisibleTo(\"plexus\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Apps.Manager\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Broker\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Broker.Core\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Broker.Host\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.CommandLineTool\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Metamodel\")]\n[assembly: InternalsVisibleTo(\"Plexus.Interop.Metamodel.Json\")]\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/StreamExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.IO;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal static class StreamExtensions\n    {\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task WriteAsync(this Stream stream, ArraySegment<byte> buffer)\n        {\n            return stream.WriteAsync(buffer.Array, buffer.Offset, buffer.Count);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task WriteAsync(this Stream stream, ArraySegment<byte> buffer, CancellationToken cancellationToken)\n        {\n            return stream.WriteAsync(buffer.Array, buffer.Offset, buffer.Count, cancellationToken);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ReadAsync(this Stream stream, ArraySegment<byte> buffer)\n        {\n            return stream.ReadAsync(buffer.Array, buffer.Offset, buffer.Count);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ReadAsync(this Stream stream, ArraySegment<byte> buffer, CancellationToken cancellationToken)\n        {\n            return stream.ReadAsync(buffer.Array, buffer.Offset, buffer.Count, cancellationToken);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskConstants.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Threading.Tasks;\n\n    internal static class TaskConstants\n    {           \n        public static readonly Task Completed = TaskConstants<Nothing>.Completed;\n\n        public static readonly Task Canceled = TaskConstants<Nothing>.Canceled;\n\n        public static readonly Task<bool> True = Task.FromResult(true);\n\n        public static readonly Task<bool> False = Task.FromResult(false);\n\n        public static readonly Task Infinite = TaskConstants<Nothing>.Infinite;\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskConstants`1.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Threading.Tasks;\n\n    internal static class TaskConstants<T>\n    {\n        public static readonly Task<T> Canceled;\n\n        public static readonly ValueTask<T> CanceledValue;\n\n        public static readonly Task<T> Infinite;\n\n        public static readonly Task<T> Completed;\n\n        static TaskConstants()\n        {\n            var canceled = new TaskCompletionSource<T>();\n            canceled.SetCanceled();;\n            Canceled = canceled.Task;\n            CanceledValue = new ValueTask<T>(Canceled);\n            var infinite = new TaskCompletionSource<T>();\n            Infinite = infinite.Task;\n            var completed = new TaskCompletionSource<T>();\n            completed.SetResult(default);\n            Completed = completed.Task;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal static class TaskExtensions\n    {\n        private static readonly ILogger Log = LogManager.GetLogger(typeof(TaskExtensions));\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void SuppressUnobservedExceptions(this Task task)\n        {\n            task.ContinueWithSynchronously(t => t.Exception?.Handle(x => true));\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithInBackground(this Task task, Action<Task> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.None,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithInBackground<T1>(this Task<T1> task, Action<Task<T1>> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.None,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T2> ContinueWithInBackground<T1, T2>(this Task<T1> task, Func<Task<T1>, T2> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.None,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> ContinueWithInBackground<T>(this Task task, Func<Task, T> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.None,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithInBackground(this Task task, Func<Task, Task> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.None,\n                TaskRunner.BackgroundScheduler).Unwrap();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously(this Task task, Action<Task> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously<T>(this Task<T> task, Action<Task<T>> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously(this Task task, Action<Task, object> func, object state,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> ContinueWithSynchronously<T>(this Task task, Func<Task, object, T> func, object state,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T2> ContinueWithSynchronously<T1, T2>(this Task<T1> task, Func<Task<T1>, object, T2> func, object state,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T2> ContinueWithSynchronously<T1, T2>(this Task<T1> task, Func<Task<T1>, object, Task<T2>> func, object state,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskRunner.BackgroundScheduler).Unwrap();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously(this Task task, Func<Task, object, Task> func, object state,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler).Unwrap();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> ContinueWithSynchronously<T>(this Task task, Func<Task, object, Task<T>> func,\n            object state, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler).Unwrap();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously(this Task task, object state, Action<Task, object> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously<T>(this Task<T> task, object state, Action<Task<T>, object> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(func, state, cancellationToken, TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithOnErrorSynchronously(this Task task, Action<Task> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(\n                func,\n                cancellationToken,\n                TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnFaulted,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T2> ContinueWithSynchronously<T1, T2>(this Task<T1> task, Func<Task<T1>, T2> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(\n                func,\n                cancellationToken,\n                TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> ContinueWithSynchronously<T>(this Task task, Func<Task, T> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(\n                func,\n                cancellationToken,\n                TaskContinuationOptions.ExecuteSynchronously,\n                TaskRunner.BackgroundScheduler);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task ContinueWithSynchronously(this Task task, Func<Task, Task> func,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWith(\n                    func,\n                    cancellationToken,\n                    TaskContinuationOptions.ExecuteSynchronously,\n                    TaskRunner.BackgroundScheduler)\n                .Unwrap();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task WithBackgroundContinuations(this Task task,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWithInBackground(t => t.GetResult(), cancellationToken);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> WithBackgroundContinuations<T>(this Task<T> task,\n            CancellationToken cancellationToken = new CancellationToken())\n        {\n            return task.ContinueWithInBackground(t => t.GetResult(), cancellationToken);\n        }\n\n        public static Task LogAndIgnoreExceptions(this Task task, ILogger log)\n        {\n            return task.ContinueWithSynchronously((Action<Task, object>) LogAndIgnoreExceptionsOnCompletedTask, log);\n        }\n\n        private static void LogAndIgnoreExceptionsOnCompletedTask(Task task, object state)\n        {\n            var logger = (ILogger) state;\n            if (task.IsFaulted)\n            {\n                logger.Error(task.Exception.ExtractInner(), \"Exception on non-awaited task\");\n            }\n        }\n\n        public static Task IgnoreExceptions(this Task task)\n        {\n            return task.ContinueWithSynchronously((Action<Task>) IgnoreExceptionsOnCompletedTask);\n        }\n\n        public static Task IgnoreAnyCancellation(this Task task)\n        {\n            return task.ContinueWithSynchronously((Action<Task>) IgnoreCancellationOnCompletedTask);\n        }\n\n        public static Task IgnoreCancellation(this Task task, CancellationToken cancellationToken)\n        {\n            return task.ContinueWithSynchronously(t => t.IgnoreCancellationOnCompletedTask(cancellationToken), CancellationToken.None);\n        }\n\n        private static void IgnoreExceptionsOnCompletedTask(this Task task)\n        {\n            bool HandleException(Exception e)\n            {\n                return true;\n            }\n\n            task.Exception?.Handle(HandleException);\n        }\n\n        private static void IgnoreCancellationOnCompletedTask(this Task task, CancellationToken cancellationToken)\n        {\n            if (!task.IsCanceled || !cancellationToken.IsCancellationRequested)\n            {\n                task.GetResult();\n            }\n        }\n\n        private static void IgnoreCancellationOnCompletedTask(this Task task)\n        {\n            if (!task.IsCanceled)\n            {\n                task.GetResult();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static T GetResult<T>(this Task<T> task)\n        {\n            return task.ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void GetResult(this Task task)\n        {\n            task.GetAwaiter().GetResult();\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void PropagateCompletionToPromise(this Task task, Promise promise)\n        {\n            if (task.IsCompleted)\n            {\n                PropagateCompletedTaskToPromise(task, promise);\n            }\n            else\n            {\n                task.ContinueWithSynchronously(promise, PropagateCompletedTaskToPromise);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void PropagateCompletedTaskToPromise(Task task, object promiseObj)\n        {\n            var promise = (Promise) promiseObj;\n            PropagateCompletedTaskToPromise(task, promise);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void PropagateCompletedTaskToPromise(Task task, Promise promise)\n        {\n            if (task.IsCanceled)\n            {\n                promise.TryCancel();\n            }\n            else if (task.IsFaulted)\n            {\n                promise.TryFail(task.Exception.InnerExceptions);\n            }\n            else\n            {\n                promise.TryComplete();\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void PropagateCompletionToPromise<T>(this Task<T> task, Promise<T> promise)\n        {\n            if (task.IsCompleted)\n            {\n                PropagateCompletedTaskToPromise(task, promise);\n            }\n            else\n            {\n                task.ContinueWithSynchronously<T>(promise, PropagateCompletedTaskToPromise);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void PropagateCompletedTaskToPromise<T>(Task<T> task, object promiseObj)\n        {\n            var promise = (Promise<T>) promiseObj;\n            PropagateCompletedTaskToPromise(task, promise);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void PropagateCompletedTaskToPromise<T>(Task<T> task, Promise<T> promise)\n        {\n            if (task.IsCanceled)\n            {\n                promise.TryCancel();\n            }\n            else if (task.IsFaulted)\n            {\n                promise.TryFail(task.Exception.InnerExceptions);\n            }\n            else\n            {\n                promise.TryComplete(task.Result);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> WithTimeoutAsync<T>(this ValueTask<T> task, TimeSpan timeout)\n        {\n            return task.AsTask().WithTimeoutAsync(timeout);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task WithTimeoutAsync(this Task task, TimeSpan timeout)\n        {\n            var timeoutPromise = new Promise();\n            using (var cancellation = new CancellationTokenSource(timeout))\n            using (cancellation.Token.Register(() => timeoutPromise.TryCancel(), false))\n            {\n                var completed = await Task.WhenAny(task, timeoutPromise.Task).ConfigureAwait(false);\n                if (completed == task)\n                {\n                    task.GetResult();\n                }\n                else\n                {\n                    throw new TimeoutException(\n                        $\"Task did not completed in the specified timeout {timeout.TotalMilliseconds}ms\");\n                }\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static async Task<T> WithTimeoutAsync<T>(this Task<T> task, TimeSpan timeout)\n        {\n            var timeoutPromise = new Promise();\n            using (var cancellation = new CancellationTokenSource(timeout))\n            using (cancellation.Token.Register(() => timeoutPromise.TryCancel()))\n            {\n                var completed = await Task.WhenAny(task, timeoutPromise.Task).ConfigureAwait(false);\n                if (completed == task)\n                {\n                    return task.GetResult();\n                }\n                else\n                {\n                    throw new TimeoutException(\n                        $\"Task did not completed in the specified timeout {timeout.TotalMilliseconds}ms\");\n                }\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ConfiguredTaskAwaitable ConfigureAwaitWithTimeout(this Task task, TimeSpan timeout)\n        {\n            return task.WithTimeoutAsync(timeout).ConfigureAwait(false);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ConfiguredTaskAwaitable<T> ConfigureAwaitWithTimeout<T>(this Task<T> task, TimeSpan timeout)\n        {\n            return task.WithTimeoutAsync(timeout).ConfigureAwait(false);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ConfiguredTaskAwaitable<T> ConfigureAwaitWithTimeout<T>(this ValueTask<T> task, TimeSpan timeout)\n        {\n            return task.WithTimeoutAsync(timeout).ConfigureAwait(false);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static ValueTask<T> AsValueTask<T>(this Task<T> task)\n        {\n            return new ValueTask<T>(task);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<T> WithCancellation<T>(\n            this Task<T> task, \n            CancellationToken cancellationToken, \n            Action<Task<T>> disposeAction = null)\n        {\n            if (!cancellationToken.CanBeCanceled || task.IsCompleted)\n            {\n                return task;\n            }\n            if (cancellationToken.IsCancellationRequested)\n            {\n                return TaskConstants<T>.Canceled;\n            }            \n\n            return WithCancellationAsync(task, cancellationToken, disposeAction);\n        }        \n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task WithCancellation(\n            this Task task, \n            CancellationToken cancellationToken, \n            Action<Task> disposeAction = null)\n        {\n            if (!cancellationToken.CanBeCanceled || task.IsCompleted)\n            {\n                return task;\n            }\n            if (cancellationToken.IsCancellationRequested)\n            {\n                return TaskConstants.Canceled;\n            }\n\n            return task.ToNothingTask().WithCancellation(cancellationToken);\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task<Nothing> ToNothingTask(this Task task)\n        {\n            return task.ContinueWithSynchronously((Func<Task, Nothing>)ReturnNothingOnCompletion);\n        }\n\n        private static Nothing ReturnNothingOnCompletion(Task task)\n        {\n            if (task.Status != TaskStatus.RanToCompletion)\n            {\n                task.GetResult();\n            }            \n            return Nothing.Instance;\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static async Task<T> WithCancellationAsync<T>(Task<T> task, CancellationToken cancellationToken, Action<Task<T>> disposeAction = null)\n        {\n            var cancellationPromise = new Promise<T>();\n            using (cancellationToken.Register(\n                CancelPromise<T>,\n                cancellationPromise,\n                false))\n            {\n                if (cancellationToken.IsCancellationRequested)\n                {\n                    cancellationPromise.TryCancel();\n                }\n                var completedTask = await Task.WhenAny(task, cancellationPromise.Task).ConfigureAwait(false);\n                if (completedTask != task)\n                {\n                    if (disposeAction != null)\n                    {\n                        task.ContinueWithSynchronously(disposeAction, CancellationToken.None).IgnoreAwait(Log);\n                    }\n                    else\n                    {\n                        task.IgnoreAwait(Log);\n                    }\n                }\n                return completedTask.GetResult();\n            }\n        }\n\n        private static void CancelPromise<T>(object state)\n        {\n            var promise = (Promise<T>) state;\n            promise.TryCancel();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskHelper.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Threading.Tasks;\n\n    public static class TaskHelper\n    {\n        public static Task CompletedTask\n        {\n            get\n            {\n#if NET45\n                return Task.FromResult<object>(null);\n#else\n                return Task.CompletedTask;\n#endif\n            }\n        }\n\n#pragma warning disable 1998\n        public static async Task FromException(Exception exception)\n#pragma warning restore 1998\n        {\n            throw exception;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskLoggingExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing JetBrains.Annotations;\n/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Runtime.CompilerServices;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal static class TaskLoggingExtensions\n    {\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void IgnoreAwait(this Task task, ILogger log = null)\n        {\n            log = log ?? NoopLogger.Instance;\n            task.IgnoreAwait(log, \"Exception in non-awaited task\");\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void IgnoreAwait(this Task task, ILogger log, string message)\n        {\n            task.LogExceptions(log, message);\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void IgnoreAwait<T1>(this Task task, ILogger log, string message, T1 arg1)\n        {\n            task.LogExceptions(log, message, arg1);\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void IgnoreAwait<T1, T2>(this Task task, ILogger log, string message, T1 arg1, T2 arg2)\n        {\n            task.LogExceptions(log, message, arg1, arg2);\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void IgnoreAwait<T1, T2, T3>(this Task task, ILogger log, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            task.LogExceptions(log, message, arg1, arg2, arg3);\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task LogExceptions(this Task task, ILogger log, string message)\n        {\n            if (task.Status == TaskStatus.RanToCompletion)\n            {\n                return task;\n            }\n\n            void LogExceptionsOnCompletion(Task t)\n            {\n                if (t.Exception == null)\n                {\n                    return;\n                }\n\n                LogExceptionsOnCompletionInternal(t, log, message);\n            }\n\n            task.ContinueWithSynchronously((Action<Task>)LogExceptionsOnCompletion);\n\n            return task;\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task LogExceptions<T1>(this Task task, ILogger log, string message, T1 arg1)\n        {\n            if (task.Status == TaskStatus.RanToCompletion)\n            {\n                return task;\n            }\n\n            void LogExceptionsOnCompletion(Task t)\n            {\n                if (t.Exception == null)\n                {\n                    return;\n                }\n\n                LogExceptionsOnCompletionInternal(t, log, message, arg1);\n            }\n\n            task.ContinueWithSynchronously((Action<Task>)LogExceptionsOnCompletion);\n\n            return task;\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task LogExceptions<T1, T2>(this Task task, ILogger log, string message, T1 arg1, T2 arg2)\n        {\n            if (task.Status == TaskStatus.RanToCompletion)\n            {\n                return task;\n            }\n\n            void LogExceptionsOnCompletion(Task t)\n            {\n                if (t.Exception == null)\n                {\n                    return;\n                }\n\n                LogExceptionsOnCompletionInternal(t, log, message, arg1, arg2);\n            }\n\n            task.ContinueWithSynchronously((Action<Task>)LogExceptionsOnCompletion);\n\n            return task;\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task LogExceptions<T1, T2, T3>(this Task task, ILogger log, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            if (task.Status == TaskStatus.RanToCompletion)\n            {\n                return task;\n            }\n\n            void LogExceptionsOnCompletion(Task t)\n            {\n                if (t.Exception == null)\n                {\n                    return;\n                }\n\n                LogExceptionsOnCompletionInternal(t, log, message, arg1, arg2, arg3);\n            }\n\n            task.ContinueWithSynchronously((Action<Task>)LogExceptionsOnCompletion);\n\n            return task;\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void LogExceptionsOnCompletionInternal(Task t, ILogger log, string message)\n        {\n            foreach (var innerException in t.Exception.InnerExceptions)\n            {\n                log.Error(innerException, message);\n            }\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void LogExceptionsOnCompletionInternal<T1>(Task t, ILogger log, string message, T1 arg1)\n        {\n            foreach (var innerException in t.Exception.InnerExceptions)\n            {\n                log.Error(innerException, message, arg1);\n            }\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void LogExceptionsOnCompletionInternal<T1, T2>(Task t, ILogger log, string message, T1 arg1, T2 arg2)\n        {\n            foreach (var innerException in t.Exception.InnerExceptions)\n            {\n                log.Error(innerException, message, arg1, arg2);\n            }\n        }\n\n        [StringFormatMethod(\"message\")]\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private static void LogExceptionsOnCompletionInternal<T1, T2, T3>(Task t, ILogger log, string message, T1 arg1, T2 arg2, T3 arg3)\n        {\n            foreach (var innerException in t.Exception.InnerExceptions)\n            {\n                log.Error(innerException, message, arg1, arg2, arg3);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Task LogCompletion(this Task task, ILogger log)\n        {\n            task.SuppressUnobservedExceptions();\n            if (task.IsCompleted)\n            {\n                LogCompletionInternal(task, log);\n            }\n            task.ContinueWithSynchronously(\n                (Action<Task, object>) LogCompletionInternal, log);\n            return task;\n        }\n\n        private static void LogCompletionInternal(Task task, object state)\n        {\n            var log = (ILogger)state;\n            if (task.IsCanceled)\n            {\n                log.Trace(\"Canceled\");\n            }\n            else if (task.IsFaulted)\n            {\n                log.Trace(\"Faulted: {0}\", task.Exception.ExtractInner().FormatTypeAndMessage());\n            }\n            else\n            {\n                log.Trace(\"Completed\");\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static string GetCompletionDescription(this Task task)\n        {\n            if (!task.IsCompleted)\n            {\n                return \"NOT Completed\";\n            }\n            if (task.IsCanceled)\n            {\n                return \"Canceled\";\n            }\n            return task.IsFaulted \n                ? $\"Faulted: {task.Exception.ExtractInner().FormatTypeAndMessage()}\" \n                : \"Completed\";\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TaskRunner.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Threading;\n    using System.Threading.Tasks;\n\n    internal static class TaskRunner\n    {\n        public static TaskScheduler BackgroundScheduler { get; set; } = TaskScheduler.Default;\n\n        public static Task RunInBackground(Action action, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler);\n        }\n\n        public static Task RunInBackground(Action<object> action, object state, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, state, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler);\n        }\n\n        public static Task RunInBackground(Func<object, Task> action, object state, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, state, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler).Unwrap();\n        }\n\n        public static Task<T> RunInBackground<T>(Func<T> action, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler);\n        }\n\n        public static Task<T> RunInBackground<T>(Func<Task<T>> action, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler).Unwrap();\n        }\n\n        public static Task RunInBackground(Func<Task> action, CancellationToken cancellationToken = new CancellationToken())\n        {\n            return Task.Factory.StartNew(action, cancellationToken, TaskCreationOptions.PreferFairness, BackgroundScheduler).Unwrap();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/TimeoutConstants.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n\n    internal static class TimeoutConstants\n    {\n        public static readonly double TimeoutMultiplier = EnvironmentHelper.GetPlexusTimeoutMultiplier();\n\n        public static readonly TimeSpan Timeout10Ms = TimeSpan.FromMilliseconds(10 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout50Ms = TimeSpan.FromMilliseconds(50 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout100Ms = TimeSpan.FromMilliseconds(100 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout250Ms = TimeSpan.FromMilliseconds(250 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout500Ms = TimeSpan.FromMilliseconds(500 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout1Sec = TimeSpan.FromSeconds(1 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout3Sec = TimeSpan.FromSeconds(3 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout5Sec = TimeSpan.FromSeconds(5 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout10Sec = TimeSpan.FromSeconds(10 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout20Sec = TimeSpan.FromSeconds(20 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout30Sec = TimeSpan.FromSeconds(30 * TimeoutMultiplier);\n        public static readonly TimeSpan Timeout1Min = TimeSpan.FromMinutes(1 * TimeoutMultiplier);\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils/ValueTask.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Threading.Tasks;\n\n    internal static class ValueTask\n    {\n        public static ValueTask<T> FromResult<T>(T result)\n        {\n            return new ValueTask<T>(result);\n        }\n\n        public static ValueTask<T> FromTask<T>(Task<T> task)\n        {\n            return new ValueTask<T>(task);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/DisplayTestMethodNameAttribute.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System.Reflection;\n    using Xunit.Sdk;\n\n    internal sealed class DisplayTestMethodNameAttribute : BeforeAfterTestAttribute\n    {\n        private static readonly ILogger Log = LogManager.GetLogger<DisplayTestMethodNameAttribute>();\n\n        public override void Before(MethodInfo methodUnderTest)\n        {\n            Log.Info(\"Running {0}.{1}\", methodUnderTest.DeclaringType.FullName, methodUnderTest.Name);\n        }\n\n        public override void After(MethodInfo methodUnderTest)\n        {\n            Log.Info(\"Finished {0}.{1}\", methodUnderTest.DeclaringType.FullName, methodUnderTest.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/Plexus.Utils.Testing.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netstandard2.0;net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net45</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netstandard2.0</TargetFrameworks>\n    <AssemblyName>Plexus.Utils.Testing</AssemblyName>\n    <RootNamespace>Plexus</RootNamespace>\n    <IsPackable>false</IsPackable>\n\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Logging.NLog\\Plexus.Logging.NLog.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Logging\\Plexus.Logging.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Appveyor.TestLogger\" Version=\"2.0.0\" />\n    <PackageReference Include=\"OpenCover\" Version=\"4.7.922\" />\n    <PackageReference Include=\"ReportGenerator\" Version=\"4.0.14\" />\n    <PackageReference Include=\"Shouldly\" Version=\"3.0.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />    \n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <DotNetCliToolReference Include=\"dotnet-xunit\" Version=\"2.3.1\" />\n    <PackageReference Include=\"XunitXml.TestLogger\" Version=\"2.1.26\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/RandomExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus\n{\n    public static class RandomExtensions\n    {\n        public static byte[] GetRandomBytes(this Random random, int length)\n        {\n            var bytes = new byte[length];\n            random.NextBytes(bytes);\n            return bytes;\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/ShoudlyExtensions.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{\n    using Shouldly;\n    using System;\n    using System.Threading.Tasks;\n\n    public static class ShoudlyExtensions\n    {\n        public static void ShouldCompleteIn(this Task task, TimeSpan timeout)\n        {\n            Should.CompleteIn(task, timeout);\n        }\n\n        public static void ShouldThrow<TException>(this Task task, TimeSpan timeout) where TException : Exception\n        {\n            Should.Throw<TException>(task, timeout);\n        }\n\n        public static T ShouldCompleteIn<T>(this Task<T> task, TimeSpan timeout)\n        {\n            return Should.CompleteIn(task, timeout);\n        }\n\n        public static T ShouldCompleteIn<T>(this ValueTask<T> task, TimeSpan timeout)\n        {\n            return Should.CompleteIn(task.AsTask(), timeout);\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/TestingInitializer.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿using System;\n\nnamespace Plexus\n{\n    using Plexus.Logging.NLog;\n    using System.IO;\n    using System.Reflection;\n\n    public sealed class TestingInitializer : IDisposable\n    {\n        private readonly LoggingInitializer _logging;\n\n        static TestingInitializer()\n        {\n            var location = Path.GetDirectoryName(Assembly.GetAssembly(typeof(LoggingInitializer)).Location);\n            Environment.SetEnvironmentVariable(\"PLEXUS_LOG_DIR\", $\"{location}/logs\");\n        }\n\n        public TestingInitializer()\n        {\n            _logging = new LoggingInitializer();\n            LogManager.GetLogger<TestingInitializer>().Info(\"Initializing tests session\");\n        }\n\n        public void Dispose()\n        {\n            LogManager.GetLogger<TestingInitializer>().Info(\"Disposing tests session\");\n            _logging.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing/TestsSuite.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Collections.Concurrent;\n    using System.Diagnostics;\n    using System.Security.Cryptography;\n    using System.Threading;\n    using System.Threading.Tasks;\n    using Xunit;\n    using Xunit.Abstractions;\n\n    [Collection(\"Default\")]\n    [DisplayTestMethodName]\n    public abstract class TestsSuite : IDisposable\n    {\n        private readonly ConcurrentStack<IDisposable> _disposables = new ConcurrentStack<IDisposable>();\n\n        protected static readonly Random Random = new Random(42);\n\n        protected static readonly SHA256 Sha256 = SHA256.Create();\n\n        protected static readonly TimeSpan Timeout10Ms = TimeoutConstants.Timeout10Ms;\n        protected static readonly TimeSpan Timeout50Ms = TimeoutConstants.Timeout50Ms;\n        protected static readonly TimeSpan Timeout100Ms = TimeoutConstants.Timeout100Ms;\n        protected static readonly TimeSpan Timeout250Ms = TimeoutConstants.Timeout250Ms;\n        protected static readonly TimeSpan Timeout500Ms = TimeoutConstants.Timeout500Ms;\n        protected static readonly TimeSpan Timeout1Sec = TimeoutConstants.Timeout1Sec;\n        protected static readonly TimeSpan Timeout5Sec = TimeoutConstants.Timeout5Sec;\n        protected static readonly TimeSpan Timeout10Sec = TimeoutConstants.Timeout10Sec;\n        protected static readonly TimeSpan Timeout20Sec = TimeoutConstants.Timeout20Sec;\n        protected static readonly TimeSpan Timeout30Sec = TimeoutConstants.Timeout30Sec;\n\n        protected ITestOutputHelper Console { get; }\n\n        protected TestsSuite() : this(null)\n        {\n        }\n\n        protected TestsSuite(ITestOutputHelper output)\n        {            \n            Console = output;\n            Log = LogManager.GetLogger(GetType());\n        }\n\n        protected void WriteLog(string message)\n        {\n            Log.Info(message);\n            Console?.WriteLine(message);\n        }\n\n        protected ILogger Log { get; }\n\n        protected T RegisterDisposable<T>(T disposable) where T : IDisposable\n        {\n            _disposables.Push(disposable);\n            return disposable;\n        }\n\n        protected void RunWith30SecTimeout(Func<Task> func) => RunWithTimeout(Timeout30Sec, func);\n        protected void RunWith30SecTimeout(Action action) => RunWithTimeout(Timeout30Sec, action);\n        protected void RunWith20SecTimeout(Func<Task> func) => RunWithTimeout(Timeout20Sec, func);\n        protected void RunWith20SecTimeout(Action action) => RunWithTimeout(Timeout20Sec, action);\n        protected void RunWith10SecTimeout(Func<Task> func) => RunWithTimeout(Timeout10Sec, func);\n        protected void RunWith10SecTimeout(Action action) => RunWithTimeout(Timeout10Sec, action);\n        protected void RunWith5SecTimeout(Func<Task> func) => RunWithTimeout(Timeout5Sec, func);\n        protected void RunWith5SecTimeout(Action action) => RunWithTimeout(Timeout5Sec, action);\n        protected void RunWith1SecTimeout(Func<Task> func) => RunWithTimeout(Timeout1Sec, func);\n        protected void RunWith1SecTimeout(Action action) => RunWithTimeout(Timeout1Sec, action);\n\n        protected void RunWithTimeout(TimeSpan timeout, Func<Task> func)\n        {\n            if (Debugger.IsAttached)\n            {\n                TaskRunner.RunInBackground(func).GetResult();\n                return;\n            }\n            using (var cancellation = new CancellationTokenSource(timeout))\n            {\n                try\n                {\n                    TaskRunner\n                        .RunInBackground(func, cancellation.Token)\n                        .WithCancellation(cancellation.Token)\n                        .GetResult();\n                }\n                catch (OperationCanceledException) when (cancellation.IsCancellationRequested)\n                {\n                    throw new TimeoutException($\"Task not completed after {timeout.TotalMilliseconds} ms\");\n                }\n            }\n        }\n\n        protected void RunWithTimeout(TimeSpan timeout, Action action)\n            => RunWithTimeout(\n                timeout,\n                () =>\n                {\n                    action();\n                    return TaskConstants.Completed;\n                });\n\n        public virtual void Dispose()\n        {\n            RunWith5SecTimeout(\n                () =>\n                {\n                    WriteLog(\"Disposing test resources\");\n                    while (_disposables.TryPop(out var disposable))\n                    {\n                        WriteLog($\"Disposing {disposable.GetType().FullName}\");\n                        disposable.Dispose();\n                        WriteLog($\"Disposed {disposable.GetType().FullName}\");\n                    }\n                    WriteLog(\"Test resources disposed\");\n                });\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing.Shared/DefaultTestCollection.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nusing Xunit;\n\n// ReSharper disable once CheckNamespace\nnamespace Plexus\n{\n    [CollectionDefinition(\"Default\")]\n    public class DefaultTestCollection : ICollectionFixture<TestingInitializer>\n    {\n        // This class has no code, and is never created. Its purpose is simply\n        // to be the place to apply [CollectionDefinition] and all the\n        // ICollectionFixture<> interfaces.\n    }\n}\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing.Shared/NLog.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      throwExceptions=\"true\"\n      internalLogFile=\"logs/Plexus.Tests.NLog.Internal.log\"\n      internalLogLevel=\"Info\"\n      >\n\n  <variable name=\"defaultLayout\"\n            value=\"${longdate} | ${level:uppercase=true:padding=5:fixedLength=true} | ${threadid:padding=5:fixedLength=true} | ${logger} | ${message}${onexception: |${newline}${exception:format=ToString}}\"/>\n\n  <variable name=\"logsDir\" value=\"${when:when='${environment:PLEXUS_LOG_DIR}'='':inner=logs:else=${environment:PLEXUS_LOG_DIR}}\" />\n\n  <targets>\n    <target xsi:type=\"AsyncWrapper\"\n            name=\"AsyncFileTarget\"\n            overflowAction=\"Discard\">\n      <target xsi:type=\"File\"\n              layout=\"${defaultLayout}\"\n              deleteOldFileOnStartup=\"true\"\n              fileName=\"${logsDir}/Plexus.Tests.log\"\n              keepFileOpen=\"true\"\n              concurrentWrites=\"false\"\n              maxArchiveFiles=\"0\" />\n    </target>\n    <target xsi:type=\"AsyncWrapper\"\n            name=\"AsyncTransportFileTarget\"\n            overflowAction=\"Discard\">\n      <target xsi:type=\"File\"\n              layout=\"${defaultLayout}\"\n              deleteOldFileOnStartup=\"true\"\n              fileName=\"${logsDir}/Plexus.Tests.Transport.log\"\n              keepFileOpen=\"true\"\n              concurrentWrites=\"false\"\n              maxArchiveFiles=\"0\" />\n    </target>\n    <target xsi:type=\"AsyncWrapper\"\n            name=\"AsyncPoolsFileTarget\"\n            overflowAction=\"Discard\">\n      <target xsi:type=\"File\"              \n              layout=\"${defaultLayout}\"\n              deleteOldFileOnStartup=\"true\"\n              fileName=\"${logsDir}/Plexus.Pools.log\"\n              keepFileOpen=\"false\"\n              maxArchiveFiles=\"0\" />\n    </target>\n  </targets>\n  <rules>\n    <logger name=\"Plexus.Interop.Transport.*\" writeTo=\"AsyncTransportFileTarget\" minlevel=\"Trace\" final=\"true\" />\n    <logger name=\"Plexus.Pools.*\" writeTo=\"AsyncPoolsFileTarget\" minlevel=\"Trace\" final=\"true\" />\n    <logger name=\"Microsoft.AspNetCore.*\" writeTo=\"AsyncTransportFileTarget\" minlevel=\"Trace\" final=\"true\" />    \n    <logger name=\"*\" writeTo=\"AsyncFileTarget\" minlevel=\"Trace\" />    \n  </rules>\n</nlog>"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing.Shared/Plexus.Utils.Testing.Shared.projitems",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>\n    <HasSharedItems>true</HasSharedItems>\n    <SharedGUID>ada01827-8218-4182-ad83-a25fc36ddd95</SharedGUID>\n  </PropertyGroup>\n  <PropertyGroup Label=\"Configuration\">\n    <Import_RootNamespace>Plexus</Import_RootNamespace>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"$(MSBuildThisFileDirectory)DefaultTestCollection.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"$(MSBuildThisFileDirectory)NLog.config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Utils.Testing.Shared/Plexus.Utils.Testing.Shared.shproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>ada01827-8218-4182-ad83-a25fc36ddd95</ProjectGuid>\n    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.Default.props\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.props\" />\n  <PropertyGroup />\n  <Import Project=\"Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.CSharp.targets\" />\n</Project>\n"
  },
  {
    "path": "desktop/src/Plexus.Utils.Tests/Channels/BufferedChannelTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus.Channels\n{\n    using System;\n    using System.Linq;\n    using System.Threading.Tasks;\n    using Shouldly;\n    using Xunit;\n\n    public sealed class BufferedChannelTests : TestsSuite\n    {\n        [Fact]\n        public void TryWriteReturnsFalseWhenBufferIsFull()\n        {\n            var sut = new BufferedChannel<int>(0);\n            sut.TryWrite(1).ShouldBe(false);\n        }\n\n        [Fact]\n        public void TryWriteReturnsTrueWhenBufferIsNotFull()\n        {\n            var sut = new BufferedChannel<int>(1);\n            sut.TryWrite(1).ShouldBe(true);\n        }\n\n        [Fact]\n        public void TryReadReturnsFalseWhenBufferIsEmpty()\n        {\n            var sut = new BufferedChannel<int>(1);\n            sut.TryRead(out int _).ShouldBe(false);\n        }\n\n        [Fact]\n        public void TryReadReturnsTrueWhenBufferIsNotEmpty()\n        {\n            var sut = new BufferedChannel<int>(1);\n            sut.TryWrite(1).ShouldBe(true);\n            sut.TryRead(out int _).ShouldBe(true);\n        }\n\n        [Fact]\n        public void WritesSynchronouslyWhenBufferHasSpace()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryWrite(1).ShouldBe(true);\n            sut.TryWrite(2).ShouldBe(true);\n            sut.TryWrite(3).ShouldBe(false);\n            sut.TryRead(out int item).ShouldBe(true);\n            item.ShouldBe(1);\n            sut.TryWrite(4).ShouldBe(true);\n        }\n\n        [Fact]\n        public void WriteAsyncCompletesWhenThereIsBufferSpaceAvailable()\n        {\n            var sut = new BufferedChannel<int>(1);\n            Should.CompleteIn(sut.WriteAsync(1), Timeout1Sec);\n            var writeTask = sut.WriteAsync(2);\n            writeTask.IsCompleted.ShouldBe(false);\n            sut.TryRead(out var item).ShouldBe(true);\n            item.ShouldBe(1);\n            Should.CompleteIn(writeTask, Timeout1Sec);\n            sut.TryRead(out item).ShouldBe(true);\n            item.ShouldBe(2);\n        }\n\n        [Fact]\n        public void TryCompleteReturnsFalseIfChannelIsAlreadyCompleted()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryComplete().ShouldBe(true);\n            sut.TryComplete().ShouldBe(false);\n        }\n\n        [Fact]\n        public void CompleteThrowsExceptionIfChannelIsAlreadyCompleted()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryComplete().ShouldBe(true);\n            Should.Throw<OperationCanceledException>(() => sut.Complete());\n        }\n\n        [Fact]\n        public void CompletionSuccessfulAfterCompleteCalledWithoutException()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.Complete();\n            sut.Completion.Status.ShouldBe(TaskStatus.RanToCompletion);\n        }\n\n        [Fact]\n        public void CompletionSuccessfulAfterTryCompleteCalledWithoutException()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryComplete();\n            sut.Completion.Status.ShouldBe(TaskStatus.RanToCompletion);\n        }\n\n        [Fact]\n        public void CompletionHasErrorAfterCompleteCalledWithException()\n        {\n            var sut = new BufferedChannel<int>(2);\n            var exception = new ArgumentOutOfRangeException();\n            sut.Terminate(exception);\n            sut.Completion.IsFaulted.ShouldBe(true);\n            sut.Completion.Exception.ShouldNotBe(null);\n            sut.Completion.Exception.InnerException.ShouldBe(exception);\n        }\n\n        [Fact]\n        public void CompletionHasErrorAfterFail()\n        {\n            var sut = new BufferedChannel<int>(2);\n            var exception = new ArgumentOutOfRangeException();\n            sut.Terminate(exception);\n            sut.Completion.IsFaulted.ShouldBe(true);\n            sut.Completion.Exception.ShouldNotBe(null);\n            sut.Completion.Exception.InnerException.ShouldBe(exception);\n        }\n\n        [Fact]\n        public void CompletionIsCanceledAfterCancellation()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.Terminate();\n            sut.Completion.IsCanceled.ShouldBe(true);\n            sut.Completion.Exception.ShouldBeNull();\n        }\n\n        [Fact]\n        public void CannotWriteAfterCompletion()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryWrite(1);\n            sut.Complete();\n            sut.TryWrite(2).ShouldBe(false);\n            Should.Throw<OperationCanceledException>(() => sut.WriteAsync(2));\n        }\n\n        [Fact]\n        public void CanReadAfterCompletionUntilBufferIsEmpty()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryWrite(1);\n            sut.TryWrite(2);\n            sut.TryComplete();\n            sut.Completion.IsCompleted.ShouldBe(false);\n            sut.TryRead(out int _).ShouldBe(true);\n            sut.Completion.IsCompleted.ShouldBe(false);\n            sut.TryRead(out int _).ShouldBe(true);\n            sut.Completion.IsCompleted.ShouldBe(true);\n            sut.TryRead(out int _).ShouldBe(false);\n            Should.Throw<TaskCanceledException>(() => sut.ReadAsync().AsTask());\n        }\n\n        [Fact]\n        public void CompleteAbortsPendingWriteTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var writeTask1 = sut.WriteAsync(1);\n            var writeTask2 = sut.WriteAsync(2);\n            sut.Complete();\n            Should.Throw<TaskCanceledException>(() => writeTask1, Timeout1Sec);\n            Should.Throw<TaskCanceledException>(() => writeTask2, Timeout1Sec);\n        }\n\n        [Fact]\n        public void CompleteAbortsPendingReadTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var readTask1 = sut.ReadAsync();\n            var readTask2 = sut.ReadAsync();\n            sut.Complete();\n            Should.Throw<TaskCanceledException>(() => readTask1.AsTask(), Timeout1Sec);\n            Should.Throw<TaskCanceledException>(() => readTask2.AsTask(), Timeout1Sec);\n        }\n\n        [Fact]\n        public void CancellationCancelsReadTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var task1 = sut.TryReadAsync();\n            var task2 = sut.TryReadAsync();\n            sut.Terminate();\n            Should.Throw<OperationCanceledException>(task1.AsTask(), Timeout1Sec);\n            Should.Throw<OperationCanceledException>(task2.AsTask(), Timeout1Sec);\n        }\n\n        [Fact]\n        public void CancellationCancelsWriteTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var task1 = sut.TryWriteAsync(1);\n            var task2 = sut.TryWriteAsync(1);\n            sut.Terminate();\n            Should.Throw<OperationCanceledException>(task1, Timeout1Sec);\n            Should.Throw<OperationCanceledException>(task2, Timeout1Sec);\n        }\n\n        [Fact]\n        public void FailCancelsReadTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var task1 = sut.TryReadAsync();\n            var task2 = sut.TryReadAsync();\n            sut.Terminate(new InvalidOperationException());\n            Should.Throw<InvalidOperationException>(task1.AsTask(), Timeout1Sec);\n            Should.Throw<InvalidOperationException>(task2.AsTask(), Timeout1Sec);\n        }\n\n        [Fact]\n        public void FailCancelsWriteTasks()\n        {\n            var sut = new BufferedChannel<int>(0);\n            var task1 = sut.TryWriteAsync(1);\n            var task2 = sut.TryWriteAsync(1);\n            sut.Terminate(new InvalidOperationException());\n            Should.Throw<InvalidOperationException>(task1, Timeout1Sec);\n            Should.Throw<InvalidOperationException>(task2, Timeout1Sec);\n        }\n\n        [Fact]\n        public void CancellationCompletesChannel()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryWrite(1);\n            sut.TryWrite(2);\n            sut.Terminate();\n            sut.Completion.IsCompleted.ShouldBe(false);\n            sut.TryRead(out int _).ShouldBe(true);\n            sut.TryRead(out int _).ShouldBe(true);\n            Should.Throw<TaskCanceledException>(sut.TryReadAsync().AsTask(), Timeout1Sec);\n            sut.Completion.IsCanceled.ShouldBeTrue();\n        }\n\n        [Fact]\n        public void TerminationCompletesChannelWithException()\n        {\n            var sut = new BufferedChannel<int>(2);\n            sut.TryWrite(1);\n            sut.TryWrite(2);\n            sut.Terminate(new InvalidOperationException());\n            sut.Completion.IsCompleted.ShouldBe(false);\n            sut.TryRead(out int _).ShouldBe(true);\n            sut.TryRead(out int _).ShouldBe(true);\n            Should.Throw<InvalidOperationException>(() => sut.TryReadAsync().AsTask(), Timeout1Sec);\n            sut.Completion.IsFaulted.ShouldBeTrue();\n        }\n\n        [Fact]\n        public void ThrowsExceptionIfNegativeBufferSizeSpecified()\n        {\n            // ReSharper disable once ObjectCreationAsStatement\n            Should.Throw<ArgumentOutOfRangeException>(() => new BufferedChannel<int>(-1));\n        }\n\n        [Fact]\n        public void TerminatesOnWriteTimeout()\n        {\n            var sut = new BufferedChannel<int>(1, Timeout100Ms);\n            Should.NotThrow(sut.WriteAsync(1), Timeout1Sec);\n            sut.TryWrite(1).ShouldBe(false);\n            Should.Throw<ChannelWriteTimeoutException>(sut.WaitWriteAvailableAsync(), Timeout1Sec);\n            Should.Throw<ChannelWriteTimeoutException>(sut.Out.Completion, Timeout1Sec);\n            sut.TryRead(out _).ShouldBe(true);\n            Should.Throw<Exception>(sut.Completion, Timeout1Sec);\n        }\n\n        [Fact]\n        public async Task SlidesWriteTimeoutAfterWriteAvailable()\n        {\n            var sut = new BufferedChannel<int>(1, Timeout50Ms);\n            sut.TryWrite(1).ShouldBe(true);\n            await Task.Delay(Timeout10Ms).ConfigureAwait(false);\n            sut.TryRead(out _).ShouldBe(true);\n            await Task.Delay(Timeout100Ms).ConfigureAwait(false);\n            sut.Out.Completion.IsCompleted.ShouldBeFalse();\n            Should.NotThrow(() => sut.WriteAsync(1), Timeout1Sec);\n            await Task.Delay(Timeout10Ms).ConfigureAwait(false);\n            sut.TryRead(out _).ShouldBe(true);\n        }\n\n        [Theory]\n        [InlineData(1, 1, 1)]\n        [InlineData(1, 1, 3)]\n        [InlineData(1, 1, 10)]\n        [InlineData(2, 1, 1)]\n        [InlineData(2, 1, 3)]\n        [InlineData(2, 1, 10)]\n        [InlineData(1, 2, 1)]\n        [InlineData(1, 2, 3)]\n        [InlineData(1, 2, 10)]\n        [InlineData(2, 2, 1)]\n        [InlineData(2, 2, 3)]\n        [InlineData(2, 2, 10)]\n        [InlineData(4, 4, 1)]\n        [InlineData(4, 4, 3)]\n        [InlineData(4, 4, 10)]\n        [InlineData(7, 3, 1)]\n        [InlineData(7, 3, 3)]\n        [InlineData(7, 3, 10)]\n        [InlineData(3, 7, 1)]\n        [InlineData(3, 7, 3)]\n        [InlineData(3, 7, 10)]\n#pragma warning disable xUnit1026 // Theory methods should use all of their parameters\n        public void CanWriteAndReadFromSeveralThreadsConcurrently(int writeThreads, int readThreads, int bufferSize)\n#pragma warning restore xUnit1026 // Theory methods should use all of their parameters\n        {\n            var writeCount = readThreads * 100;\n            var readCount = writeThreads * 100;\n            var sut = new BufferedChannel<int>(bufferSize);\n\n            async Task WriteWorker()\n            {\n                for (var i = 0; i < writeCount; i++)\n                {\n                    await sut.WriteAsync(i).ConfigureAwait(false);\n                }\n            }\n\n            async Task ReadWorker()\n            {\n                for (var i = 0; i < readCount; i++)\n                {\n                    await sut.ReadAsync().ConfigureAwait(false);\n                }\n            }\n\n            var writeTasks = Enumerable.Range(0, writeThreads).Select(_ => Task.Run(WriteWorker));\n            var readTasks = Enumerable.Range(0, readThreads).Select(_ => Task.Run(ReadWorker));\n            var allTasks = writeTasks.Concat(readTasks).ToArray();\n\n            Task.WhenAll(allTasks).ShouldCompleteIn(Timeout10Sec);\n\n            sut.TryRead(out int _).ShouldBe(false);\n            sut.TryComplete().ShouldBe(true);\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils.Tests/Plexus.Utils.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <Import Project=\"../Common.csproj\" />\n\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' == '' And '$(NET4_ONLY)' == ''\">netcoreapp2.1;net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(NET4_ONLY)' != ''\">net452</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(CORE_ONLY)' != ''\">netcoreapp2.1</TargetFrameworks>\n    <RootNamespace>Plexus</RootNamespace>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"16.0.0\" />\n    <PackageReference Include=\"Shouldly\" Version=\"3.0.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.1\" />\n    <PackageReference Include=\"xunit.runner.console\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Plexus.Utils.Testing\\Plexus.Utils.Testing.csproj\" />\n    <ProjectReference Include=\"..\\Plexus.Utils\\Plexus.Utils.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}\" />\n  </ItemGroup>\n  <Import Project=\"..\\Plexus.Utils.Testing.Shared\\Plexus.Utils.Testing.Shared.projitems\" Label=\"Shared\" />\n</Project>"
  },
  {
    "path": "desktop/src/Plexus.Utils.Tests/PromiseTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nnamespace Plexus\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Threading.Tasks;\n    using Xunit;\n\n    public sealed class PromiseTests : IDisposable\n    {\n        [Fact]\n        public void NoUnobservedExceptionsOnPromise()\n        {\n            var promise = new Promise();\n            promise.TryFail(new Exception(\"NoUnobservedExceptionsOnPromise!\"));\n        }\n\n        [Fact]\n        public void NoUnobservedExceptionsOnGenericPromise()\n        {\n            var promise = new Promise<bool>();\n            promise.TryFail(new Exception(\"NoUnobservedExceptionsOnGenericPromise!\"));\n        }\n\n        [Fact]\n        public void NoUnobservedTaskExceptionsAfterCompletionLogged()\n        {\n            var promise = new Promise();            \n            promise.Task.LogCompletion(LogManager.GetLogger<PromiseTests>());\n            promise.TryFail(new Exception(\"NoUnobservedTaskExceptionsAfterCompletionLogged!\"));\n        }\n\n        private static void VerifyNoUnobservedTaskExceptions()\n        {\n            var list = new List<Exception>();\n\n            void CatchUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs args)\n            {\n                lock (list)\n                {\n                    list.Add(args.Exception);\n                }\n            }\n\n            TaskScheduler.UnobservedTaskException += CatchUnobservedTaskException;\n            try\n            {\n                GC.Collect();\n                GC.WaitForPendingFinalizers();\n                GC.Collect();\n                if (list.Count > 0)\n                {\n                    throw new AggregateException(list);\n                }\n            }\n            finally\n            {\n                TaskScheduler.UnobservedTaskException -= CatchUnobservedTaskException;\n            }\n        }\n\n        public void Dispose()\n        {\n            VerifyNoUnobservedTaskExceptions();\n        }\n    }\n}"
  },
  {
    "path": "desktop/src/Plexus.Utils.Tests/UniqueIdTests.cs",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n﻿namespace Plexus\n{    \n    using Shouldly;\n    using Xunit;\n\n    public sealed class UniqueIdTests\n    {\n        [Fact]\n        public void CanCreateFromString()\n        {\n            var uid = UniqueId.Generate();\n            var newUid = UniqueId.FromString(uid.ToString());\n            newUid.ShouldBe(uid);\n        }\n\n        [Fact]\n        public void HiLoFromString()\n        {\n            var x = UniqueId.FromString(\"C2EBE9A500AC114382A50C11EDC47EFA\");\n            x.String.ShouldBe(\"C2EBE9A500AC114382A50C11EDC47EFA\");\n            x.Hi.ShouldBe(14045576757775176003);\n            x.Lo.ShouldBe(9413943867230945018);\n        }\n\n        [Fact]\n        public void StringFromHiLo()\n        {\n            var x = UniqueId.FromHiLo(14045576757775176003, 9413943867230945018);\n            x.String.ShouldBe(\"C2EBE9A500AC114382A50C11EDC47EFA\");\n            x.Hi.ShouldBe(14045576757775176003);\n            x.Lo.ShouldBe(9413943867230945018);\n        }\n\n        [Fact]\n        public void EmptyId()\n        {\n            UniqueId.Empty.String.ShouldBe(\"00000000000000000000000000000000\");\n        }        \n    }\n}\n"
  },
  {
    "path": "desktop/tests.cmd",
    "content": "REM work around for https://github.com/dotnet/cli/issues/3995\nset tmp=\nset temp=\nCD %~dp0\nif defined APPVEYOR (\n\tSET LOGGER=Appveyor\n) else (\n\tSET LOGGER=xunit\n)\nif not defined PLEXUS_BUILD_DOTNET_PARAMS (\n\tSET PLEXUS_BUILD_DOTNET_PARAMS=/p:CORE_ONLY=true\n)\ndotnet test src\\Plexus.Interop.Tests.sln %PLEXUS_BUILD_DOTNET_PARAMS% --test-adapter-path:. --logger:%LOGGER% --verbosity quiet"
  },
  {
    "path": "docs/build.gradle",
    "content": "plugins {\n    id 'org.asciidoctor.convert' version '1.5.6'\n}\n\ndependencies {\n    asciidoctor 'org.asciidoctor:asciidoctorj-diagram:1.5.4.1'\n}\n\nasciidoctor {\n    sourceDir = file('src/main/asciidoc')\n    outputDir = file(\"${rootDir}/bin/docs\")    \n    sources {\n        include 'index.adoc'\n    }\n    requires 'asciidoctor-diagram'\n    extensions {\n       println delegate.class.classLoader\n    }\n    // List notation\n    attributes toc: 'left',\n            'icons': 'font',\n            'setanchors': '',\n            'idprefix': '',\n            'idseparator': '-',\n            'docinfo1': '',\n\t    'imagesDir': 'images',\n            'source-highlighter': 'coderay',\n\t    encoding : ' utf-8 ' \n}\n\ndefaultTasks 'asciidoctor'\n\nbuild.dependsOn asciidoctor"
  },
  {
    "path": "docs/src/main/asciidoc/app-registry-schema.json",
    "content": "{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"id\": {\n                \"type\": \"string\",\n                \"required\": true\n            },\n            \"displayName\": {\n                \"type\": \"string\",\n                \"required\": false\n            },\n            \"launcherId\": {\n                \"type\": \"string\",\n                \"required\": false\n            },\n            \"launcherParams\": {\n                \"type\": \"object\",\n                \"required\": false,\n                \"additionalProperties\": true\n            }\n        }\n    }\n}"
  },
  {
    "path": "docs/src/main/asciidoc/clone-and-build.adoc",
    "content": "[source, bash]\n----\n# Clone the repository\ngit clone https://github.com/finos-plexus/plexus-interop.git\n# Build\ncd plexus-interop\ngradlew build --info\n----"
  },
  {
    "path": "docs/src/main/asciidoc/concepts-components.adoc",
    "content": ":imagesdir: ./images\n\nPlexus Interop consist of the following main API layers:\n\nimage::desktop-interop-layers.png[]\n\nAll Applications are connected to central Broker.  To participate in interop each Application need to define itself in\nInterop Registry and auto-generate its specific client API using code-generation tool. Broker loads Interop Registry on\nstartup and re-loads when it is changed in runtime to discover available actions, validate and route calls\nbetween Applications.\n\n==== Broker\n\nBroker is a process running on user desktop which handles application connections, routes calls between them and able\nto launch new applications instances on demand.\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\n[Interop Broker] -up-> [App A Instance 1] : send/receive\\nmessages\n[Interop Broker] -right-> [App A Instance 2] : send/receive\\nmessages\n[Interop Broker] -down-> [App C Instance 1] : send/receive\\nmessages\n[Interop Broker] -left-> [App D Instance 1] : send/receive\\nmessages\n@enduml\n....\n\nInterop Broker has several responsibilities:\n\n* It reads full information about all interoperability APIs from Interop Registry\n* It routes interop API calls and replies between app instances\n* It tracks which application instances are alive. If some app calls a service which is not online yet then Broker launches service provider app via App Lifecycle Manager.\n\n==== Clients\n\nClients are technology-specific libraries used by Applications to communicate with Broker. Currently\nPlexus Interop has 2 types of clients: for .NET and for TypeScript/JavaScript.\n\nClients communicate with Broker using Interop Protocol. Protocol messages are sent via Transport Protocol. Broker\ncan support one or more Interop and Transport protocols and Client can choose which of them to use.\n\n\n==== Interop DSL\nInterop DSL is a language for defining contracts between Applications, and associated tooling for parsing, validating and\ncode-generating of application-specific client APIs from these definitions."
  },
  {
    "path": "docs/src/main/asciidoc/concepts-definitions.adoc",
    "content": ":imagesdir: ./images\n\nThis section contains overview diagram which shows Plexus Interop layers on example of 2 applications interoperating\nthrough broker. Below this diagram you can find brief descriptions for each of the presented concepts.\n\nimage::desktop-interop-concepts.png[]\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\nnode \"User Machine\" {\n    component \"App Instance\" as appInstance {\n        [App Functionality]\n        [Interop Transport] as transportApp\n        [Client Service API]\n    }\n    component \"Plexus Host\" {\n        [Interop Broker]\n        [Interop Transport]\n        [App Launcher]\n        [App Lifecycle Manager]\n    }\n}\ncloud \"Central Registries\" {\n    [App Registry]\n    [Interop Registry]\n}\n[Interop API definitions] ..> [Client Service API] : generate\n[Interop API definitions] ..> [Interop Registry] : publish\n[App Registry] ..> [Interop Registry] : references\n[Interop Registry] -> [Interop Broker] : load JSON\n[App Registry] -> [App Lifecycle Manager] : load JSON\n[Interop Broker] -> [App Lifecycle Manager] : request app launch\n[Interop Broker] <-> [Interop Transport] : send/receive messages\n[Interop Transport] <-> transportApp : send/receive messages\n[Client Service API] <-> transportApp : send/receive  messages\n[Client Service API] <-> [App Functionality] : send/receive messages\n[App Lifecycle Manager] -> [App Launcher] : request app launch\n[App Launcher] -> appInstance : start app\n[App Launcher] -> [App Lifecycle Manager] : report app status\n\n@enduml\n....\n\n==== Application\n\nApplication is a program on client desktop which can be started and stopped. Each application can provide (i.e. implement)\nservices and/or consume (i.e. call) services provided by other applications.\n\nApplication is not necessary correspond to OS process. It can be a part of process, or consist of many processes.\n\nExamples of applications:\n\n* A program with GUI\n* A program without GUI, e.g. Windows Service\n* A part of process, e.g. a plugin running in a big container application consisting of many isolated plugins\n* A web window or worker running in Electron.js or other web container\n\n==== Application Instance\n\nApplication instance is a running (started) application. There can be many instances of the same application running\nsimultaneously on client desktop.\n\n==== Interop Registry\n\nInterop registry defines strong-typed contracts between applications on client desktop using a special human-readable\ninterface definition language.\n\nIt consist of definitions of the following types:\n\n* **Message definitions** represent types of data which can be sent between applications.\n* **Service definitions** represent named sets of related methods which can be implemented by applications. Service can\ncontain one or many methods and each method is defined by its name, type, and types of request and response.\n* **Application definitions** declare which service implementations are provided and which consumed\nby each application participating in desktop interop.\n\nBroker loads Interop Registry from server on launch and re-loads it on changes. This allows adding new services to\nuser desktops in runtime.\n\nInterop Registry enables dynamic service discovery. Applications are only connected to broker and call services rather\nthan other applications. This concept is similar to dynamic injection containers available in almost any language and\nframework, but here it is used on a higher level. Broker dynamically searches for a suitable service implementation\nacross all the applications in Interop Registry. Because of this applications are always de-coupled from each other,\nthey don't need to know about counter-parties implementation details and they can release separately.\n\n==== Broker\n\nBroker is the central part of desktop interop. Broker accepts, authenticates and tracks application (client) connections,\nvalidates and routes calls between them, and optionally can trigger launch of application on demand through\nApp Lifecycle Manager.\n\nBroker listens to one or many wire protocol servers to accept client connections. Applications can use any of the\nlistened wire protocol implementations to establish connection with broker.\n\nApplication instance is considered \"online\" while it has at least one established connection with broker. Broker\nuniquely identifies each connection and tracks it, so it always knows which apps are online in any given time.\n\nOnline applications instances can send protocol requests to broker to discover or call service implementations provided\nby other applications. Broker validates and routes such calls to target applications according to interop registry.\n\n==== Application Lifecycle Manager\n\nComponent inside Broker which tracks active connections and can trigger launch of an application on demand by sending a\nrequest to the appropriate Application Launcher.\n\n==== Application Launcher\n\nApplication launchers are applications which can launch other applications. This concept was introduced to allow easy\nimplementation of custom launch workflows which can be very different. E.g. web application is loaded in a browser window,\nnative application started as a new OS process and plugin is loaded by its container application. In addition each vendor\nusually has custom launch steps like auto-updating or accepting terms & conditions. Such steps can also be implemented\nin a vendor-specific app launcher.\n\nOn method call broker can either route the call to an online application instance or trigger launch of a new\ninstance. There are several strategies of routing launch requests from Broker to App Launcher, called _Launch Behaviors_:\n\n* *Default* - Pass invocation to already running provider instance or launch new one if no online providers found.\n* *Always* - Create new app instance on each invocation.\n* *Never* - Pass invocation to already running instance, return error if no online providers found.\n\nLaunch Behaviors can be specified per action in Interop Registry, please see example below:\n[source,javascript]\n-------------------\napplication RateProviderApp {\n    provides CcyPairBroadcastService {\n        option launch_on_call = ALWAYS;\n        GetRate;\n    }\n}\n-------------------\n\nEach application can specify its Launcher in Interop Registry and broker will delegate launch to\nthe specified Launcher.\n\n==== Client\n\nClient is a library used by application to communicate with interop broker. Client can be implemented in any language,\nit communicates with broker using interop protocol, transport protocol and wire protocol.\n\n==== Method\nLike many other Remote Procedure Call (RPC) systems, Plexus Interop is based around the idea of defining a service by\nspecifying the methods that can be called remotely with their parameters and return types.\n\nThere are 4 possible types of RPC methods in Plexus Interop mirroring types supported by\nhttp://www.grpc.io/docs/guides/concepts.html#rpc-life-cycle[gRPC]:\n\n* Unary - consumer send a request, provider receives it, handles, and sends response back to the consumer.\n* Consumer streaming - consumer sends one or many requests, provider sends only one response back.\n* Provider streaming - consumer sends one request, provider sends many responses back.\n* Bidirectional streaming - consumer sends many requests, provider sends many responses.\n\n\n==== Discovery\n\nAbility to dynamically discover service implementations. It allows using services in a decoupled way when consumer might\nnot even know where the called service is implemented.\n\nStep one: find API implementations:\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\n[App A] -> [Interop Broker] : 1) discover API implementations\n[Interop Broker] ..> [App A] : 2) apps B, C implement the API\n[Interop Broker] .. [App B]\n[Interop Broker] .. [App C]\n[Interop Broker] .. [App D]\n@enduml\n....\n\nStep two: select between API implementations\n\nStep three: call specific API implementer:\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\n[App A] -> [Interop Broker] : 1) call API provided by app B\n[Interop Broker] --> [App B] : 2) launch app B\n[Interop Broker] --> [App B] : 3) call API\n[Interop Broker] .. [App C]\n[Interop Broker] .. [App D]\n@enduml\n....\n\n\n==== Client Message Marshaller\n\nPluggable component used by client library to serialize and deserialize request/response messages.\n\n==== Generic Client API\nTechnology-specific API implementation which provides core functionality of interop client. It converts method calls to interop protocol messages and vice versa according to specification and uses pluggable transport implementation to send/receive messages to/from broker.\n\nCurrently .NET and TypeScript/JavaScript libraries are provided.\n\n==== Generated Client API\n\nApplication-specific wrapper on top of Generic Client API which is auto-generated based on Interop Registry by code-generation tool.\n\nFor each consumed service a proxy class is generated which allows invocation of service methods.\n\n[source,javascript]\n.Executing action using generated  proxy\n-------------------\nconst rate: ICcyPairRate = client.getCcyRateService().getRate({ ccyPairName: 'EURUSD' });\n-------------------\n\nFor each provided service an interface is generated which should be implemented to provide implementations for service\nmethods.\n\n[source,javascript]\n.Registering handler for provided service\n-------------------\nclientBuilder.withCcyRateServiceProvider({\n    onGetRate: (invocattionContext: InvocationContext, pair: ICcyPair) => {\n        return internalService.getRate(pair);\n    }\n});\n-------------------\n\n==== Interop Protocol\n\nInterop Protocol is a language for conversations between client and broker through transport channels.\n\nEach interop protocol conversation is performed within a separate transport channel.\n\nProtocol describes 4 main types of conversations:\n\n* Connect handshake - the first conversation performed after new transport connection is established\n* Disconnect handshake - the last conversation performed before transport connection is closed\n* Discovery - request from application to broker to get the available services filtered by specific parameters\n* Method call - request from an application to call a method implemented in another application\n\n==== Transport Protocol\n\nTransport protocol is used to send binary messages between client and broker and is responsible for multiplexing and\nde-multiplexing many channels through a single connection.\n\n==== Transport Connection\n\nTransport connection is an abstraction of established connectivity between client and broker.\n\nConnection is initiated by client and accepted by broker.\n\nTransport implementation must detect if the connection is still alive, e.g. by sending heartbeats or using lower-level\nwire protocol capabilities for this, and raise \"disconnected\" event on both sides when connectivity is lost.\n\n==== Transport Channel\n\nTransport channel is a logical unit of data exchange through connection. It consist of request and response\nbyte streams on both sides of connection.\n\nChannel opening can be initiated by both client and broker. It's only possible to write and read bytes to/from\nan opened channel. Many channels can be simultaneously opened in the context of the same connection.\n\nFor example, for each call from one application to another, 2 transport channels are opened. First is opened by source\napplication to broker. Second is opened by broker to target application. All the data sent in context of the call\nis transferred through these 2 channels.\n\nBytes written to request stream on one side of channel can be read in exactly the same order from response stream\non another side. As soon as one of the sides sent all the data it closes request stream. This triggers\nresponse stream completion event on another side as soon as all the sent bytes consumed.\n\nChannel considered \"Completed\" when both sides completed request stream and consumed all the bytes from response stream.\nAdditionally it can be terminated by either client or broker with either \"Failed\" or \"Canceled\" status in case of\nexception.\n\n==== Wire Protocol\n\nWire protocol is an abstraction for sending bytes through cross-process boundaries. Any existing stream-based network\nprotocol such as named pipes or websockets can be used as a wire protocol for Plexus Interop.\n\nBroker listens to many wire protocols simultaneously on different addresses, so each client can choose which one to use.\nUsually for native apps it's more convenient to use named pipes, but for web apps it's more convenient to use websockets,\nbecause most of browsers has built-in websockets support.\n\n==== Wire Connection\n\nWire connection is an abstraction of established cross-process connection."
  },
  {
    "path": "docs/src/main/asciidoc/concepts-features.adoc",
    "content": "* *Communicate across desktop applications*. Allows communication between apps running in different processes, developed by different teams, and in different programming languages.\n* *Decouple desktop apps from each other and discover services dynamically*. All interop calls are going through the central broker which works as a mediator decoupling apps from each other. Apps can discover each other in run time using different search criteria.\n* *Launch apps on demand*. Interop broker tracks the lifecycle of desktop applications, i.e. it knows whether app is running or not and can launch app when required.\n* *Define strongly-typed interop APIs*. Reference implementation uses popular https://developers.google.com/protocol-buffers/[Google Protobuf] format for defining APIs and serializing messages. Strong-typing and using of industry-wide standard allows easy integration between different apps.\n* *Store APIs in central repository, control their usage and evolution*. All API definitions, as well as explicit per-app declaration of provided and consumed services, are supposed to be stored in the central interop repository. Central repository allows defining standards for communicating apps and common services on user desktop, granular control on usage and evolution of APIs.\n* *Use different messaging patterns*. Supports request-response RPC pattern for common cases, as well as broadcast and bi-directional streaming patterns for more complex scenarios.\n* *Easy deploy and distribute into enterprise environments*. Deployment is very simple, does not require administrative permissions, supports <<guides-system-requirements, all major enterprise operating systems>> and terminal services.\n* *Communicate securely using different transports*. Uses local-only communication channels. Two transports are supported at the moment: \"websockets\" transport best suited for web apps and \"named pipes\" best suited for desktop apps.\n* *Extend where required*. Can be adjusted to your needs via extension points. It's possible to introduce new interop transport and serialization protocols, support custom authentication and authorization, different app startup flows and new programming languages.\n\nSee <<guides, Guides>> section for the more detailed description of what is Plexus Interop and how it works."
  },
  {
    "path": "docs/src/main/asciidoc/concepts-overview.adoc",
    "content": ":imagesdir: ./images\n\nThe **Plexus Interop** project aims to define an open standard for desktop application interoperability and provides\nreference implementation of this standard. It formalizes connections between applications within a single user session\non client desktop through a central broker.\n\nThe main goal is to enable development of extensible workflows connecting independent apps developed by different\norganizations in different technologies (.NET, Web, Java, Python, etc.) by passing relevant context  (structured\ndata objects) between those apps.\n\nAlthough the industry is moving towards containerized desktop applications, Plexus Interop recognizes that much\nof the application landscape is not yet tied to containers and is architecturally agnostic of container implementation.\nSeparating interoperability from the container provides notable advantages: different containers can be leveraged in\nthe same workflow, and launched applications residing outside of containers can participate in interop activities.\n\nTechnically speaking, Plexus Interop is a metadata-centric language-agnostic desktop app-to-app interoperability\nframework with an extensible model for launching new instances of desktop applications on demand. Its extensibility\nis based on open standards which are essential parts of the project.  The architecture is based around central broker\nproviding hub-and-spoke connectivity between apps and brokering strongly-typed RPC-style calls between them. The broker\nhas a connection to an Application Lifecycle Manager (or Launcher) which is capable of creating new instances of apps\nbased on the their runtime-metadata (e.g. container type, launch command, command line parameters) defined in a registry.\n\nimage::architecture.png[Key components and high level architecture]"
  },
  {
    "path": "docs/src/main/asciidoc/getting-started-how-to-build.adoc",
    "content": "To build Plexus Interop components on your machine clone the repository and run https://gradle.org/[Gradle] build command:\n\n[source, bash]\n-----\ngit clone https://github.com/finos-plexus/plexus-interop.git\ncd plexus-interop\ngradlew build --console plain --no-daemon\n-----\n\nBuild artifacts are saved into `bin` directory :\n\n* `win-x86/broker` - binaries of interop broker\n* `win-x86/samples` - sample apps\n* `win-x86/sdk` - code generator tool\n* `docs` - documentation in HTML format\n* `nuget` - .NET NuGet packages to be used in apps\n"
  },
  {
    "path": "docs/src/main/asciidoc/getting-started-how-to-run-samples.adoc",
    "content": ":imagesdir: ./images\n\nRepository contains a sample demonstrating how Plexus Interop can be used to build interoperability between apps on desktop.\n\nThe sample consist of .NET Core console app and web app running in Electron. As an example let us test how request-response call and discovery work:\n\n. Build samples - see <<how-to-build, How to build>> for details\n\n. Go to `bin/win-x86/samples/greeting` directory\n\n. Launch Interop Broker – `LaunchBroker.cmd`\n\n. Launch sample \"Greeting Client\" app – `LaunchGreetingClient.cmd`\n\n. Choose “Discovery” option (5) first and then “Greeting from Electron Web app” option from discovery response:\n+\nimage::sample-1.png[Sample-1]\n\n. Enter some name (e.g. “John”) and press Enter. Broker will launch \"Web Greeting Server\" app, which is configured to run in Electron container.\nOnce launched the app will show the information about connection and incoming request and will send back a greeting response:\n+\nimage::sample-2.png[Sample-2]\n\n. \"Greeting Client\" app should receive the greeting and print it:\n+\nimage::sample-3.png[Sample-3]\n\n. Now choose Discovery (5) option in \"Greeting Client\" again and this time select “Greeting from .Net app” option from discovery results.\n\n. Enter another name, e.g. “Mike” and press enter. Broker will start a \".NET Greeting Server\"console app. Once running this app will print information about the incoming request and will send back the greeting:\n+\nimage::sample-4.png[Sample-4]\n\nYou may check other call types by choosing other options in the \"Greeting Client\" app.\n\nSource code for sample flow is here:\n\n* Sample Interop Registry - https://github.com/finos-plexus/plexus-interop/tree/master/samples/greeting/registry/\n* .NET Greeting Client - https://github.com/finos-plexus/plexus-interop/master/desktop/src/Plexus.Interop.Samples.GreetingClient/Program.cs\n* .NET Greeting Server - https://github.com/finos-plexus/plexus-interop/tree/master/desktop/src/Plexus.Interop.Samples.GreetingServer/Program.cs\n* Web Greeting Server - https://github.com/finos-plexus/plexus-interop/tree/master/web/packages/web-example/src/greeting/server/Main.ts\n* Electron App Launcher - https://github.com/finos-plexus/plexus-interop/tree/master/web/packages/electron-launcher/src/launcher/\n"
  },
  {
    "path": "docs/src/main/asciidoc/getting-started-repository-structure.adoc",
    "content": "Plexus Interop repository consist of the following main sections:\n\n* https://github.com/finos-plexus/plexus-interop/tree/master/desktop[desktop] - Interop Broker, .NET Interop Client and sample apps implemented in C# using https://www.microsoft.com/net/download/core[.NET Core 2.0]\n* https://github.com/finos-plexus/plexus-interop/tree/master/web[web] - Web Interop Client and sample apps implemented in https://www.typescriptlang.org/[TypeScript]\n* https://github.com/finos-plexus/plexus-interop/tree/master/dsl[dsl] - https://developers.google.com/protocol-buffers/[Protobuf] and Plexus Interop grammar parsers, validators and code-generators implemented using https://eclipse.org/Xtext/[Xtext framework]\n* https://github.com/finos-plexus/plexus-interop/tree/master/docs[docs] - project documentation implemented in http://asciidoc.org/[AsciiDoc] format using http://asciidoctor.org/[Asciidoctor] processor\n* https://github.com/finos-plexus/plexus-interop/tree/master/protocol[protocol] - definitions of Plexus Interop internal protocol messages in https://developers.google.com/protocol-buffers/[Protobuf] format\n* https://github.com/finos-plexus/plexus-interop/tree/master/samples[samples] - sample interop metadata"
  },
  {
    "path": "docs/src/main/asciidoc/guides-how-to-write-custom-app-launcher.adoc",
    "content": "App Launchers are just applications which implements the special contract called `interop.AppLauncherService`.\n\nTo implement custom app launcher need to do the following:\n\n. Define new application in interop registry that provides service `interop.AppLauncherService` service to `interop.AppLifecycleManager`. See example below.\n. Generate client API for the application.\n. Implement methods defined by `interop.AppLauncherService`.\n. Register the new app in App Registry. Use built-in `interop.NativeAppLauncher` as a launcher for it. See example below.\n. Use environment variables to get broker location and instance id for connection.\n\nHow does this work?\nIf app launcher is not started yet, Interop Broker will start it and pass environment variables \"PLEXUS_APP_INSTANCE_ID\" and \"PLEXUS_BROKER_WORKING_DIR\".\nFirst variable should be used in connection message 'AppInstanceId' property to let broker know the connecting instance is the one it is waiting for.\nThe second variable defines broker location. Transports should check the directory \"%PLEXUS_BROKER_WORKING_DIR%\\servers\\<servername>\" to get connectivity details.\nFor example, websocket server connection URL is specified in \"%PLEXUS_BROKER_WORKING_DIR%\\servers\\ws-v1\\address\".\n\n==== Example definition of ElectronAppLauncher\n[source,php]\n.AppLauncherService.proto\n----\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"interop/UniqueId.proto\";\n\nservice AppLauncherService {\n\trpc Launch(AppLaunchRequest) returns (AppLaunchResponse);\n}\n\nmessage AppLaunchRequest {\n\tstring app_id = 1;\n\tstring launch_params_json = 2;\n}\n\nmessage AppLaunchResponse {\n\tUniqueId app_instance_id = 1;\n}\n----\n\n.ElectronAppLauncher.interop\n[source,php]\n----\nimport \"interop/AppLauncherService.proto\";\n\npackage interop;\n\napplication ElectronAppLauncher {\n\n\tprovides AppLauncherService to interop.AppLifecycleManager { Launch; }\n}\n----\n\n.apps.json\n[source,js]\n----\n{\n      \"id\": \"interop.ElectronAppLauncher\",\n      \"displayName\": \"Electron App Launcher\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../ElectronAppLauncher.cmd\",\n        \"args\": \"\"\n      }\n}\n----"
  },
  {
    "path": "docs/src/main/asciidoc/guides-interop-integration-workflow.adoc",
    "content": "Typical development cycle for integration with Plexus Interop:\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\nskinparam componentStyle uml2\n\nframe \"Interop Governance Server\" {\n    [Metadata Registry]\n}\n\nframe \"Dev Machine\" {\n    [Local Metadata]\n    [Plexus Studio]\n    frame \"App In Development\" as appDev {\n        [Client API]\n        [App Logic] as App\n    }\n}\n\nframe \"Interop Production Server\" {\n    [Interop Registry Service]\n}\n\nframe \"User Machine\" {\n    [Plexus Interop]\n    [Deployed App]\n}\n\n[Metadata Registry] -> [Local Metadata] : 1) Clone existing metadata\n[Local Metadata] -> [Local Metadata] : 2) Define metadata\n[Local Metadata] -down-> [Client API] : 3) Generate API\n[Client API] -> [App] : 4) Integrate API into app\n[Client API] <-down-> [Plexus Studio] : 5) Test app via Plexus Studio\n[Local Metadata] -up-> [Metadata Registry] : 6) Raise change request\n[Approver] -> [Metadata Registry] : 7) Review/approve\n[Metadata Registry] ..> [Interop Registry Service] : 8) Promote\nappDev ..> [Deployed App] : 9) Deploy app\n[Interop Registry Service] -> [Plexus Interop] : 10) Download metadata\n[Plexus Interop] .. [Deployed App]\n@enduml\n....\n\n. Clone existing interop API definitions (metadata) from remote central registry\n. Define new interop metadata locally\n. Generate client interop APIs from local metadata\n. Integrate generated interop APIs into the app\n. Publish new metadata into local \"sandbox\" registry\n. Test interop flow via Plexus Studio:\n.. If app provides service then you can call it from Plexus Studio.\n.. If app consumes some service then you can check that app sends correct interop messages into Plexus Studio.\n.. Repeat steps 2-5 until you are fully happy with API and its implementation.\n. Deploy new version of the app with new interop flow\n. Publish interop metadata into central registry for approval\n. Once new metadata is approved it should get into central Interop Registry and become available to all users\n. Test flow between apps end-to-end in real environment"
  },
  {
    "path": "docs/src/main/asciidoc/guides-interop-invocation-workflow.adoc",
    "content": "This section presents the most interesting scenario of invocation, which includes app launch:\n\n[plantuml]\n....\n@startuml\nskinparam monochrome true\nparticipant \"Service Consumer Application\" as ConsumerComponent\nparticipant \"Interop Broker\" as InteropBroker\nparticipant \"Interop Registry\" as InteropRegistry\nparticipant \"App Registry\" as AppRegistry\nparticipant \"App Lifecycle Manager\" as AppLifecycleManager\nparticipant \"Some App Launcher\" as AppLauncher\nparticipant \"Service Provider Application\" as ProviderApplication\n\nConsumerComponent -> InteropBroker : send request message to invoke service method\nInteropBroker -> InteropRegistry : find service provider application\nInteropBroker -> InteropBroker: check if provider application is connected\nInteropBroker -> AppLifecycleManager: request launch of provider application\nAppLifecycleManager -> AppRegistry: get app launcher id and launch params\nAppLifecycleManager -> AppLauncher: request launch by providing launch params\nAppLauncher -> ProviderApplication: launch app and provide instance id and broker connectivity details\nAppLifecycleManager <-- AppLauncher: launched app instance id\nInteropBroker <-- AppLifecycleManager: launched app instance id\nInteropBroker -> InteropBroker: wait for launched app with the specified id connected\nProviderApplication --> InteropBroker: connect to broker\nInteropBroker -> ProviderApplication: send request message to invoke service method\nProviderApplication --> InteropBroker: response\nInteropBroker --> ConsumerComponent: response\n@enduml\n....\n\n* When Desktop Plexus is started it creates transport endpoints and start listen for incoming connections.\n* Plexus Interop launches app A and provides it with the configuration on how to connect to transport servers.\n* App A initializes Client APIs and connects to Broker. Client and Broker performs handshake after which Broker registers the connected instance start tracking it.\n\nNow user wants to send some information from app A into another app B available in Plexus. Here is what happens in app A:\n\n* App A creates an input message instance using builder provided by Client API library\n* App A calls service method in Client API and passes created message instance\n* Client API performs several steps:\n** Creates header which contains information about the invocation: sender, receiver, service name, method name etc.\n** Serializes the created header via Protobuf and submits into Interop Transport for sending\n** Serializes the created input message into binary stream using Protobuf and submits into Interop Transport for sending\n** Transport splits the incoming message stream into one or more frames and send them to the pipe\n\nPlexus Host process is doing the following:\n\n* Interop Transport reads binary stream from transport and re-constructs headers and messages from received frames.\n* When new *header* arrives Transport starts to build new message blob from frames related to the message\n* Once header and message blobs are constructed, Transport passes them into Interop Broker\n* Interop Broker deserializes header blob and checks information about message receiver\n* If target app is not running then Interop Broker sends \"launch app\" event to App Launcher with the ID of app B and waits\n* App Launcher starts target app B. After launch app B will:\n** Register callback for process API calls\n** Register its instance in Interop Broker (same as app A)\n* Interop Broker detects that app B is live and sends message into it using Transport\n\nNow that message is sent to app B via transport remaining part is easy:\n\n* Interop Transport within app B restores message blob and passes it into Client API\n* Client API deserializes blob into strongly typed message and invokes callback registered by app B code\n* App B processes the message and sends reply using same approach as original request, but in reverse direction\n"
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start-dotnet.adoc",
    "content": ":imagesdir: ./images\n[[quick-start-dotnet]]\n==== Quick Start - .NET\n\nIn this guide both consumer and provider are .NET console apps written in C# language running under https://www.microsoft.com/net/download/core#/runtime[.NET Core].\n\n===== Run example\n\ninclude::guides-quick-start-launch-broker-step.adoc[]\n\n. Launch \"CCY Pair Viewer\" app:\n+\n[source, bash]\n-----\nplexus launch vendor_b.fx.CcyPairRateViewer\n-----\n+\ninclude::guides-quick-start-launch-app.adoc[]\n+\n[NOTE]\n====\nIn this example apps are launched using built-in `NativeAppLauncher` which run apps as standard OS processes.\n====\n\n. In the opened console window enter a currency pair name, e.g. `EURUSD` and press `Enter`:\n+\nimage::quick-start-dotnet-1.png[Quick Start .NET 1]\n+\ninclude::guides-quick-start-invocation-workflow.adoc[]\n+\n[NOTE]\n====\nNote that `CcyPairRateProvider` app uses the same `NativeAppLauncher` as the viewer app.\n====\n\n. Once `CcyPairRateProvider` app is up and running it registers in Broker, receives the message from viewer app and sends back a random rate:\n+\nimage::quick-start-dotnet-2.png[Quick Start .NET 2]\n\n. The viewer app shows the rate received from provider:\n+\nimage::quick-start-dotnet-3.png[Quick Start .NET 3]\n\n===== Modify example\n\nLet us add real-time updates of FX rates instead of a single response. For this we have to change the contract between two apps, provide updated interop metadata to the broker, update apps and run them again.\n\n====== Modify metadata\n\nFirst we need to modify interop registry and pass updated metadata to the broker.\n\n. Open `registry/fx/ccy_pair_rate_service.proto` file and add new `GetRateStream` method:\n+\n[source, php]\n./registry/fx/ccy_pair_rate_service.proto\n-----\nservice CcyPairRateService {\n    rpc GetRate(CcyPair) returns (CcyPairRate);\n\n    // new rpc call returning real-time notification stream\n    rpc GetRateStream(CcyPair) returns (stream CcyPairRate);\n}\n-----\n\n. Open `registry/vendor_a/fx/ccy_pair_rate_provider.interop` file and change provided method to `GetRateStream`:\n+\n[source, php]\n./registry/vendor_a/fx/ccy_pair_rate_provider.interop\n-----\npackage vendor_a.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication CcyPairRateProvider {\n    provides .fx.CcyPairRateService {\n        GetRateStream [title = \".NET Provider - Get Rate Stream\"];\n    }\n}\n-----\n\n. Open `registry/vendor_b/fx/ccy_pair_rate_viewer.interop` file and change consumed method to `GetRateStream`:\n+\n[source, php]\n./registry/vendor_b/fx/ccy_pair_rate_viewer.interop\n-----\npackage vendor_b.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication CcyPairRateViewer {\n    consumes .fx.CcyPairRateService { GetRateStream; }\n}\n-----\n\n. To pass updated metadata to the broker, go back to `bin\\win-x86\\samples\\quick-start` directory and re-generate metadata using *Plexus Generator* tool:\n+\n[source, bash]\n-----\njava -jar ../../sdk/plexusgen.jar --type=json_meta --baseDir=registry --out=metadata\n-----\n+\n[NOTE]\n====\nBroker tracks `interop.json` file and automatically reloads metadata file is modified.\n====\n\n====== Modify and build provider app\n\nNow let us update CcyPairRateProvider app to provide real-time notifications.\n\n. Navigate to the `desktop/src/Plexus.Interop.Samples.CcyPairRateProvider` directory and call `Generate.cmd`\n+\n[NOTE]\n====\nPlexus Generator tool generates interfaces and proxy classes from service descriptions.\nInternally it uses https://github.com/google/protobuf/releases/latest[protobuf compiler] to generate C# message definitions from `.proto` files.\n====\n\n. Open `Program.cs` file and update the code to provide implementation of the new method:\n+\n[source, java]\n./desktop/src/Plexus.Interop.Samples.CcyPairRateProvider/Program.cs\n-----\nnamespace Plexus.Interop.Samples.CcyPairRateProvider\n{\n    using Plexus.Interop.Samples.CcyPairRateProvider.Generated;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n    using Plexus.Channels;\n\n    public sealed class Program : CcyPairRateProviderClient.ICcyPairRateServiceImpl\n    {\n        private readonly Random _random = new Random();\n\n        public static void Main(string[] args)\n        {\n            new Program().MainAsync(args).GetAwaiter().GetResult();\n        }\n\n        public async Task MainAsync(string[] args)\n        {\n            // Read broker working dir specified either in the first\n            // command line argument or in environment variable,\n            // or just use current working directory.\n            var brokerWorkingDir = args.Length > 0\n                ? args[0]\n                : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n\n            // Creating client and connecting to broker\n            Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n            var client = new CcyPairRateProviderClient(this, setup => setup.WithBrokerWorkingDir(brokerWorkingDir));\n            await client.ConnectAsync();\n            Console.WriteLine(\"Connected. Waiting for requests. Press CTRL+C to disconnect.\");\n            Console.CancelKeyPress += (sender, eventArgs) =>\n            {\n                eventArgs.Cancel = true;\n                client.Disconnect();\n            };\n\n            // Awaiting completion\n            await client.Completion;\n            Console.WriteLine(\"Disconnected.\");\n        }\n\n        // Implementation of server streaming method GetRateStream\n        public async Task GetRateStream(\n            CcyPair request,\n            IWritableChannel<CcyPairRate> responseStream,\n            MethodCallContext context)\n        {\n            Console.WriteLine(\"Received subscription: {0}\", request);\n            try\n            {\n                do\n                {\n                    var response = GetCcyPairRate(request);\n                    Console.WriteLine(\"Sending response: {0}\", response);\n                    await responseStream.TryWriteAsync(response, context.CancellationToken);\n                    await Task.Delay(_random.Next(1000, 3000), context.CancellationToken);\n                } while (!context.CancellationToken.IsCancellationRequested);\n            }\n            catch (OperationCanceledException) when (context.CancellationToken.IsCancellationRequested)\n            {\n                // Ignoring cancellation exception\n            }\n            Console.WriteLine(\"Subscription completed\");\n        }\n\n        private CcyPairRate GetCcyPairRate(CcyPair request)\n        {\n            CcyPairRate response;\n            switch (request.CcyPairName)\n            {\n                case \"EURUSD\":\n                    response = new CcyPairRate\n                    {\n                        CcyPairName = \"EURUSD\",\n                        Rate = 1.15 + 0.05 * _random.NextDouble()\n                    };\n                    break;\n                case \"EURGBP\":\n                    response = new CcyPairRate\n                    {\n                        CcyPairName = \"EURGBP\",\n                        Rate = 0.87 + 0.05 * _random.NextDouble()\n                    };\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException($\"Unknown currency pair: {request.CcyPairName}\");\n            }\n\n            return response;\n        }\n    }\n}\n-----\n\n. Re-build the app by executing the following command:\n[source, bash]\n-----\ndotnet build\n-----\n\n====== Modify and build consumer app\n\nNow let us update \"CCY Pair Rate Viewer\" app to handle multiple incoming real-time updates.\n\n. Navigate to the `desktop/src/Plexus.Interop.Samples.CcyPairRateViewer` directory and call `Generate.cmd`\n\n. Navigate to the `desktop/src/Plexus.Interop.Samples.CcyPairRateViewer` directory, open `Program.cs` file and update the code to the following:\n+\n[source, java]\n./desktop/src/Plexus.Interop.Samples.CcyPairRateViewer/Program.cs\n-----\nnamespace Plexus.Interop.Samples.CcyPairRateViewer\n{\n    using Plexus.Interop.Samples.CcyPairRateViewer.Generated;\n    using System;\n    using System.IO;\n    using System.Threading.Tasks;\n\n    public sealed class Program\n    {\n        public static void Main(string[] args)\n        {\n            new Program().MainAsync(args).GetAwaiter().GetResult();\n        }\n\n        public async Task MainAsync(string[] args)\n        {\n            // Read broker working dir specified either in the first\n            // command line argument or in environment variable,\n            // or just use current working directory.\n            var brokerWorkingDir = args.Length > 0\n                ? args[0]\n                : EnvironmentHelper.GetBrokerWorkingDir() ?? Directory.GetCurrentDirectory();\n\n            // Creating client and connecting to broker\n            Console.WriteLine(\"Connecting to broker {0}\", brokerWorkingDir);\n            var client = new CcyPairRateViewerClient(setup => setup.WithBrokerWorkingDir(brokerWorkingDir));\n            await client.ConnectAsync();\n            Console.WriteLine(\"Connected\");\n\n            while (true)\n            {\n                Console.Write(\"Enter currency pair (e.g. \\\"EURUSD\\\") or press Enter to exit: \");\n                var ccyPairName = Console.ReadLine();\n                if (string.IsNullOrEmpty(ccyPairName))\n                {\n                    break;\n                }\n\n                // Requesting ccy pair rate from another app\n                var request = new CcyPair { CcyPairName = ccyPairName };\n                var call = client.CcyPairRateService.GetRateStream(request);\n\n                ConsoleCancelEventHandler cancelHandler = null;\n                cancelHandler = (sender, eventArgs) =>\n                {\n                    Console.CancelKeyPress -= cancelHandler;\n                    Console.WriteLine(\"Unsubscribing\");\n                    eventArgs.Cancel = true;\n                    call.Cancel();\n                };\n\n                Console.CancelKeyPress += cancelHandler;\n\n                await call.ResponseStream\n                    .ConsumeAsync(item =>\n                    {\n                        Console.WriteLine(\"Notification received: {0}\", (object)item);\n                        Console.WriteLine(\"Press CTRL+C to unscubscribe\");\n                    })\n                    .IgnoreAnyCancellation();\n            }\n\n            Console.WriteLine(\"Disconnecting\");\n            await client.DisconnectAsync();\n            Console.WriteLine(\"Disconnected\");\n        }\n    }\n}\n-----\n\n. Re-build the app by executing the following command:\n[source, bash]\n-----\ndotnet build\n-----\n\n====== Launch the modified example\n\n. Launch \"CCY Pair Rate Viewer\":\n+\n[source, bash]\n-----\nplexus launch vendor_b.fx.CcyPairRateViewer\n-----\n\n. In the opened console window enter a currency pair name, e.g. `EURUSD` and press `Enter`:\n+\nimage::quick-start-dotnet-4.png[Quick Start .NET 4]\n\n. Broker starts \"CCY Pair Rate Provider\" app and redirects request to it:\n+\nimage::quick-start-dotnet-5.png[Quick Start .NET 5]\n\n. The viewer app will show rate updates coming from provider until you press `CTRL-C`:\n+\nimage::quick-start-dotnet-6.png[Quick Start .NET 6]"
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start-invocation-workflow.adoc",
    "content": "[NOTE]\n====\nWhen app A calls an interop service hosted in app B the following steps happen:\n\n* Broker searches for the already connected live service providers\n* If service provider is offline, broker inspects *App Registry* and sends a launch request to *App Lifecycle Manager*.\n* While app is starting broker waits (with some timeout)\n* Service provider within the launched app connects to the broker and registers itself\n* Broker sends interop message to the service provider\n\nSee <<guides-interop-invocation-workflow, Invocation Workflow>> section for details.\n===="
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start-launch-app.adoc",
    "content": "[NOTE]\n====\n`plexus launch` command sends a request to *App Lifecycle Manager* to make some app up and running. App Lifecycle Manager is a part of the broker that\ntracks which apps are alive and can create a new instance of an app if there is no live one. Different app types may have very different life cycles, so App Lifecycle Manager launches new app instances and tracks their status using *App Launchers*.\n===="
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start-launch-broker-step.adoc",
    "content": ". Switch to the `bin\\win-x86\\quick-start` directory and start a new broker instance:\n+\n[source, bash]\n----\ncd bin\\win-x86\\samples\\quick-start\nstart plexus broker\n----\n+\n[NOTE]\n====\nBroker requires two types of metadata to run:\n\n* *app registry* - declares all available apps and how to launch them. App Lifecycle Manager component uses this registry to launch apps when requested.\n* *interop registry* - declares messages, services, and which of them are provided or consumed by each application. Broker uses this information to provide discovery capabilities and validate invocations between apps.\n\nBy default Interop Broker reads metadata from `apps.json` and `interop.json` files located in `metadata` sub-directory within broker's working directory. In real world scenarios, broker will load registries from remote server instead of local files, because remote server may provide many capabilities like (admin UI, central governance, audit trail, entitlements, etc.).\nTo load metadata from other data sources you need to implement your own *registry provider* (documentation on that is in progress).\n====\n+\n[NOTE]\n====\nEach Interop Broker instance is identified by its working directory. It is possible to run many brokers in parallel,\nbut instance must run in a separate directory.\n===="
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start-web.adoc",
    "content": ":imagesdir: ./images\n[[quick-start-web]]\n==== Quick Start - Web\n\nIn this guide both consumer and provider are written in TypeScript language and run in https://electron.atom.io/[Electron] container.\n\n===== Run example\n\ninclude::guides-quick-start-launch-broker-step.adoc[]\n\n. Launch `WebCcyPairRateViewer` app:\n+\n[source, bash]\n-----\nplexus launch vendor_b.fx.WebCcyPairRateViewer\n-----\n+\ninclude::guides-quick-start-launch-app.adoc[]\n\n. App window will open. In this window you should see \"Connected to Broker\" message.\n\n. Enter a currency pair name (e.g. \"EURUSD\") and click \"Get Rate\" button:\n+\nimage::quick-start-web-1.png[Quick Start Web 1]\n+\ninclude::guides-quick-start-invocation-workflow.adoc[]\n+\n[NOTE]\n====\nThis guide uses a sample `ElectronAppLauncher`. To understand how to build custom launchers see <<guides-how-to-write-custom-app-launcher, How to write custom app launcher>>.\n====\n\n. Broker starts \"CCY Rate Provider\" app and forwards request to it. App shows information about the request and sends back a random value.\n+\nimage::quick-start-web-2.png[Quick Start Web 2]\n\n. The \"CCY Rate Viewer\" app shows the rate received from provider:\n+\nimage::quick-start-web-3.png[Quick Start Web 3]\n\n===== Modify example\n\nLet us add real-time updates of FX rates instead of a single response. For this we have to change the contract between two apps, provide updated interop metadata to the broker, update apps and run them again.\n\n====== Modify metadata\n\nFirst we need to modify interop registry and pass updated metadata to the broker.\n\n. Open `registry/fx/ccy_pair_rate_service.proto` file and add a new `GetRateStream` method:\n+\n[source, php]\n./registry/fx/ccy_pair_rate_service.proto\n-----\nservice CcyPairRateService {\n    rpc GetRate(CcyPair) returns (CcyPairRate);\n\n    // new rpc call returning real-time notification stream\n    rpc GetRateStream(CcyPair) returns (stream CcyPairRate);\n}\n-----\n\n. Open `registry/vendor_a/fx/web_ccy_pair_rate_provider.interop` file and change provided method to `GetRateStream`:\n+\n[source, php]\n./registry/vendor_a/fx/web_ccy_pair_rate_provider.interop\n-----\npackage vendor_a.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication WebCcyPairRateProvider {\n    provides .fx.CcyPairRateService {\n        GetRateStream [title = \"Web Provider - Get Rate Stream\"];\n    }\n}\n-----\n\n. Open `registry/vendor_b/fx/web_ccy_pair_rate_viewer.interop` file and change consumed method to `GetRateStream`:\n+\n[source, php]\n./registry/vendor_b/fx/web_ccy_pair_rate_viewer.interop\n-----\npackage vendor_b.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication WebCcyPairRateViewer {\n    consumes .fx.CcyPairRateService { GetRateStream; }\n}\n-----\n\n. To pass the changed metadata to broker, navigate back to `bin\\win-x86\\samples\\quick-start` and re-generate metadata using *plexusgen* tool:\n+\n[source, bash]\n-----\njava -jar ../../sdk/plexusgen.jar --type=json_meta --baseDir=registry --out=metadata\n-----\n+\n[NOTE]\n====\nBroker tracks `interop.json` file and automatically reloads metadata when the file is changed.\n====\n\n====== Modify and build provider app\n\nWe changed provided service definition, so now we need to re-generate provider's client and provide implementation for new method:\n\n. From project root call *Plexus Generator* tool to re-generate provider's client code:\n+\n[source, bash]\n-----\njava -jar bin/win-x86/sdk/plexusgen.jar --type=ts --baseDir=./bin/win-x86/samples/quick-start/registry --input=web_ccy_pair_rate_provider.interop --out=./web/packages/ccy-pair-rate-provider/src/gen --protoc=./web/node_modules/.bin/pbts.cmd\n-----\n+\n[NOTE]\n====\nPlexus Generator tool will generate interfaces and proxy classes from service descriptions. It uses https://github.com/dcodeIO/protobuf.js/tree/master/cli[ProtobufJs] to generate message definitions from `.proto` files.\n====\n\n. Open `web/packages/ccy-pair-rate-provider/src/index.ts` file and change `onGetRate` implementation to `onGetRateStream`:\n+\n[source,javascript]\n-----\nnew WebCcyPairRateProviderClientBuilder()\n    .withClientDetails({\n        applicationId: \"vendor_a.fx.WebCcyPairRateProvider\",\n        applicationInstanceId: instanceId\n    })\n    .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket(webSocketUrl)).connect())\n    .withCcyPairRateServiceInvocationsHandler({\n        onGetRateStream: async (invocationContext, ccyPair, hostClient) => {\n            log(`Received Streaming request for ${ccyPair.ccyPairName} Rate`);\n            // send several rates and complete the invocation\n            let count = 5;\n            const sendResponse = () => {\n                if (count) {\n                    count--;\n                    hostClient.next(rateService.getRate(ccyPair.ccyPairName));\n                    setTimeout(sendResponse, 1000);\n                } else {\n                    hostClient.complete();\n                }\n            };\n            sendResponse();\n        }\n    })\n    .connect()\n    .then(() => log(\"Connected to Broker\"))\n    .catch(e => console.error(\"Connection failure\", e));\n-----\n\n+\n[NOTE]\n====\nIn this example provider will send five rates and then will close the stream.\n====\n\n. Navigate to `web/packages/ccy-pair-rate-provider` directory and run `npm run build` to re-build the app.\n\n====== Modify and build consumer app\n\nBecause interop method was changed we also need to re-generate consumer's client code and modify how response is handled:\n\n. From project root call *Plexus Generator* tools to re-generate consumer's client code:\n+\n[source, bash]\n-----\njava -jar bin/win-x86/sdk/plexusgen.jar --type=ts --baseDir=./bin/win-x86/samples/quick-start/registry --input=web_ccy_pair_rate_viewer.interop --out=./web/packages/ccy-pair-rate-viewer/src/gen --protoc=./web/node_modules/.bin/pbts.cmd\n-----\n\n. Open `web/packages/ccy-pair-rate-viewer/src/index.ts` and update code to invoke streaming `getRateStream` action:\n+\n[source, javascript]\n-----\nnew WebCcyPairRateViewerClientBuilder()\n    .withClientDetails({\n        applicationId: \"vendor_b.fx.WebCcyPairRateViewer\",\n        applicationInstanceId: instanceId\n    })\n    .withTransportConnectionProvider(\n        () => new WebSocketConnectionFactory(new WebSocket(webSocketUrl)).connect()\n    )\n    .connect()\n    .then(async (rateViewerClient: WebCcyPairRateViewerClient) => {\n        log(\"Connected to Broker\");\n        window.getRate = async () => {\n            const ccyPair = (document.getElementById(\"ccyPair\") as HTMLInputElement).value;\n            log(`Sending request for ${ccyPair}`);\n            rateViewerClient.getCcyPairRateServiceProxy()\n                .getRateStream({ccyPairName: ccyPair}, {\n                    next: ccyRate => {\n                        log(`Received rate ${ccyRate.ccyPairName} - ${ccyRate.rate}`);\n                    },\n                    complete: () => log(\"Completed\"),\n                    error: () => log(\"Error received\")\n                });\n        };\n    });\n-----\n\n. Navigate to `web/packages/ccy-pair-rate-viewer` and run `npm run build` to re-build the app.\n\n====== Launch the modified example\n\n. Navigate to `bin\\win-x86\\samples\\quick-start`\n\n. Launch the viewer app:\n+\n[source, bash]\n-----\nplexus launch vendor_b.fx.WebCcyPairRateViewer\n-----\n\n. In the opened window enter a currency pair name, e.g. `EURUSD` and press `Enter`:\n+\nimage::quick-start-web-6.png[Quick Start Web 6]\n\n. Broker starts the provider app and redirects request to it:\n+\nimage::quick-start-web-5.png[Quick Start Web 5]\n\n. The viewer app shows five rates received from provider and a message that reply stream was closed:\n+\nimage::quick-start-web-4.png[Quick Start Web 4]"
  },
  {
    "path": "docs/src/main/asciidoc/guides-quick-start.adoc",
    "content": "ifdef::env-github,env-browser[:outFileSuffix: .adoc]\n\nIn this section we will be going through the case of two simple business apps communicating with each other via Plexus Interop:\n\n- `CcyPairRateProvider` - an app developed by Vendor A, which provides FX currency pair rates.\n- `CcyPairRateViewer` - an app developed by Vendor B, which allows user to request FX currency pair rates from other apps and see them.\n\nTwo most popular cases for interoperability are web and .NET, so the guide is split into two independent sections:\n\n- <<quick-start-web, Web (TypeScript)>>\n- <<quick-start-dotnet, .NET (C#)>>.\n\nBoth guides describe the same flow/API, so if you want to experiment with interop between different technologies - just combine the samples, e.g. take web implementation of `CcyPairRateViewer` from the first guide and\n.NET implementation of `CcyPairRateProvider` from the second guide and run them together.\n\n==== Prerequisites\n\nYou will need the following software:\n\n- Windows 7+\n- http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html[JDK 8+]\n- https://nodejs.org/en/download/[Node.js 6+ with npm 3+] for Web quick start\n- https://www.microsoft.com/net/download/core[.NET Core SDK 2.0+] for .NET quick start\n\nYou also need to build Plexus Interop components if you have not done it yet. See <<how-to-build, How to build>> for details.\n\ninclude::guides-quick-start-web.adoc[]\n\ninclude::guides-quick-start-dotnet.adoc[]\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "docs/src/main/asciidoc/guides-system-requirements.adoc",
    "content": "==== Supported Windows versions\n\n* Windows 7 SP1\n* Windows 8.1\n* Windows 10\n* Windows Server 2008 R2 SP1\n* Windows Server 2012 SP1\n* Windows Server 2012 R2 SP1\n* Windows Server 2016\n\n==== Supported Mac OS X versions\n\nNot supported for now. Will be added soon."
  },
  {
    "path": "docs/src/main/asciidoc/guides-tools.adoc",
    "content": ":imagesdir: ./images\nifdef::env-github,env-browser[:outFileSuffix: .adoc]\n\nThis section describes available tools which simplify development and testing process.\n\n==== Plexus Command Line Interface (CLI)\n\nPlexus Command Line Interface used for metadata validation and generating the strong-typed client code in different languages.\n\n===== Installation\n\nPlexus CLI tool can be installed using following command:\n\n[source, bash]\n-----\nnpm i @plexus-interop/cli --global\n-----\n\nIf you work in restricted environment, then please consider adjusting following environment properties before installation:\n\n\n|===\n|Environment variable name |Details\n\n|PLEXUS_JRE_DOWNLOAD_URL\n|Custom JRE package download URL\n\n|PLEXUS_CLI_JAVA_EXE_PATH\n|Full path to _java_ executable\n\n|PLEXUS_PROTOC_DOWNLOAD_URL\n|Custom Proto Compiler package download url\n\n|PLEXUS_CLI_PROTOC_EXE_PATH\n|Full path to _protoc_ executable\n|===\n\n===== Usage\n\nTo list all available commands please use:\n\n[source, bash]\n-----\nplexus --help\n-----\n\nit will print all commands with their descriptions:\n\n[source, bash]\n-----\n  Usage: plexus [options] [command]\n\n  Options:\n\n    -V, --version             output the version number\n    -h, --help                output usage information\n\n  Commands:\n\n    gen-ts [options]          generate Typescript client and messages definitions for specified entry point\n    gen-json-meta [options]   generate metadata in JSON format\n    gen-proto [options]       generate proto definitions for specified entry point\n    gen-csharp [options]      generate C# client and messages definitions for specified entry point\n    validate [options]        validate metadata\n    validate-patch [options]  validate metadata update\n\n  Help for specific command:  plexus [command] --help\n-----\n\nto get help for specific command please use:\n\n[source, bash]\n-----\nplexus [command] --help\n-----\n\n==== Plexus Studio\n\nPlexus Studio is a development tool to explore and test Plexus Interop APIs defined in metadata. It can connect to Plexus Interop on behalf of any available application, handles invocations and executes any consumed action.\n\n===== Invoke action workflow\n\nLet's take a look at simple workflow of simulating action invocation. It provides an ability to test your Provider application without installing/getting any information about possible Consumer applications. To invoke action please follow steps below:\n\n. Find required application in the list and click it to connect on behalf of this Application:\n+\nimage::guide-studio-apps-list.png[Plexus Studio Apps]\n\n. Choose required Action from *Consumed Services* section\n+\nimage::guide-studio-consumer.png[Plexus Studio Consumer]\n\n. On *Consumed Action* screen you can:\n\n- Specify request payload in https://developers.google.com/protocol-buffers/docs/proto3#json[JSON format]\n- Discover available action providers\n- Choose target application\n- Send request and get response details\n\n+\nimage::guide-studio-consumed.png[Plexus Studio Consumed action]\n\n\n\n"
  },
  {
    "path": "docs/src/main/asciidoc/images/high-level-architecture.graphml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:y=\"http://www.yworks.com/xml/graphml\" xmlns:yed=\"http://www.yworks.com/xml/yed/3\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd\">\n  <!--Created by yEd 3.13-->\n  <key attr.name=\"Description\" attr.type=\"string\" for=\"graph\" id=\"d0\"/>\n  <key for=\"port\" id=\"d1\" yfiles.type=\"portgraphics\"/>\n  <key for=\"port\" id=\"d2\" yfiles.type=\"portgeometry\"/>\n  <key for=\"port\" id=\"d3\" yfiles.type=\"portuserdata\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"node\" id=\"d4\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"node\" id=\"d5\"/>\n  <key for=\"node\" id=\"d6\" yfiles.type=\"nodegraphics\"/>\n  <key for=\"graphml\" id=\"d7\" yfiles.type=\"resources\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"edge\" id=\"d8\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"edge\" id=\"d9\"/>\n  <key for=\"edge\" id=\"d10\" yfiles.type=\"edgegraphics\"/>\n  <graph edgedefault=\"directed\" id=\"G\">\n    <data key=\"d0\"/>\n    <node id=\"n0\" yfiles.foldertype=\"group\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:ProxyAutoBoundsNode>\n          <y:Realizers active=\"0\">\n            <y:GroupNode>\n              <y:Geometry height=\"358.1678571428572\" width=\"454.92388935391864\" x=\"229.076171875\" y=\"-692.8408730158731\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\" width=\"454.92388935391864\" x=\"0.0\" y=\"0.0\">Desktop Plexus Host</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:NodeBounds considerNodeLabelSize=\"true\"/>\n              <y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n              <y:BorderInsets bottom=\"53\" bottomF=\"53.103968253968276\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"1\" topF=\"1.0001224578373922\"/>\n            </y:GroupNode>\n            <y:GroupNode>\n              <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\" width=\"59.02685546875\" x=\"-4.513427734375\" y=\"0.0\">Folder 1</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n              <y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n            </y:GroupNode>\n          </y:Realizers>\n        </y:ProxyAutoBoundsNode>\n      </data>\n      <graph edgedefault=\"directed\" id=\"n0:\">\n        <node id=\"n0::n0\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"90.037109375\" x=\"570.9590456039186\" y=\"-654.4642857142857\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"80.037109375\" x=\"5.0\" y=\"10.6494140625\">Interop Broker<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n0::n1\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"106.044921875\" x=\"562.9551393539186\" y=\"-482.77698412698413\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"96.044921875\" x=\"5.0\" y=\"10.6494140625\">Interop Transport<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n0::n2\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"91.373046875\" x=\"244.076171875\" y=\"-442.77698412698413\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"81.373046875\" x=\"5.0\" y=\"3.298828125\">App Life Cycle\nManager<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n      </graph>\n    </node>\n    <node id=\"n1\" yfiles.foldertype=\"group\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:ProxyAutoBoundsNode>\n          <y:Realizers active=\"0\">\n            <y:GroupNode>\n              <y:Geometry height=\"437.75119047619046\" width=\"167.39062500000023\" x=\"1127.5575389074902\" y=\"-437.75119047619046\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\" width=\"167.39062500000023\" x=\"0.0\" y=\"0.0\">App Instance</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:NodeBounds considerNodeLabelSize=\"true\"/>\n              <y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n              <y:BorderInsets bottom=\"1\" bottomF=\"1.0\" left=\"27\" leftF=\"26.6875\" right=\"0\" rightF=\"2.2737367544323206E-13\" top=\"1\" topF=\"1.0001224578372785\"/>\n            </y:GroupNode>\n            <y:GroupNode>\n              <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\" width=\"59.02685546875\" x=\"-4.513427734375\" y=\"0.0\">Folder 2</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n              <y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n            </y:GroupNode>\n          </y:Realizers>\n        </y:ProxyAutoBoundsNode>\n      </data>\n      <graph edgedefault=\"directed\" id=\"n1:\">\n        <node id=\"n1::n0\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"106.044921875\" x=\"1171.5741404699902\" y=\"-399.3746031746032\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"96.044921875\" x=\"5.0\" y=\"10.6494140625\">Interop Transport<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n1::n1\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"110.703125\" x=\"1169.2450389074902\" y=\"-227.6873015873016\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"100.703125\" x=\"5.0\" y=\"3.298828125\">Client Service API\n(generated)<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n1::n2\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"106.05078125\" x=\"1171.5712107824902\" y=\"-56.0\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"96.05078125\" x=\"5.0\" y=\"10.6494140625\">App Functionality<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n      </graph>\n    </node>\n    <node id=\"n2\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"82.6953125\" x=\"8.00390625\" y=\"-442.77698412698413\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"72.6953125\" x=\"5.0\" y=\"10.6494140625\">App Registry<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n3\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"98.703125\" x=\"0.0\" y=\"-664.4642857142857\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"88.703125\" x=\"5.0\" y=\"10.6494140625\">Interop Registry<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n4\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"88.724609375\" x=\"759.0000612289186\" y=\"-409.3746031746032\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"78.724609375\" x=\"5.0\" y=\"10.6494140625\">App Launcher<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n5\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"78.025390625\" x=\"10.3388671875\" y=\"-836.1515873015873\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"68.025390625\" x=\"5.0\" y=\"10.6494140625\">Plexus SDK<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n6\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"74.03515625\" x=\"12.333984375\" y=\"-926.1515873015873\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"64.03515625\" x=\"5.0\" y=\"3.298828125\">Interop API\nDefinitions<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <edge id=\"e0\" source=\"n2\" target=\"n3\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"-2.3515625\" sy=\"5.276984126984132\" tx=\"-2.3515625\" ty=\"5.964285714285666\"/>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.25\" textColor=\"#000000\" visible=\"true\" width=\"60.6953125\" x=\"-2.0\" y=\"-64.50923432849703\">references<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e1\" source=\"n3\" target=\"n0::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"49.3515625\" sy=\"-0.0\" tx=\"-45.0185546875\" ty=\"-10.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.375\" textColor=\"#000000\" visible=\"true\" width=\"53.376953125\" x=\"159.6108628045945\" y=\"2.0000087193080844\">load data<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e2\" source=\"n2\" target=\"n0::n2\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"41.34765625\" sy=\"-0.0\" tx=\"-45.6865234375\" ty=\"-0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"53.376953125\" x=\"50.0\" y=\"1.9999934120783678\">load data<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e0\" source=\"n0::n0\" target=\"n0::n2\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"-45.0185546875\" sy=\"10.0\" tx=\"45.6865234375\" ty=\"-13.333333333333314\">\n            <y:Point x=\"533.9385377914186\" y=\"-624.4642857142857\"/>\n            <y:Point x=\"513.9385377914186\" y=\"-605.7629061259921\"/>\n            <y:Point x=\"397.86236591641864\" y=\"-605.7629061259921\"/>\n            <y:Point x=\"355.44921875\" y=\"-436.11031746031745\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.47984357792177534\" textColor=\"#000000\" visible=\"true\" width=\"106.076171875\" x=\"-172.0605466812376\" y=\"-1.9997835673983673\">request app launch<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e1\" source=\"n0::n0\" target=\"n0::n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"20.0\" tx=\"0.0\" ty=\"-20.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"-74.03906230623761\" y=\"49.14248763795888\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e3\" source=\"n4\" target=\"n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"44.3623046875\" sy=\"-0.0\" tx=\"-83.69531250000023\" ty=\"-170.49900793650795\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.0\" textColor=\"#000000\" visible=\"true\" width=\"151.416015625\" x=\"37.16671336340528\" y=\"2.0000000968811946\">launch app, watch its status<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e4\" source=\"n0::n1\" target=\"n1::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"53.0224609375\" sy=\"-0.0\" tx=\"-53.0224609375\" ty=\"-0.0\">\n            <y:Point x=\"960.4414674789186\" y=\"-462.77698412698413\"/>\n            <y:Point x=\"1112.55753890749\" y=\"-379.3746031746032\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.2791409810812749\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"114.26367206876239\" y=\"1.9999934120783678\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n1::e0\" source=\"n1::n0\" target=\"n1::n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"20.0\" tx=\"0.0\" ty=\"-20.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"-74.0390187096973\" y=\"49.14247901553199\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n1::e1\" source=\"n1::n1\" target=\"n1::n2\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"20.0\" tx=\"0.0\" ty=\"-20.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"-74.0390187096973\" y=\"49.14247896709139\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e5\" source=\"n5\" target=\"n1::n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"39.0126953125\" sy=\"-0.0\" tx=\"-55.3515625\" ty=\"-0.0\">\n            <y:Point x=\"960.4414674789186\" y=\"-816.1515873015873\"/>\n            <y:Point x=\"1112.55753890749\" y=\"-207.6873015873016\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.3367168679802686\" textColor=\"#000000\" visible=\"true\" width=\"80.728515625\" x=\"497.76480877588665\" y=\"2.0000240265377442\">generate code<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e6\" source=\"n0::n2\" target=\"n4\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"45.6865234375\" sy=\"-0.0\" tx=\"-44.3623046875\" ty=\"-10.0\">\n            <y:Point x=\"719.0000612289186\" y=\"-422.77698412698413\"/>\n            <y:Point x=\"739.0000612289186\" y=\"-399.3746031746032\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.6749085024675866\" textColor=\"#000000\" visible=\"true\" width=\"88.046875\" x=\"223.40922560918898\" y=\"1.9999934120783678\">start and pass\napp parameters<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e7\" source=\"n4\" target=\"n0::n2\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"-44.3623046875\" sy=\"10.0\" tx=\"45.6865234375\" ty=\"13.333333333333314\">\n            <y:Point x=\"739.0000612289186\" y=\"-379.3746031746032\"/>\n            <y:Point x=\"719.0000612289186\" y=\"-350.6734126984127\"/>\n            <y:Point x=\"455.90045185391864\" y=\"-350.6734126984127\"/>\n            <y:Point x=\"355.44921875\" y=\"-409.4436507936508\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.4066989554748304\" textColor=\"#000000\" visible=\"true\" width=\"94.052734375\" x=\"-218.5371091812376\" y=\"8.000018698071699\">report app status<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e8\" source=\"n6\" target=\"n5\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"20.0\" tx=\"0.0\" ty=\"-20.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e9\" source=\"n5\" target=\"n3\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"20.0\" tx=\"0.0\" ty=\"-20.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"67.357421875\" x=\"-69.357421875\" y=\"49.14250294518854\">publish\nnew service<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n  </graph>\n  <data key=\"d7\">\n    <y:Resources/>\n  </data>\n</graphml>\n"
  },
  {
    "path": "docs/src/main/asciidoc/images/interop-integration.graphml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:java=\"http://www.yworks.com/xml/yfiles-common/1.0/java\" xmlns:sys=\"http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0\" xmlns:x=\"http://www.yworks.com/xml/yfiles-common/markup/2.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:y=\"http://www.yworks.com/xml/graphml\" xmlns:yed=\"http://www.yworks.com/xml/yed/3\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd\">\n  <!--Created by yEd 3.16.2.1-->\n  <key attr.name=\"Description\" attr.type=\"string\" for=\"graph\" id=\"d0\"/>\n  <key for=\"port\" id=\"d1\" yfiles.type=\"portgraphics\"/>\n  <key for=\"port\" id=\"d2\" yfiles.type=\"portgeometry\"/>\n  <key for=\"port\" id=\"d3\" yfiles.type=\"portuserdata\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"node\" id=\"d4\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"node\" id=\"d5\"/>\n  <key for=\"node\" id=\"d6\" yfiles.type=\"nodegraphics\"/>\n  <key for=\"graphml\" id=\"d7\" yfiles.type=\"resources\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"edge\" id=\"d8\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"edge\" id=\"d9\"/>\n  <key for=\"edge\" id=\"d10\" yfiles.type=\"edgegraphics\"/>\n  <graph edgedefault=\"directed\" id=\"G\">\n    <data key=\"d0\"/>\n    <node id=\"n0\" yfiles.foldertype=\"group\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:ProxyAutoBoundsNode>\n          <y:Realizers active=\"0\">\n            <y:GroupNode>\n              <y:Geometry height=\"302.83766180518955\" width=\"449.7708128731681\" x=\"137.79167743728226\" y=\"-506.5714080712234\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"449.7708128731681\" x=\"0.0\" y=\"0.0\">Dev Workstation</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:NodeBounds considerNodeLabelSize=\"true\"/>\n              <y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n              <y:BorderInsets bottom=\"16\" bottomF=\"15.899797926550661\" left=\"0\" leftF=\"0.0\" right=\"117\" rightF=\"117.26073734272518\" top=\"21\" topF=\"20.878171131181148\"/>\n            </y:GroupNode>\n            <y:GroupNode>\n              <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"59.02685546875\" x=\"-4.513427734375\" y=\"0.0\">Folder 1</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n              <y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n            </y:GroupNode>\n          </y:Realizers>\n        </y:ProxyAutoBoundsNode>\n      </data>\n      <graph edgedefault=\"directed\" id=\"n0:\">\n        <node id=\"n0::n0\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"106.044921875\" x=\"152.79167743728226\" y=\"-448.31677209629225\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"96.0625\" x=\"4.9912109375\" y=\"10.6494140625\">Local Metatadata<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n0::n1\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"98.041015625\" x=\"357.2607373427252\" y=\"-448.31677209629225\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"57.35546875\" x=\"20.3427734375\" y=\"10.6494140625\">Client API<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n0::n2\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"98.041015625\" x=\"357.2607373427252\" y=\"-274.6335441925845\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"77.376953125\" x=\"10.33203125\" y=\"10.6494140625\">Plexus Studio<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n        <node id=\"n0::n3\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"98.041015625\" x=\"357.2607373427252\" y=\"-361.4751581444384\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"62.705078125\" x=\"17.66796875\" y=\"10.6494140625\">Application<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n      </graph>\n    </node>\n    <node id=\"n1\" yfiles.foldertype=\"group\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:ProxyAutoBoundsNode>\n          <y:Realizers active=\"0\">\n            <y:GroupNode>\n              <y:Geometry height=\"153.30602852457093\" width=\"205.177643565498\" x=\"133.11589618728226\" y=\"-768.0178483570548\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"205.177643565498\" x=\"0.0\" y=\"0.0\">Registry Server</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:NodeBounds considerNodeLabelSize=\"true\"/>\n              <y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n              <y:BorderInsets bottom=\"12\" bottomF=\"12.311248755344764\" left=\"5\" leftF=\"4.67578125\" right=\"64\" rightF=\"64.45694044049799\" top=\"49\" topF=\"48.61831492547617\"/>\n            </y:GroupNode>\n            <y:GroupNode>\n              <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"59.02685546875\" x=\"-4.513427734375\" y=\"0.0\">Folder 2</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n              <y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n            </y:GroupNode>\n          </y:Realizers>\n        </y:ProxyAutoBoundsNode>\n      </data>\n      <graph edgedefault=\"directed\" id=\"n1:\">\n        <node id=\"n1::n0\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"106.044921875\" x=\"152.79167743728226\" y=\"-682.0230685878287\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"101.376953125\" x=\"2.333984375\" y=\"10.6494140625\">Metadata Registry<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n      </graph>\n    </node>\n    <node id=\"n2\" yfiles.foldertype=\"group\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:ProxyAutoBoundsNode>\n          <y:Realizers active=\"0\">\n            <y:GroupNode>\n              <y:Geometry height=\"153.30602852457093\" width=\"210.720644627345\" x=\"600.1098710489059\" y=\"-768.0178483570548\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"210.720644627345\" x=\"0.0\" y=\"0.0\">Live Server</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:NodeBounds considerNodeLabelSize=\"true\"/>\n              <y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n              <y:BorderInsets bottom=\"12\" bottomF=\"12.311248755344764\" left=\"30\" leftF=\"29.675722752344996\" right=\"16\" rightF=\"16.0\" top=\"49\" topF=\"48.61831492547617\"/>\n            </y:GroupNode>\n            <y:GroupNode>\n              <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n              <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"59.02685546875\" x=\"-4.513427734375\" y=\"0.0\">Folder 2</y:NodeLabel>\n              <y:Shape type=\"roundrectangle\"/>\n              <y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n              <y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n              <y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n            </y:GroupNode>\n          </y:Realizers>\n        </y:ProxyAutoBoundsNode>\n      </data>\n      <graph edgedefault=\"directed\" id=\"n2:\">\n        <node id=\"n2::n0\">\n          <data key=\"d6\">\n            <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n              <y:Geometry height=\"40.0\" width=\"135.044921875\" x=\"644.7855938012509\" y=\"-682.0230685878287\"/>\n              <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n              <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n              <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"132.05078125\" x=\"1.4970703125\" y=\"10.6494140625\">Interop Registry Service<y:LabelModel>\n                  <y:SmartNodeLabelModel distance=\"4.0\"/>\n                </y:LabelModel>\n                <y:ModelParameter>\n                  <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n                </y:ModelParameter>\n              </y:NodeLabel>\n            </y:GenericNode>\n          </data>\n        </node>\n      </graph>\n    </node>\n    <node id=\"n3\">\n      <data key=\"d4\"/>\n      <data key=\"d6\">\n        <y:SVGNode>\n          <y:Geometry height=\"56.69077490774907\" width=\"30.70258302583025\" x=\"-45.00916867664773\" y=\"-690.3684560417032\"/>\n          <y:Fill color=\"#FFCC00\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"13\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"19.92626953125\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"56.7490234375\" x=\"-13.023220205834889\" y=\"60.69077490774907\">Approver<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"-0.5\" nodeRatioX=\"0.0\" nodeRatioY=\"0.5\" offsetX=\"0.0\" offsetY=\"4.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n          <y:SVGNodeProperties usingVisualBounds=\"false\"/>\n          <y:SVGModel svgBoundsPolicy=\"0\">\n            <y:SVGContent refid=\"1\"/>\n          </y:SVGModel>\n        </y:SVGNode>\n      </data>\n    </node>\n    <node id=\"n4\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"106.044921875\" x=\"659.2855938012509\" y=\"-506.5714080712234\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"88.03515625\" x=\"9.0048828125\" y=\"10.6494140625\">Plexus Runtime<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <edge id=\"e0\" source=\"n0::n0\" target=\"n1::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"-23.24847656963081\" sy=\"-19.966659162127485\" tx=\"-23.24847656963081\" ty=\"19.973033106774437\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"none\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.625\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"146.083984375\" x=\"-148.0839811391845\" y=\"-125.53414734490877\">1. Clone existing metadata<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e0\" source=\"n0::n0\" target=\"n0::n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"99.390625\" x=\"0.03484386461309441\" y=\"20.649414427145246\">3. API Generation<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"0.0\" distance=\"30.0\" distanceToCenter=\"true\" position=\"right\" ratio=\"0.5\" segment=\"0\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e1\" source=\"n0::n0\" target=\"n0::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\">\n            <y:Point x=\"205.81413837478226\" y=\"-375.1389123176945\"/>\n          </y:Path>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"105.396484375\" x=\"-27.02472881271774\" y=\"23.80572879558673\">2. Define Metadata<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"6.283185307179586\" distance=\"10.0\" distanceToCenter=\"false\" position=\"center\" ratio=\"1.0\" segment=\"0\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e1\" source=\"n0::n0\" target=\"n1::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"141.419921875\" x=\"7.69447279113308\" y=\"-125.31220973248367\">5. Raise Change Request<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"6.283185307179586\" distance=\"78.4044280442805\" distanceToCenter=\"true\" position=\"right\" ratio=\"0.6157964706521354\" segment=\"-1\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e2\" source=\"n3\" target=\"n1::n0\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"104.716796875\" x=\"31.16390877012448\" y=\"20.649416763733825\">7. Review/Approve<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"0.0\" distance=\"30.0\" distanceToCenter=\"true\" position=\"right\" ratio=\"0.5\" segment=\"0\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e3\" source=\"n2::n0\" target=\"n4\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"158.083984375\" x=\"5.6000845383214255\" y=\"59.6310786759052\">Get current Interop Metadata<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"6.283185307179586\" distance=\"84.64206642066426\" distanceToCenter=\"true\" position=\"left\" ratio=\"0.5118007694381439\" segment=\"-1\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e4\" source=\"n1::n0\" target=\"n2::n0\">\n      <data key=\"d9\"/>\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"138.7421875\" x=\"123.60845983801659\" y=\"20.649416763733825\">8. Promotion of Metadata<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"0.0\" distance=\"30.0\" distanceToCenter=\"true\" position=\"right\" ratio=\"0.5\" segment=\"0\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e2\" source=\"n0::n1\" target=\"n0::n3\">\n      <data key=\"d9\"/>\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"none\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"112.076171875\" x=\"9.961909217725179\" y=\"16.098358610103446\">4. Integration to App<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"6.283185307179586\" distance=\"66.0\" distanceToCenter=\"true\" position=\"left\" ratio=\"0.6102508963963956\" segment=\"-1\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"n0::e3\" source=\"n0::n3\" target=\"n0::n2\">\n      <data key=\"d9\"/>\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" horizontalTextPosition=\"center\" iconTextGap=\"4\" modelName=\"custom\" preferredPlacement=\"anywhere\" ratio=\"0.5\" textColor=\"#000000\" verticalTextPosition=\"bottom\" visible=\"true\" width=\"159.419921875\" x=\"11.290034217725179\" y=\"14.09835879242604\">5. Test against Plexus Studio<y:LabelModel>\n              <y:SmartEdgeLabelModel autoRotationEnabled=\"false\" defaultAngle=\"0.0\" defaultDistance=\"10.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartEdgeLabelModelParameter angle=\"6.283185307179586\" distance=\"91.0\" distanceToCenter=\"true\" position=\"left\" ratio=\"0.5\" segment=\"0\"/>\n            </y:ModelParameter>\n            <y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" frozen=\"true\" placement=\"anywhere\" side=\"anywhere\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n  </graph>\n  <data key=\"d7\">\n    <y:Resources>\n      <y:Resource id=\"1\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?&gt;\n&lt;!-- Created with Inkscape (http://www.inkscape.org/) --&gt;\n&lt;svg\n   xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n   xmlns:cc=\"http://web.resource.org/cc/\"\n   xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n   xmlns:svg=\"http://www.w3.org/2000/svg\"\n   xmlns=\"http://www.w3.org/2000/svg\"\n   xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n   xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n   width=\"41\"\n   height=\"68.997391\"\n   id=\"svg2\"\n   sodipodi:version=\"0.32\"\n   inkscape:version=\"0.45.1\"\n   sodipodi:docbase=\"C:\\Daten\\alberts\\projects\\yfx\"\n   sodipodi:docname=\"uml_actor.svg\"\n   inkscape:output_extension=\"org.inkscape.output.svg.inkscape\"\n   version=\"1.0\"&gt;\n  &lt;defs\n     id=\"defs4\" /&gt;\n  &lt;sodipodi:namedview\n     id=\"base\"\n     pagecolor=\"#ffffff\"\n     bordercolor=\"#666666\"\n     borderopacity=\"1.0\"\n     inkscape:pageopacity=\"0.0\"\n     inkscape:pageshadow=\"2\"\n     inkscape:zoom=\"2.934351\"\n     inkscape:cx=\"144.21983\"\n     inkscape:cy=\"28.533711\"\n     inkscape:document-units=\"px\"\n     inkscape:current-layer=\"layer1\"\n     showgrid=\"true\"\n     inkscape:window-width=\"1280\"\n     inkscape:window-height=\"968\"\n     inkscape:window-x=\"-4\"\n     inkscape:window-y=\"-4\"\n     width=\"48px\"\n     height=\"48px\"\n     showborder=\"false\"\n     inkscape:showpageshadow=\"false\" /&gt;\n  &lt;metadata\n     id=\"metadata7\"&gt;\n    &lt;rdf:RDF&gt;\n      &lt;cc:Work\n         rdf:about=\"\"&gt;\n        &lt;dc:format&gt;image/svg+xml&lt;/dc:format&gt;\n        &lt;dc:type\n           rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" /&gt;\n      &lt;/cc:Work&gt;\n    &lt;/rdf:RDF&gt;\n  &lt;/metadata&gt;\n  &lt;g\n     inkscape:label=\"Ebene 1\"\n     inkscape:groupmode=\"layer\"\n     id=\"layer1\"\n     transform=\"translate(-29.5,-42.959476)\"&gt;\n    &lt;a\n       id=\"a3142\"\n       transform=\"matrix(1.0873906,0,0,1,-4.4741999,0)\"&gt;\n      &lt;path\n         transform=\"translate(11.586889,5.2908993)\"\n         d=\"M 47.02914 47.36993 A 8.5197716 9.2013531 0 1 1  29.989597,47.36993 A 8.5197716 9.2013531 0 1 1  47.02914 47.36993 z\"\n         sodipodi:ry=\"9.2013531\"\n         sodipodi:rx=\"8.5197716\"\n         sodipodi:cy=\"47.36993\"\n         sodipodi:cx=\"38.509369\"\n         id=\"path2160\"\n         style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"\n         sodipodi:type=\"arc\" /&gt;\n    &lt;/a&gt;\n    &lt;path\n       sodipodi:type=\"arc\"\n       style=\"fill:none\"\n       id=\"path3134\"\n       sodipodi:cx=\"43.962021\"\n       sodipodi:cy=\"48.392303\"\n       sodipodi:rx=\"3.7486994\"\n       sodipodi:ry=\"0\"\n       d=\"M 47.71072 48.392303 A 3.7486994 0 0 1 1  40.213321,48.392303 A 3.7486994 0 0 1 1  47.71072 48.392303 z\" /&gt;\n    &lt;path\n       style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.24319649px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"\n       d=\"M 50,61.33709 C 50,91.363211 50,92.247838 50,92.247838\"\n       id=\"path3136\" /&gt;\n    &lt;path\n       style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"\n       d=\"M 69.760668,72.362183 C 69.760668,72.362183 69.760668,72.362183 50.239332,72.362183 C 30.239332,72.362183 30.239332,72.362183 30.239332,72.362183 L 30.239332,72.362183\"\n       id=\"path3138\" /&gt;\n    &lt;path\n       style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"\n       d=\"M 30,111.45687 C 30,111.45687 30,111.45687 50,92.013532 C 70,111.45687 70,111.45687 70,111.45687\"\n       id=\"path3140\" /&gt;\n  &lt;/g&gt;\n&lt;/svg&gt;\n</y:Resource>\n    </y:Resources>\n  </data>\n</graphml>\n"
  },
  {
    "path": "docs/src/main/asciidoc/images/star-schema.graphml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:y=\"http://www.yworks.com/xml/graphml\" xmlns:yed=\"http://www.yworks.com/xml/yed/3\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd\">\n  <!--Created by yEd 3.13-->\n  <key attr.name=\"Description\" attr.type=\"string\" for=\"graph\" id=\"d0\"/>\n  <key for=\"port\" id=\"d1\" yfiles.type=\"portgraphics\"/>\n  <key for=\"port\" id=\"d2\" yfiles.type=\"portgeometry\"/>\n  <key for=\"port\" id=\"d3\" yfiles.type=\"portuserdata\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"node\" id=\"d4\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"node\" id=\"d5\"/>\n  <key for=\"node\" id=\"d6\" yfiles.type=\"nodegraphics\"/>\n  <key for=\"graphml\" id=\"d7\" yfiles.type=\"resources\"/>\n  <key attr.name=\"url\" attr.type=\"string\" for=\"edge\" id=\"d8\"/>\n  <key attr.name=\"description\" attr.type=\"string\" for=\"edge\" id=\"d9\"/>\n  <key for=\"edge\" id=\"d10\" yfiles.type=\"edgegraphics\"/>\n  <graph edgedefault=\"directed\" id=\"G\">\n    <data key=\"d0\"/>\n    <node id=\"n0\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"90.037109375\" x=\"-45.0185546875\" y=\"-20.0\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"80.037109375\" x=\"5.0\" y=\"10.6494140625\">Interop Broker<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n1\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"35.3515625\" x=\"123.74557498730948\" y=\"121.42135623730954\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"25.3515625\" x=\"5.0\" y=\"10.6494140625\">App<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n2\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"35.3515625\" x=\"-159.09713748730937\" y=\"-161.42135623730965\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"25.3515625\" x=\"5.0\" y=\"10.6494140625\">App<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n3\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"35.3515625\" x=\"123.74557498730957\" y=\"-161.42135623730942\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"25.3515625\" x=\"5.0\" y=\"10.6494140625\">App<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <node id=\"n4\">\n      <data key=\"d6\">\n        <y:GenericNode configuration=\"com.yworks.flowchart.process\">\n          <y:Geometry height=\"40.0\" width=\"35.3515625\" x=\"-159.0971374873098\" y=\"121.42135623730923\"/>\n          <y:Fill color=\"#99CCFF\" transparent=\"false\"/>\n          <y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"18.701171875\" modelName=\"custom\" textColor=\"#000000\" visible=\"true\" width=\"25.3515625\" x=\"5.0\" y=\"10.6494140625\">App<y:LabelModel>\n              <y:SmartNodeLabelModel distance=\"4.0\"/>\n            </y:LabelModel>\n            <y:ModelParameter>\n              <y:SmartNodeLabelModelParameter labelRatioX=\"0.0\" labelRatioY=\"0.0\" nodeRatioX=\"0.0\" nodeRatioY=\"0.0\" offsetX=\"0.0\" offsetY=\"0.0\" upX=\"0.0\" upY=\"-1.0\"/>\n            </y:ModelParameter>\n          </y:NodeLabel>\n        </y:GenericNode>\n      </data>\n    </node>\n    <edge id=\"e0\" source=\"n0\" target=\"n1\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"70.58300020117427\" y=\"35.180656451174286\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e1\" source=\"n0\" target=\"n3\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"70.58300020117434\" y=\"-68.58300020117426\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e2\" source=\"n0\" target=\"n2\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"-142.62206270117417\" y=\"-68.58300020117433\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n    <edge id=\"e3\" source=\"n0\" target=\"n4\">\n      <data key=\"d10\">\n        <y:PolyLineEdge>\n          <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n          <y:LineStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n          <y:Arrows source=\"standard\" target=\"standard\"/>\n          <y:EdgeLabel alignment=\"center\" configuration=\"AutoFlippingLabel\" distance=\"2.0\" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" height=\"33.40234375\" modelName=\"side_slider\" preferredPlacement=\"right\" ratio=\"0.5\" textColor=\"#000000\" visible=\"true\" width=\"72.0390625\" x=\"-142.62206270117457\" y=\"35.1806564511742\">send/receive\nmessages<y:PreferredPlacementDescriptor angle=\"0.0\" angleOffsetOnRightSide=\"0\" angleReference=\"absolute\" angleRotationOnRightSide=\"co\" distance=\"-1.0\" placement=\"anywhere\" side=\"right\" sideReference=\"relative_to_edge_flow\"/>\n          </y:EdgeLabel>\n          <y:BendStyle smoothed=\"false\"/>\n        </y:PolyLineEdge>\n      </data>\n    </edge>\n  </graph>\n  <data key=\"d7\">\n    <y:Resources/>\n  </data>\n</graphml>\n"
  },
  {
    "path": "docs/src/main/asciidoc/index.adoc",
    "content": "= Plexus Interop\n:toc2:\n:toclevels: 2\n\n[[getting-started]]\n== Concepts\n\n=== Overview\ninclude::concepts-overview.adoc[]\n\n=== Components\ninclude::concepts-components.adoc[]\n\n=== Features\ninclude::concepts-features.adoc[]\n\n=== Definitions\ninclude::concepts-definitions.adoc[]\n\n== Getting Started\n\n=== Repository structure\n\ninclude::getting-started-repository-structure.adoc[]\n\n[[how-to-build]]\n=== How to build\ninclude::getting-started-how-to-build.adoc[]\n\n[[sample-apps]]\n=== Sample apps\ninclude::getting-started-how-to-run-samples.adoc[]\n\n=== Tutorial\ninclude::guides-quick-start.adoc[]\n\n[[guides]]\n== Guides\n\n=== Tools\ninclude::guides-tools.adoc[]\n\n=== Invocation workflow\n[[guides-interop-invocation-workflow]]\ninclude::guides-interop-invocation-workflow.adoc[]\n\n=== Plexus Interop integration workflow\ninclude::guides-interop-integration-workflow.adoc[]\n\n[[guides-how-to-write-custom-app-launcher]]\n=== How to write custom App Launcher\ninclude::guides-how-to-write-custom-app-launcher.adoc[]\n\n[[guides-system-requirements]]\n=== System requirements\ninclude::guides-system-requirements.adoc[]\n\n[[reference]]\n== Reference\n\n=== App Registry\ninclude::spec-app-registry.adoc[]\n\n[[reference-metadata-definition-language]]\n=== Interop Registry\ninclude::spec-interop-registry.adoc[]\n\n=== TypeScript Client API\ninclude::spec-typescript-client-api.adoc[]"
  },
  {
    "path": "docs/src/main/asciidoc/spec-app-registry.adoc",
    "content": "Application registry is a JSON array where each item has following properties:\n\n.Application properties\n|===\n| *Name* | *Type* | *Description* | *Example*\n\n|*id*\n|string\n|Unique key representing the application\n|`\"interop.samples.GreetingServer\"`\n\n|*displayName*\n|string\n|Human readable display name of the application\n|`\"App which provides greetings to other apps\"`\n\n|*launcherId*\n|string\n|A reference to another application in the registry which starts this app\n|`\"interop.NativeAppLauncher\"`\n\n|*launcherParams*\n|object\n|Application launcher specific object which contains data required by launcher to launch the specific application\n|`{\n              \"cmd\": \"../apps/GreetingServer/GreetingServer.exe\",\n              \"args\": \"\" }`\n\n|===\n\nFind below a JSON schema for the application registry\n\n[source,json]\n----\ninclude::app-registry-schema.json[]\n----"
  },
  {
    "path": "docs/src/main/asciidoc/spec-interop-registry.adoc",
    "content": "==== Messages and Services\n\nFor messages and services definition Plexus uses Google Protobuf v3 format. For example:\n\n....\npackage fx;\n\nmessage CcyPair {\n  string ccyPairName = 1;\n}\n\nmessage CcyPairRate {\n  string ccyPairName = 1;\n  double rate = 2;\n}\n\nservice CcyPairRateService {\n  rpc GetRate (CcyPair) returns (CcyPairRate);\n}\n....\n\nYou can find Protobuf specification here - https://developers.google.com/protocol-buffers/docs/proto3\n\n==== Application Interop Manifests\n\nApplication interop manifests are defined using special `.interop` format. Here is an example:\n\n[source, php]\n----\npackage vendorA.fx; // <1>\n\nimport \"fx/CcyPairRateService.proto\"; // <2>\n\napplication CcyPairRateProvider { // <3>\n    provides fx.CcyPairRateService to vendorA.* { GetRate; } // <4>\n    consumes interop.samples.GreetingService from interop.samples.GreetingServer { ShowGreeting; } <5>\n    consumes interop.samples.EchoService from interop.* { Echo; } <6>\n}\n----\n<1> Define namespace for application\n<2> Import services definition that application provides or consumes\n<3> Application name\n<4> Provided service definition. In this case app only allows using this implementation for other apps in package \"vendorA\".\n<5> Consumed service definition\n<6> One more consumed service definition.\n\n===== Consumes\n\nConsumes notation defines to which Service methods this component can execute. This Methods can be provided by several components\n and they will be accessible by discovery for component client code. We explicitly ask to specify exact methods\nto support schema evolution and corner cases where one component produce not the full set of service methods\n\nImagine the following scenario:\n\n* There is \"ServiceA\" fully implemented and produced by two components \"ComponentA\" and \"ComponentB\"\n* We add new additional method to \"ServiceA\"\n* \"ComponentA\" implements this method, where \"ComponentB\" is still in progress\n\nThus exact method import will allow plexus to check if some methods used anywhere, it will allow to check if method is produced by\nboth components and give error if not.\n\n===== Provides\n\nWe ask to provide explicit list of methods for consume and provide notations to support service evolutions and changes.\nPlexus will be able to check if what set of methods of specific Service implemented in concrete Component and validate if\nall mapping are correct and consistent."
  },
  {
    "path": "docs/src/main/asciidoc/spec-typescript-client-api.adoc",
    "content": ":imagesdir: ./images\n\n==== Send Unary Request\n\nExecutes Point-to-Point invocation, client receives response from server.\n\n[source,javascript]\n-------------------\nsendUnaryRequest<Req, Res>(\n    invocationInfo: InvocationDescriptor,\n    requestMessage: Req,\n    responseHandler: ValueHandler<Res>): Promise<InvocationClient>;\n-------------------\n\n*Parameters*\n\n[horizontal]\ninvocationInfo:: details of remote action to execute\nrequestMessage:: simple object representing request details\nresponseHandler:: response/error handler\n\n*Returns*\n\n[horizontal]\ninvocationClient:: provides ability to cancel invocation, to notificate remote side that response no longer required\n\n*Examples*\n\n- Invoke remote action on any available provider:\n\n[source,javascript]\n-------------------\nconst invocationInfo: InvocationDescriptor = {\n    serviceId: 'CcyRateService',\n    methodId: 'GetRate'\n};\nconst requestMessage = { ccyPairName: 'EURUSD' };\nclient.sendUnaryRequest<ICcyPair, ICcyPairRate>(invocationInfo, requestMessage, {\n    value: pairRate => console.log(`Received rate ${pairRate.rate}`),\n    error: e => console.error('Failed to get rate', e)\n});\n-------------------\n\n- Invoke remote action on particular provider:\n\n[source,javascript]\n-------------------\nconst invocationInfo: InvocationDescriptor = {\n    serviceId: 'CcyRateService',\n    methodId: 'GetRate',\n    // provider's app id, defined in metadata\n    applicationId: 'RateProvider',\n    // optional, if we want to pass invocation to particular running instance\n    connectionId: remoteAppGuid\n};\n// same as in example above ...\n-------------------\n\n==== Register Unary Handler\n\nRegisters handler for provided unary method.\n\n[source,javascript]\n-------------------\nonUnary<Req, Res>(\n    serviceInfo: ServiceInfo,\n    handler: UnaryInvocationHandler<Req, Res>): void;\n-------------------\n\n*Parameters*\n\n[horizontal]\nserviceInfo:: implemented service details\nhandler:: method details and provided implementation\n\n*Examples*\n\n- Register unary invocation handler\n+\n[source,javascript]\n-------------------\nconst serviceInfo = { serviceId: 'CcyRateService' };\nclientBuilder.onUnary<ICcyPair, ICcyPairRate>(serviceInfo, {\n    methodId: 'GetRate',\n    handle: async (invocationContext: MethodInvocationContext, request: ICcyPair) => {\n        const rate: ICcyPairRate = await internalRateService.getRate(request.ccyPairName);\n        return rate;\n    }\n};\n-------------------\n\n==== Discover Methods\n\nDiscovers available method invocation handlers.\n\n[source,javascript]\n-------------------\ndiscoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse>;\n-------------------\n\n*Parameters*\n\n[horizontal]\ndiscoveryRequest:: discover criteria, defined in https://github.com/finos-plexus/plexus-interop/blob/master/protocol/plexus.interop.proto[client protocol]. All fields are optional, providing flexibility to search under different criteria.\n\n*Returns*\n\n[horizontal]\ndiscoveryResponse:: discovered remote method implementations if any, containing extensive information on method provider. Discovered method instances can be passed to corresponding invocation methods.\n\n*Examples*\n\n- Discover by input message and invoke first available implementation:\n\n[source,javascript]\n-------------------\nconst discoveryResponse = await client.discoverMethod({\n    inputMessageId: 'plexus.interop.CcyPair',\n});\nclient.sendUnaryRequest<ICcyPair, ICcyPairRate>(\n    discoveryResponse.methods[0],\n    { ccyPairName: 'EURUSD' },\n    {\n        value: pairRate => console.log(`Received rate ${pairRate.rate}`),\n        error: e => console.error('Failed to get rate', e)\n    }\n);\n-------------------\n\nNOTE: *Discovery Request* supports various of options, you can use any combinations of them.\n\n- Discover by response type:\n\n[source,javascript]\n-------------------\nconst discoveryResponse = await client.discoverMethod({\n    outputMessageId: 'plexus.interop.CcyPairRate'\n});\n-------------------\n\n- Discover only online method handlers:\n\n[source,javascript]\n-------------------\nconst discoveryResponse = await client.discoverMethod({\n    outputMessageId: 'plexus.interop.CcyPairRate',\n    discoveryMode: DiscoveryMode.Online\n});\n-------------------\n\n- Discover by method reference:\n\n[source,javascript]\n-------------------\nconst discoveryResponse = await client.discoverMethod({\n    consumedMethod: {\n        consumedService: {\n            serviceId: 'CcyRateService'\n        },\n        methodId: 'GetRate'\n    }\n});\n-------------------\n\n- Implementing \"broadcast\" communication using discovery.\n\nUsing `discoveryMethod` as low level API we can easily implement sending of broadcast messages using following steps:\n\n. Define method with `Empty` return type to be handled by listener components\n+\n[source,javascript]\n-------------------\nservice CcyPairBroadcastService {\n    rpc onCcyPairRate (CcyPairRate) returns (Empty);\n}\n-------------------\n\n. Setup all listener apps as provider of this action. Also we can define specific Provider instances or even companies we would like to listen events from:\n+\n[source,javascript]\n-------------------\napplication ListenerApp {\n    // listen to message from any provider\n    provides CcyPairBroadcastService {onCcyPairRate;}\n    // or setup listener for providers from specific namespace\n    // provides CcyPairBroadcastService to com.acme.* {onCcyPairRate;}\n}\n-------------------\n\n. Setup broadcast publisher app to consume this action\n+\n[source,javascript]\n-------------------\napplication RateProviderApp {\n    consumes CcyPairBroadcastService {onCcyPairRate;}\n}\n-------------------\n\n. Use online discovery to publish new rate to all connected consumers:\n+\n[source,javascript]\n-------------------\nasync function broadcast(rate: CcyPairRate): Promise<void> {\n    const discoveryResponse = await client.discoverMethod({\n        consumedMethod: {\n            consumedService: {\n                serviceId: 'CcyPairBroadcastService'\n            },\n            methodId: 'onCcyPairRate'\n        },\n        discoveryMode: DiscoveryMode.Online\n    });\n    const responseHandler = {\n        value: () => console.log('Delivered')\n    };\n    discoveryResponse.methods.forEach(method => {\n        client.sendUnaryRequest<ICcyPairRate, Empty>(\n            method,\n            rate,\n            responseHandler);\n    });\n}\n-------------------\n\n==== Discover Services\n\nDiscovers available service implementations. Provides ability to use few methods from particular provider together.\n\n[source,javascript]\n-------------------\ndiscoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse>;\n-------------------\n\n*Parameters*\n\n[horizontal]\ndiscoveryRequest:: discover criteria, defined in https://github.com/finos-plexus/plexus-interop/blob/master/protocol/plexus.interop.proto[client protocol]. All fields are optional, providing flexibility to search under different criteria.\n\n*Returns*\n\n[horizontal]\ndiscoveryResponse:: discovered remote service implementations if any, containing extensive information on method provider. Discovered method instances can be passed to corresponding invocation methods.\n\n*Examples*\n\n- Discover service, lookup for pair of methods to be used together:\n+\n[source,javascript]\n-------------------\nconst discoveryResponse = client.discoverService({\n    consumedService: {\n        serviceId: 'CcyRateService'\n    }\n});\n// choose service implementation, by provider id/service alias/other details\nconst service: DiscoveredService = serviceDiscoveryResponse\n    .services\n    .find(s => providedService.applicationId === 'RateProviderApp');\n// choose required methods and invoke them as described above in 'Discover Methods' examples\nconst getRateMethod = service.methods.find(m => m.methodId === 'GetRate');\nconst getRateStreamMethod = service.methods.find(m => m.methodId === 'GetRateStream');\n-------------------\n\n- Discover only online service providers\n+\n[source,javascript]\n-------------------\nconst discoveryResponse = client.discoverService({\n    consumedService: {\n        serviceId: 'CcyRateService'\n    },\n    discoveryMode: DiscoveryMode.Online\n});\n-------------------\n\n==== Send Server Streaming Request\n\nExecutes Server Streaming invocation, client receives stream of messages from server.\n\n[source,javascript]\n------------------\nsendServerStreamingRequest<Req, Res>(\n    invocationInfo: InvocationDescriptor,\n    requestMessage: Req,\n    responseObserver: InvocationObserver<Res>): Promise<InvocationClient>;\n------------------\n\n*Parameters*\n\n[horizontal]\ninvocationInfo:: details of remote action to execute\nrequestMessage:: simple object representing request details\nresponseObserver:: response stream observer\n\n*Returns*\n\n[horizontal]\ninvocationClient:: provides ability to cancel invocation, to notificate remote side that response no longer required\n\n*Examples*\n\n- Receive stream or rates from provider:\n+\n[source,javascript]\n-------------------\nconst invocationInfo: InvocationDescriptor = {\n    serviceId: 'CcyRateService',\n    methodId: 'GetRateStream'\n};\nconst requestMessage = { ccyPairName: 'EURUSD' };\nclient.sendServerStreamingRequest<ICcyPair, ICcyPairRate>(invocationInfo, requestMessage, {\n    next: pairRate => console.log(`Received rate ${pairRate.rate}`),\n    complete: () => console.log('Invocation completed'),\n    error: e => console.error('Failed to get rate', e)\n});\n-------------------\n\n==== Register Server Streaming Handler\n\nRegisters handler for provided server streaming method.\n\n[source,javascript]\n-------------------\nonServerStreaming<Req, Res>(\n    serviceInfo: ServiceInfo,\n    handler: ServerStreamingInvocationHandler<Req, Res>): void;\n-------------------\n\n*Parameters*\n\n[horizontal]\nserviceInfo:: implemented service details\nhandler:: method details and provided implementation\n\n*Examples*\n\n- Register stream handler:\n+\n[source,javascript]\n-------------------\nconst serviceInfo = { serviceId: 'CcyRateService' };\nclientBuilder.onServerStreaming<ICcyPair, ICcyPairRate>(serviceInfo, {\n    methodId: 'GetRateStream',\n    handle: async (invocationContext: MethodInvocationContext,\n            request: ICcyPair,\n            hostClient: StreamingInvocationClient<ICcyPairRate>) => {\n        const rate: ICcyPairRate = await internalRateService.getRate(request.ccyPairName);\n        hostClient.next(rate);\n        // send other rate\n        const otherRate: ICcyPairRate = await internalRateService.getRate(request.ccyPairName);\n        hostClient.next(otherRate);\n        // complete streaming\n        hostClient.complete();\n    }\n};\n-------------------\n\n==== Send Bidirectional Streaming Request\n\nExecutes Bidirectional Streaming invocation. Client and Server communicates using streams of messages.\n\n[source,javascript]\n-------------------\nsendBidirectionalStreamingRequest<Req, Res>(\n    invocationInfo: InvocationDescriptor,\n    responseObserver: InvocationObserver<Res>): Promise<StreamingInvocationClient<Req>>;\n-------------------\n\n*Parameters*\n\n[horizontal]\ninvocationInfo:: details of remote action to execute\nresponseObserver:: response stream observer\n\n*Returns*\n\n[horizontal]\nstreamingInvocationClient:: invocation client, provides ability to send stream of messages, complete or cancel invocation.\n\n*Examples*\n\n- Bidirectional communication, client updates server on requested ccy pairs and receives stream of rates from server:\n+\n[source,javascript]\n-------------------\nconst invocationInfo: InvocationDescriptor = {\n    serviceId: 'CcyRateService',\n    methodId: 'GetRateBidiStream'\n};\nconst invocation = await client.sendBidirectionalStreamingRequest<ICcyPair, ICcyPairRate>(\n    invocationInfo,\n    {\n        next: pairRate => console.log(`Received rate ${pairRate.rate}`),\n        streamCompleted: () => console.log('Remote stream completed'),\n        complete: () => console.log('Invocation completed'),\n        error: e => console.error('Failed to get rate', e)\n    });\ninvocation.next({ ccyPairName: 'EURUSD' });\n// ask for other ccy pair rates later\ninvocation.next({ ccyPairName: 'EURGBP' });\n// notify server that no more pairs be requested\ninvocation.complete();\n-------------------\n\n==== Register Bidirectional Streaming Handler\n\nRegisters handler for provided bidirectional streaming method.\n\n[source,javascript]\n-------------------\nonBidiStreaming<Req, Res>(\n    serviceInfo: ServiceInfo,\n    handler: BidiStreamingInvocationHandler<Req, Res>): void;\n-------------------\n\n*Parameters*\n\n[horizontal]\nserviceInfo:: implemented service details\nhandler:: method details and provided implementation\n\n*Examples*\n\n- Register bidirectional handler:\n+\n[source,javascript]\n-------------------\nconst serviceInfo = { serviceId: 'CcyRateService' };\nclientBuilder.onBidiStreaming<ICcyPair, ICcyPairRate>(serviceInfo, {\n    methodId: 'GetRateStream',\n    handle: (invocationContext: MethodInvocationContext,\n            hostClient: StreamingInvocationClient<ICcyPairRate>) => {\n        const ccyPairs = [];\n        // send rate for each requested pair every second\n        setInterval(() => {\n            ccyPairs.forEach(pair => {\n                hostClient.next(internalRateService.getRate(pair)\n            });\n        }, 1000);\n        // client's stream observer\n        return {\n            next: ccyPair => ccyPairs.push(ccyPair)\n        };\n    }\n};\n-------------------\n\n"
  },
  {
    "path": "docs/src/main/typescript/interface.ts",
    "content": "/**\n * Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ntype Context = Object;\ntype Result = Object;\ntype IntentName = String;\ntype TopicName = String;\ntype AppIdentifier = String;\ntype AppInstanceIdentifier = String;\n\nenum InvocationErrorType {\n  AppNotFound = \"AppNotFound\",\n  ErrorOnLaunch = \"ErrorOnLaunch\",\n  AppTimeout = \"AppTimeout\",\n  AppInternalError = \"AppInternalError\",\n  ResolverUnavailable = \"ResolverUnavailable\",\n  ResolverInternalError = \"ResolverInternalError\"\n}\n\ninterface InvocationError extends Error {\n  type: InvocationErrorType;\n}\n\nenum ResolveErrorType {\n  ResolverUnavailable = \"ResolverUnavailable\",\n  ResolverTimeout = \"ResolverTimeout\",\n  ResolverInternalError = \"ResolverInternalError\"\n}\n\ninterface ResolveError extends Error {\n  type: ResolveErrorType;\n}\n\n/**\n * Specified whether the target app is already running or it can be launched by invocation.\n */\nenum AppState {\n  Launchable = \"Launchable\",\n  Running = \"Running\"\n}\n\n/**\n * Resolve parameters allows resolving intents either by intent name or by context or both.\n */\ninterface ResolveParameters {\n  context?: Context,                // Optional. Can be specified for resolving intents by context.\n  intentName?: IntentName,          // Optional. Can be specified for resolving intents by name.\n  state?: AppState                  // Optional. Can be specified for resolving either already running app instances or launchable or both. \n}\n\n/**\n * Indicates type of response\n */\nenum IntentType {\n  Simple = \"Simple\",\n  Streaming = \"Streaming\"\n}\n\n/**\n * Specifies intent resolved by Agent. \n * Can be casted to Target and invoked.\n */\ninterface Intent {\n  intentName: IntentName,\n  applicationName: AppIdentifier,   // Resolved application name.  \n  state: AppState,                  // Resolved application state.\n  instance?: AppInstanceIdentifier, // Optional. Undefined if application is not running (i.e. its state = Launchable).\n  type: IntentType,                 // Resolved intent type  \n  properties: Property[]            // Custom properties of the resolved intent, e.g. user-friendly title and icon to show on UI.\n}\n\n/**\n * Custom property.\n */\ninterface Property {\n  name: string,\n  value: object\n}\n\n/**\n * Specifies invocation target. Can be resolved from Agent or constructed directly.\n * Caller can specify the concrete instance of app which should handle the invocation.\n * Caller can specify if he want to route the invocation to already running or launchable instance.\n */\ninterface Target {\n  intentName: IntentName,\n  applicationName?: AppIdentifier,  // Optional. Can be undefined when constructed directly if target app is unknown and caller let Agent decide which app should handle the invocation.\n  instance?: AppInstanceIdentifier, // Optional. Can be undefined when constructed directly if target app instance is unknown and caller let Agent decide which instance should handle the invocation. If specified then Agent will route the context to this exact app instance.\n  state?: AppState                  // Optional. Can be undefined when constructed directly if target app state doesn't matter for caller. If state=Launchable then Agent will launch new instance of target app. If state=Running then Agent will route context to the already running instance.\n}\n\n// Intent can be casted to Target.\nvar intent: Intent;\nvar target: Target;\ntarget = intent;\n\n/**\n * Token which propogates information that operation should be cancelled.\n */\ninterface CancellationToken {\n  isCancelled(): boolean;\n  // listens for cancellation of this token \n  listen(callback: (reason: any) => void): Listener;\n}\n\n/**\n * Allows to subscribe to streaming invocation.\n */\ninterface StreamObserver {\n  next(result: Result): void;\n  error(error: InvocationError): void;\n  completed(): void;\n}\n\ninterface IntentObserver {\n  intentAdded(intent: Intent): void;\n  intentRemoved(intent: Intent): void;\n  error(error: ResolveError): void;\n}\n\n/**\n * Allows to dispose subscriptions.\n */\ninterface Listener {\n  unsubscribe();\n}\n\ninterface InvocationHandler {\n\n  intentName: IntentName,\n\n  /**\n  * Implements logic of intent handling.\n  * CancellationToken will signal when caller cancelled the request allowing intent handler to cancel long running operations.\n  */\n  handle(context: Context, cancellationToken: CancellationToken): Promise<Result>;\n}\n\ninterface StreamingInvocationHandler {\n\n  intentName: IntentName,\n\n  /**\n  * Implements logic of streaming intent handling.\n  * CancellationToken will signal when caller cancelled the request allowing intent handler to cancel long running operations.\n  */\n  handle(context: Context, cancellationToken: CancellationToken, observer: StreamObserver): void;\n}\n\n/**\n * Desktop Agent is a desktop component (or aggregate of components) that serves as a\n * launcher and message router (broker) for applications in its domain.\n * \n * Desktop Agent can be connected to one or more App Directories and will use directories for application\n * identity and discovery. Typically, a Desktop agent will contain the proprietary logic of\n * a given platform, handling functionality like explicit application interop workflows where\n * security, consistency, and implementation requirements are proprietary.\n */\ninterface DesktopAgent {\n\n  /**\n  * Connects the current App Instance to interop, all intent handlers are provided during connect.\n  * Returns InteropClient instance which can be used to interoperate with desktop agent.\n  */\n  connect(\n    applicationName: AppIdentifier,\n    invocationHandlers?: InvocationHandler[],\n    streamingInvocationHandlers?: StreamingInvocationHandler[]): Promise<InteropClient>;\n}\n\n/**\n * InteropClient is an interface for interoperating with Desktop Agent.\n * Each instance of InteropClient reprensents a connection from app to Desktop Agent.\n */\ninterface InteropClient {\n\n  /**\n   * Sends the given context to the given target. \n   * If the invocation fails, it returns error of type 'InvocationError'\n   */\n  invoke(target: Target, context: Context, cancellationToken?: CancellationToken): Promise<Result>;\n\n  /**\n   * Sends the given context to the given target and listens for stream of responses.\n   */\n  invokeStream(target: Target, context: Context, observer: StreamObserver): Listener;\n\n  /**\n   * Resolves a list of potential invocation targets by the given parameters.\n   *\n   * Resolve is effectively granting programmatic access to the Desktop Agent's resolver.\n   * Returns a promise that resolves to an Array. The resolved dataset & metadata is Desktop Agent-specific.\n   * If the resolution errors, it returns error of type `ResolveError`.\n   */\n  resolve(resolveParameters: ResolveParameters): Promise<Intent[]>;\n\n  /**\n   * Listens for invocation targets for given parameters.\n   */\n  listenIntents(resolveParameters: ResolveParameters, intentObserver: IntentObserver): Listener;\n\n  /**\n   * Broadcasts context to all the listeners of the specified topic.\n   */\n  broadcast(topic: TopicName, context: Context): void;\n\n  /**\n   * Subscribes for incoming context broadcast on the specified topic.\n   */\n  subscribe(topic: TopicName, handler: (context: Context) => void): Listener;\n\n  /**\n   * Disconnects client from Interop, no more actions received/all subscriptions closed/all further invocations rejected\n   */\n  disconnect(): Promise<void>;\n\n}"
  },
  {
    "path": "dsl/.gitignore",
    "content": "# Xtext / Xtend\ngenerated/\nsrc-gen/\nxtend-gen/\nxtext-gen/\n\n# Eclipse\n.classpath\n.project\n.settings/\n.metadata/\nbin/\n\n# IntelliJ\n*.iml\n*.ipr\n*.iws\n.idea/\nout/\n\n# Gradle\n.gradle/\nbuild/\n\n# Local configuration file (sdk path, etc)\nlocal.properties"
  },
  {
    "path": "dsl/build.gradle",
    "content": "buildscript {\n    repositories {\n        mavenCentral()\n        maven {\n           url \"https://plugins.gradle.org/m2/\"\n        }\n    }\n\n    dependencies {\n        classpath 'org.xtext:xtext-gradle-plugin:2.1.0'\n        classpath \"gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0\"   \n    }\n}\n\nsubprojects {\n    apply plugin: 'java'\n    apply plugin: 'org.xtext.xtend'\n    apply from: \"${rootDir}/gradle/source-layout.gradle\"\n    apply from: \"${rootDir}/gradle/maven-deployment.gradle\"\n    apply plugin: 'eclipse'\n    apply plugin: 'idea'\n    apply plugin: \"com.github.hierynomus.license\"\n\n    license {\n        header file(\"${rootDir}/FILE_HEADER\")\n        mapping {\n            xtend='JAVADOC_STYLE'\n            mwe2='JAVADOC_STYLE'\n            gradle='JAVADOC_STYLE'\n            xtext='JAVADOC_STYLE'\n            xcore='JAVADOC_STYLE'\n            proto='DOUBLESLASH_STYLE'\n            interop='DOUBLESLASH_STYLE'\n        }\n        exclude \"**/build/*\"\n        exclude \"**/*.g\"\n        exclude \"**/*.xtextbin\"\n        exclude \"**/*.tokens\"\n        exclude \"**/*.json\"\n        exclude \"**/xtext-gen/**\"\n        exclude \"**/xtend-gen/**\"\n        exclude \"**/*/*._trace\"\n\t    exclude \"**/google/protobuf/*.proto\"\n        // HACK: exclude not working for **/xtext-gen/**\n        exclude \"**/com/db/plexus/interop/dsl/**\"\n        strictCheck true\n    }\n\n    processResources.dependsOn licenseFormat\n\n    group = 'com.db.plexus.interop.dsl'\n    version = '1.0.0-SNAPSHOT'\n\n    sourceCompatibility = '1.8'\n    targetCompatibility = '1.8'\n\n    configurations.all {\n        exclude group: 'asm'\n    }\n}\n"
  },
  {
    "path": "dsl/gen/build.gradle",
    "content": "subprojects {\n    dependencies {\n\t    compile project(':dsl:interop-lang')\n        compile \"org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}\"\n        compile \"org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}\"\n        compile \"org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}\"    \n\n\ttestCompile project(':dsl:interop-lang')\n\ttestCompile project(':dsl:gen:test')\n    testCompile group: 'junit', name: 'junit', version: '4.12'\n    testCompile \"org.eclipse.xtext:org.eclipse.xtext.junit4:${xtextJunitVersion}\"\n    testCompile \"org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}\"\n        testCompile 'org.hamcrest:hamcrest-library:1.2.1'\n    testCompile \"org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}\"\n    }\n}\n\n"
  },
  {
    "path": "dsl/gen/cli/build.gradle",
    "content": "import org.apache.tools.ant.taskdefs.condition.Os\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    testCompile project(':dsl:gen:common')\n    testCompile project(':dsl:gen:meta')\n    testCompile project(':dsl:gen:proto')\n    testCompile project(':dsl:gen:csharp')\n    testCompile project(':dsl:interop-lang')\n    testCompile group: 'junit', name: 'junit', version: '4.12'\n\n    compile project(':dsl:gen:common')\n    compile project(':dsl:gen:meta')\n    compile project(':dsl:gen:ts')\n    compile project(':dsl:gen:js')\n    compile project(':dsl:gen:proto')\n    compile project(':dsl:gen:csharp')\n    compile project(':dsl:interop-lang')\n    compile group: 'com.beust', name: 'jcommander', version: '1.71'\n}\n\nbuildscript {\n    repositories {\n        mavenCentral()\n        maven {\n           url \"https://plugins.gradle.org/m2/\"\n        }\n    }\n    dependencies {\n        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'\n    }\n}\n\napply plugin: 'application'\napply plugin: 'com.github.johnrengelman.shadow'\n\nmainClassName = 'com.db.plexus.interop.dsl.gen.cli.Main'\n\ntask copyJarToRootBin(type: Copy) {\n  def outputDir = '../../../bin/win-x86/sdk'\n  if (Os.isFamily(Os.FAMILY_MAC)) {\n      outputDir='../../../bin/osx-x64/sdk'\n  }\n  outputs.dir outputDir\n  inputs.dir 'build/libs'\n  from 'build/libs'\n  into outputDir\n  include \"*-all.jar\"\n  rename { String fileName ->\n    \"plexusgen.jar\"\n  }\n}\n\nbuild.dependsOn(copyJarToRootBin)\n\ndefaultTasks 'build'\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/cli/src/main/java/com/db/plexus/interop/dsl/gen/cli/CLISetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.cli\n\nimport com.google.inject.Injector\nimport org.eclipse.emf.common.util.URI;\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup\n\nclass CLISetup {\n\n    public val Injector injector;\n    public val URI baseDir;\n    public val URI workDir;\n    public val InteropLangStandaloneSetup interopLangSetup;\n\n    new (Injector injector, URI baseDir, URI workDir, InteropLangStandaloneSetup interopLangSetup) {\n        this.injector = injector\n        this.baseDir = baseDir\n        this.workDir = workDir\n        this.interopLangSetup = interopLangSetup\n    }\n}"
  },
  {
    "path": "dsl/gen/cli/src/main/java/com/db/plexus/interop/dsl/gen/cli/CLIStandaloneSetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.cli\n\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup\nimport com.google.inject.Guice\nimport com.db.plexus.interop.dsl.InteropLangRuntimeModule\nimport com.db.plexus.interop.dsl.validation.rules.RulesModule\n\nclass CLIStandaloneSetup extends InteropLangStandaloneSetup {\n\n    override def createInjector() {\n        Guice.createInjector(new InteropLangRuntimeModule(), new RulesModule());\n    }\n\n}"
  },
  {
    "path": "dsl/gen/cli/src/main/java/com/db/plexus/interop/dsl/gen/cli/Main.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.cli;\n\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup;\nimport com.db.plexus.interop.dsl.gen.ApplicationCodeGenerator;\nimport com.db.plexus.interop.dsl.gen.CodeOutputGenerator;\nimport com.db.plexus.interop.dsl.gen.GenTask;\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig;\nimport com.db.plexus.interop.dsl.gen.js.JsGenTask;\nimport com.db.plexus.interop.dsl.gen.csharp.CsharpGenTask;\nimport com.db.plexus.interop.dsl.gen.meta.ListMetadataFilesTask;\nimport com.db.plexus.interop.dsl.gen.meta.MetaJsonGenTask;\nimport com.db.plexus.interop.dsl.gen.meta.MetaValidatorTask;\nimport com.db.plexus.interop.dsl.gen.meta.MetaPatchValidatorTask;\nimport com.db.plexus.interop.dsl.gen.ts.TsGenTask;\nimport com.db.plexus.interop.dsl.gen.proto.ProtoGenTask;\nimport com.db.plexus.interop.dsl.gen.util.FileUtils;\nimport com.google.inject.Injector;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URISyntaxException;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.logging.Logger;\n\nimport org.eclipse.emf.common.util.URI;\n\npublic class Main {\n\n    private static Logger log = Logger.getLogger(\"Generator\");\n\n    public static void main(String[] args) throws IOException, URISyntaxException {\n        setupLogger();\n        final PlexusGenConfig genConfig = new ParametersParser().parse(args);\n        if (genConfig.isVerbose()) {\n            log.info(\"Running generator with parameters: \" + genConfig.toString());\n        }\n        final CLISetup cliSetup = createSetup(genConfig);\n        final String type = genConfig.getType();\n        final Injector injector = cliSetup.injector;\n        switch (type) {\n            case MetaPatchValidatorTask.NAME:\n                GenTask patchValidation = injector.getInstance(MetaPatchValidatorTask.class);\n                patchValidation.doGen(genConfig);\n                break;\n            case ApplicationCodeGenerator.TS:\n                GenTask tsGenTask = injector.getInstance(TsGenTask.class);\n                tsGenTask.doGen(genConfig);\n                break;\n            case ApplicationCodeGenerator.JS:\n                GenTask jsGenTask = injector.getInstance(JsGenTask.class);\n                jsGenTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.JSON_META:\n                genConfig.setIncludeProtoDescriptors(true);\n                enhanceMetadata(genConfig, cliSetup.workDir, cliSetup.baseDir, cliSetup.interopLangSetup, injector);\n                GenTask metaJsonGenTask = cliSetup.injector.getInstance(MetaJsonGenTask.class);\n                metaJsonGenTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.PROTO:\n                GenTask protoGenTask = injector.getInstance(ProtoGenTask.class);\n                protoGenTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.CSHARP:\n                enhanceMetadata(genConfig, cliSetup.workDir, cliSetup.baseDir, cliSetup.interopLangSetup, injector);\n                GenTask cSharpGenTask = injector.getInstance(CsharpGenTask.class);\n                cSharpGenTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.PROTO_CSHARP:\n                GenTask protoCSharpGenTask = injector.getInstance(ProtoGenTask.class);\n                protoCSharpGenTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.VALIDATE:\n                GenTask validatorTask = injector.getInstance(MetaValidatorTask.class);\n                validatorTask.doGen(genConfig);\n                break;\n            case CodeOutputGenerator.LIST_METADATA:\n                GenTask listFiles = injector.getInstance(ListMetadataFilesTask.class);\n                listFiles.doGen(genConfig);\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unknown type \" + type);\n        }\n    }\n\n    private static void setupLogger() {\n        System.setProperty(\"java.util.logging.SimpleFormatter.format\",\n                \"[%1$tF %1$tT] [%4$-7s] %5$s %n\");\n    }\n\n    private static void enhanceMetadata(PlexusGenConfig genConfig, URI workDir, URI baseDir, InteropLangStandaloneSetup setup, Injector injector) throws IOException, URISyntaxException {\n        GenTask preProcessTask = injector.getInstance(ProtoGenTask.class);\n        File temp = FileUtils.createTempDir();\n        String outDir = genConfig.getOutDir();\n        genConfig.setOutDir(temp.getPath());\n        preProcessTask.doGen(genConfig);\n        genConfig.setBaseDir(temp.getPath());\n        genConfig.setOutDir(outDir);\n        setup.removeBaseURI(baseDir);\n        baseDir = URI.createFileURI(genConfig.getBaseDir()).resolve(workDir).appendSegment(\"\");\n        setup.addBaseURI(baseDir);\n    }\n\n    private static CLISetup createSetup(PlexusGenConfig config) {\n        Path workDirPath = Paths.get(\"\").toAbsolutePath();\n        URI workDir = URI.createFileURI(workDirPath.toString()).appendSegment(\"\");\n        URI baseDir = config.getBaseDir() != null ? URI.createFileURI(config.getBaseDir()).resolve(workDir).appendSegment(\"\") : null;\n        final InteropLangStandaloneSetup setup = new CLIStandaloneSetup();\n        final Injector injector = setup.createInjectorAndDoEMFRegistration();\n        if (baseDir != null) {\n            setup.addBaseURI(baseDir);\n        }\n        return new CLISetup(injector, baseDir, workDir, setup);\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/cli/src/main/java/com/db/plexus/interop/dsl/gen/cli/ParametersParser.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.cli;\n\nimport com.beust.jcommander.JCommander;\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig;\n\npublic class ParametersParser {\n\n    public PlexusGenConfig parse(String[] args) {\n        final PlexusGenConfig parameters = new PlexusGenConfig();\n        JCommander.newBuilder()\n                .addObject(parameters)\n                .build()\n                .parse(args);\n        return parameters;\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/cli/src/main/resources/plugin.properties",
    "content": "#\n# Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n_UI_DiagnosticRoot_diagnostic = Diagnosis of {0}\n\n_UI_RequiredFeatureMustBeSet_diagnostic = The required feature ''{0}'' of ''{1}'' must be set\n_UI_FeatureHasTooFewValues_diagnostic = The feature ''{0}'' of ''{1}'' with {2} values must have at least {3} values\n_UI_FeatureHasTooManyValues_diagnostic = The feature ''{0}'' of ''{1}'' with {2} values may have at most {3} values\n_UI_DocumentRootMustHaveOneElement_diagnostic = The feature ''{0}'' of ''{1}'' with {2} element values must have exactly 1 element value\n\n_UI_UnresolvedProxy_diagnostic = The feature ''{0}'' of ''{1}'' contains an unresolved proxy ''{2}''\n_UI_DanglingReference_diagnostic = The feature ''{0}'' of ''{1}'' contains a dangling reference ''{2}''\n\n_UI_UnpairedBidirectionalReference_diagnostic = The opposite features ''{0}'' of ''{1}'' and ''{2}'' of ''{3}'' do not refer to each other\n\n_UI_BadDataValue_diagnostic = The feature ''{0}'' of ''{1}'' contains a bad value\n\n_UI_MinInclusiveConstraint_diagnostic = The value ''{0}'' must be greater than or equal to ''{2}'' \n_UI_MinExclusiveConstraint_diagnostic = The value ''{0}'' must be greater than ''{2}'' \n_UI_MaxInclusiveConstraint_diagnostic = The value ''{0}'' must be less than or equal to ''{2}'' \n_UI_MaxExclusiveConstraint_diagnostic = The value ''{0}'' must be less than ''{2}'' \n\n_UI_MinLengthConstraint_diagnostic = The value ''{0}'' with length {1} must have at least length {2} \n_UI_MaxLengthConstraint_diagnostic = The value ''{0}'' with length {1} may have at most length {2} \n\n_UI_EnumerationConstraint_diagnostic = The value ''{0}'' must be one of '{'{1}'}'\n_UI_PatternConstraint_diagnostic = The value ''{0}'' must match one of '{'{1}'}'\n\n_UI_TotalDigitsConstraint_diagnostic = The value ''{0}'' may have at most {1} digits\n_UI_FractionDigitsConstraint_diagnostic = The value ''{0}'' may have at most {1} fraction digits\n\n_UI_ListHead_composition = ''{0}''\n_UI_ListTail_composition = {0}, ''{1}''\n\n_UI_BadDataValueType_diagnostic = The value ''{0}'' of type ''{1}'' must be of type ''{2}''\n\n_UI_DuplicateID_diagnostic = The ID ''{0}'' of ''{1}'' collides with that of ''{2}''\n\n_UI_DuplicateKey_diagnostic = The feature ''{0}'' has key {1} for ''{2}'' which collides with that of ''{3}''\n\n_UI_DuplicateMapEntry_diagnostic = The feature ''{0}'' has a map entry at index {1} with a key that collides with that of the map entry at index {2}\n\n_UI_CircularContainment_diagnostic = An object may not circularly contain itself\n\n_UI_BadXMLGregorianCalendar_diagnostic = The value ''{0}'' is not a well formed instance of the {1} XML Schema data type"
  },
  {
    "path": "dsl/gen/cli/src/test/java/com/db/plexus/interop/dsl/gen/cli/ParametersParserTest.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.cli;\n\nimport com.beust.jcommander.ParameterException;\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig;\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic class ParametersParserTest {\n\n    private ParametersParser sut = new ParametersParser();\n\n    @Test\n    public void testParseParameters() {\n        final PlexusGenConfig parameters = sut.parse(new String[]{\"--type=ts\", \"-i\", \"*\", \"--baseDir\", \".\"});\n        Assert.assertEquals(\"ts\", parameters.getType());\n        Assert.assertEquals(\"*\", parameters.getInput());\n        Assert.assertEquals(\".\", parameters.getBaseDir());\n    }\n\n    @Test(expected = ParameterException.class)\n    public void testRequiredParameters() {\n        sut.parse(new String[]{\"-i\", \"*\", \"--baseDir\", \".\"});\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/common/build.gradle",
    "content": "dependencies {\n    compile group: 'com.beust', name: 'jcommander', version: '1.72'\n    compile group: 'com.google.inject.extensions', name: 'guice-multibindings', version: '3.0'\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/ApplicationCodeGenerator.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport com.db.plexus.interop.dsl.Application;\nimport com.db.plexus.interop.dsl.InteropLangUtils;\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils;\n\nimport org.eclipse.emf.ecore.resource.Resource;\nimport org.eclipse.emf.ecore.resource.ResourceSet;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic abstract class ApplicationCodeGenerator {\n\n    public static final String TS = \"ts\";\n\n    public static final String JS = \"js\";\n    \n    public final String generate(PlexusGenConfig genConfig, Application application, ResourceSet resourceSet) {    \t\n    \treturn generate(\n    \t\tgenConfig,\n    \t\tapplication,\n    \t\tresourceSet\n    \t\t\t.getResources()\n    \t\t\t.stream()\n    \t\t\t.filter(x -> \n    \t\t\t\t!x.getURI().toString().endsWith(ProtoLangUtils.DESCRIPTOR_RESOURCE_PATH) && \n    \t\t\t\t!x.getURI().toString().endsWith(InteropLangUtils.DESCRIPTOR_RESOURCE_PATH))\n    \t\t\t.collect(Collectors.toList()));\n    }\n\n    protected abstract String generate(PlexusGenConfig genConfig, Application application, List<Resource> resources);    \n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/BaseGenTask.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URISyntaxException;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.List;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\n\nimport com.db.plexus.interop.dsl.InteropLangUtils;\nimport com.db.plexus.interop.dsl.gen.errors.CodeGenerationException;\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils;\nimport org.eclipse.emf.common.util.EList;\nimport org.eclipse.emf.common.util.URI;\nimport org.eclipse.emf.ecore.resource.Resource;\nimport org.eclipse.xtext.EcoreUtil2;\nimport org.eclipse.xtext.resource.XtextResourceSet;\n\nimport com.db.plexus.interop.dsl.gen.util.FileUtils;\nimport com.google.inject.Inject;\n\npublic abstract class BaseGenTask implements GenTask {\n\n    @Inject\n    protected ResourceSetValidator validator;\n\n    protected Logger logger = Logger.getLogger(\"PlexusCodeGenerator\");\n\n    private URI workingDirUri;\n    private URI baseDirUri;\n    private URI outDirUri;\n    private URI resourceBaseUri;\n\n    public void doGen(PlexusGenConfig config) throws IOException, URISyntaxException {\n    \tthis.workingDirUri = getWorkingDir();\n        this.baseDirUri = getRelativeURI(config.getBaseDir(), this.workingDirUri);\n        this.outDirUri = getRelativeURI(config.getOutDir(), this.workingDirUri);\n        this.resourceBaseUri = detectResourceBaseUri();\n        final XtextResourceSet resourceSet = new XtextResourceSet();\n        loadResources(resourceSet, getBaseDirUri(), config.isVerbose(), inputFilesGlob(config));\n        if (config.isVerbose()) {\n            printResources(resourceSet);\n        }\n        validateResources(config, resourceSet);\n        doGenWithResources(config, resourceSet);\n    }\n\n    protected String inputFilesGlob(PlexusGenConfig config) {\n        return config.getInput();\n    }\n\n    protected URI getWorkingDir() {\n        return URI.createFileURI(Paths.get(\"\").toAbsolutePath().toString()).appendSegment(\"\");\n    }\n\n    public void printResources(XtextResourceSet resourceSet) {\n        resourceSet.getResources().forEach(r ->  this.logger.info(\"Loaded resource: \" + r.getURI()));\n    }\n\n    public void validateResources(PlexusGenConfig config, XtextResourceSet resourceSet) {\n        this.validator.validateResources(resourceSet);\n    }\n\n    public void validateInteropResourceLoaded(PlexusGenConfig config, XtextResourceSet resourceSet) {\n        boolean containsInterop = resourceSet.getResources().stream().anyMatch(r -> r.getURI().toString().endsWith(\".interop\"));\n        if (!containsInterop) {\n            String errorMessage = String.format(\"No *.interop files match provided [%s] criteria, please check your input arguments.\", config.getInput());\n            this.logger.severe(errorMessage);\n            throw new CodeGenerationException(errorMessage);\n        }\n    }\n\n    protected void doGenWithResources(PlexusGenConfig config, XtextResourceSet resourceSet) throws IOException {}\n\n    protected URI getWorkingDirUri() {\n        return workingDirUri;\n    }\n\n    protected URI getBaseDirUri() {\n        return baseDirUri;\n    }\n\n    protected URI getOutDirUri() {\n        return outDirUri;\n    }\n\n    protected URI getResourceBaseUri() {\n        return resourceBaseUri;\n    }\n\n    protected String getAbsolutePath(String relativePath) {\n        return Paths.get(\".\").resolve(relativePath).toAbsolutePath().toString();\n    }\n\n    protected List<String> getProtoFilePaths(EList<Resource> resources, PlexusGenConfig config) {\n        final String excludePattern = config.getExcludePattern();\n        final boolean excludePatternIsEmpty = excludePattern == null || excludePattern.trim().isEmpty();\n        return resources.stream()\n                .filter(x -> x.getURI().lastSegment().endsWith(\".proto\"))\n                .filter(x -> config.isIncludeProtoDescriptors() || !x.getURI().toString().endsWith(ProtoLangUtils.DESCRIPTOR_RESOURCE_PATH))\n                .filter(x -> excludePatternIsEmpty || !x.getURI().toString().matches(excludePattern))\n                .filter(x -> config.isIncludeProtoDescriptors() || !x.getURI().toString().endsWith(InteropLangUtils.DESCRIPTOR_RESOURCE_PATH))\n                .filter(x -> x.getURI().toFileString() != null)\n                .map(resource -> new File(resource.getURI().resolve(workingDirUri).toFileString()).getAbsolutePath())\n                .collect(Collectors.toList());\n    }\n\n    protected void loadResources(XtextResourceSet resourceSet, URI baseDirUri, boolean isVerbose, String inputGlob) throws IOException {\n        FileUtils.processFiles(\n                new File(baseDirUri.toFileString()).getPath(),\n                inputGlob,\n                path -> {\n                    if (isVerbose) {\n                        this.logger.info(\"Loading file: \" + path.toAbsolutePath());\n                    }\n                    loadResource(path, resourceSet);\n                });\n        EcoreUtil2.resolveAll(resourceSet);\n    }\n\n    private void loadResource(Path path, XtextResourceSet resourceSet) {\n    \tURI uri = URI.createFileURI(path.toString());\n    \tresourceSet.getResource(uri, true);\n    }\n\n    protected URI getRelativeURI(String path, URI workingDirURI) {\n        URI uri = URI.createFileURI(path).resolve(workingDirURI);\n        if (!uri.lastSegment().equals(\"\")) {\n            uri = uri.appendSegment(\"\");\n        }\n        return uri;\n    }\n\n    protected URI detectResourceBaseUri() throws URISyntaxException {\n    \tURI commonUri;\n    \tcommonUri = URI.createURI(\n    \t\t\tClassLoader.getSystemClassLoader().getResource(\"interop/options.proto\").toURI().toString());\n    \tURI resourceBaseUri = commonUri.trimSegments(2).appendSegment(\"\");\n    \treturn resourceBaseUri;\n    }\n\n    protected void writeToFile(String outPath, String content) throws IOException {\n        this.logger.info(\"Saving to: \" + outPath);\n        FileUtils.writeStringToFile(new File(outPath), content);\n    }\n\n    protected int generateMessages(List<String> args) throws IOException {\n        this.logger.info(String.format(\"Running compiler with args [%s]\", String.join(\" \", args)));\n        try {\n            final int resultCode = new ProcessBuilder(args)\n                    .inheritIO()\n                    .start()\n                    .waitFor();\n            if (resultCode != 0) {\n                this.logger.log(Level.WARNING, \"Compiler has returned non-zero result code \" + resultCode);\n            }\n            return resultCode;\n        } catch (Exception e) {\n            this.logger.log(Level.WARNING, \"Could not generate messages definitions\");\n            e.printStackTrace();\n            return 1;\n        }\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/BasePlexusIDLGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen\n\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.generator.IFileSystemAccess2\nimport org.eclipse.xtext.generator.IGeneratorContext\nimport com.db.plexus.interop.dsl.generator.InteropLangGenerator\n\nclass BasePlexusIDLGenerator extends InteropLangGenerator {\n\n    override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {\n        super.doGenerate(resource, fsa, context);\n    }\n\n}"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/CodeOutputGenerator.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport org.eclipse.emf.ecore.resource.Resource;\nimport org.eclipse.emf.ecore.resource.ResourceSet;\n\nimport com.db.plexus.interop.dsl.InteropLangUtils;\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic abstract class CodeOutputGenerator {\n\n\tpublic static final String JSON_META = \"json_meta\";\n\n\tpublic static final String VALIDATE = \"validate\";\n    \n    public static final String PROTO = \"proto\";\n    \n    public static final String PROTO_CSHARP = \"proto_csharp\";\n    \n    public static final String CSHARP = \"csharp\";\n\n    public static final String LIST_METADATA = \"list-meta\";\n    \n    public final String generate(PlexusGenConfig genConfig, ResourceSet resourceSet) {    \t\n    \treturn generate(\n    \t\tgenConfig,\n    \t\tresourceSet\n    \t\t\t.getResources()\n    \t\t\t.stream()\n    \t\t\t.filter(x -> \n    \t\t\t\t!x.getURI().toString().endsWith(ProtoLangUtils.DESCRIPTOR_RESOURCE_PATH) && \n    \t\t\t\t!x.getURI().toString().endsWith(InteropLangUtils.DESCRIPTOR_RESOURCE_PATH))\n    \t\t\t.collect(Collectors.toList()));\n    }\n\n    abstract protected String generate(PlexusGenConfig genConfig, List<Resource> resources);\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/Entry.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\npublic class Entry<T> {\n\n    private T value;\n    private EntryPoint entryPoint;\n\n    public Entry(T value, EntryPoint entryPoint) {\n        this.value = value;\n        this.entryPoint = entryPoint;\n    }\n\n    public T getValue() {\n        return value;\n    }\n\n    public EntryPoint getEntryPoint() {\n        return entryPoint;\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/EntryPoint.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport org.eclipse.emf.ecore.EObject;\nimport org.eclipse.emf.ecore.resource.Resource;\n\nimport java.util.List;\n\npublic class EntryPoint {\n\n    private String entryName;\n\n    private String namespace;\n\n    private List<EObject> content;\n\n    private Resource resource;\n\n    public EntryPoint(String name, String namespace, List<EObject> rootModels, Resource resource) {\n        this.entryName = name;\n        this.content = rootModels;\n        this.namespace = namespace;\n        this.resource = resource;\n    }\n\n    public String getEntryName() {\n        return entryName;\n    }\n\n    public List<EObject> getContent() {\n        return content;\n    }\n\n    public String getNamespace() {\n        return namespace;\n    }\n\n    public void setEntryName(String entryName) {\n        this.entryName = entryName;\n    }\n\n    public void setNamespace(String namespace) {\n        this.namespace = namespace;\n    }\n\n    public void setContent(List<EObject> content) {\n        this.content = content;\n    }\n\n    public Resource getResource() {\n        return resource;\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/GenTask.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport java.io.IOException;\nimport java.net.URISyntaxException;\n\npublic interface GenTask {\n\n    void doGen(PlexusGenConfig plexusGenConfig) throws IOException, URISyntaxException;\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/GenUtils.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen\n\nimport java.util.List\nimport com.db.plexus.interop.dsl.protobuf.Service\nimport org.eclipse.emf.ecore.resource.Resource\nimport java.util.Arrays\nimport java.util.stream.Collectors\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport com.db.plexus.interop.dsl.Application\nimport com.db.plexus.interop.dsl.ConsumedService\nimport com.db.plexus.interop.dsl.ProvidedService\nimport com.db.plexus.interop.dsl.ConsumedMethod\nimport com.db.plexus.interop.dsl.ProvidedMethod\nimport java.util.LinkedList\nimport com.db.plexus.interop.dsl.protobuf.Option\nimport org.eclipse.emf.ecore.EObject\nimport com.db.plexus.interop.dsl.protobuf.Message\nimport com.db.plexus.interop.dsl.protobuf.Enum\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.PrimitiveFieldType\nimport com.db.plexus.interop.dsl.protobuf.ComplexFieldType\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport com.google.inject.Inject\nimport org.eclipse.xtext.naming.QualifiedName\nimport com.db.plexus.interop.dsl.protobuf.Constant\nimport com.db.plexus.interop.dsl.protobuf.StringConstant\nimport com.db.plexus.interop.dsl.protobuf.IntConstant\nimport com.db.plexus.interop.dsl.protobuf.EnumConstant\nimport com.db.plexus.interop.dsl.protobuf.BoolConstant\nimport com.db.plexus.interop.dsl.protobuf.DecimalConstant\nimport com.db.plexus.interop.dsl.InteropLangUtils\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils\nimport java.util.Map\n\npublic class GenUtils {\n\n    public static final String INTEROP_OPTIONS_RESOURCE_PATH = \"interop/options.proto\"\n    public static final String INTEROP_DESCRIPTOR_RESOURCE_PATH = InteropLangUtils.DESCRIPTOR_RESOURCE_PATH\n    public static final String PROTOBUF_DESCRIPTOR_RESOURCE_PATH = ProtoLangUtils.DESCRIPTOR_RESOURCE_PATH\n\n    public static final QualifiedName ROOT_PACKAGE_NAME = QualifiedName.create(\"\")\n    public static final QualifiedName INTEROP_PACKAGE_NAME = ROOT_PACKAGE_NAME.append(\"interop\")\n    public static final QualifiedName INTEROP_SERVICE_ID_OPTION_NAME = INTEROP_PACKAGE_NAME.append(\"service_id\")\n    public static final QualifiedName INTEROP_MESSAGE_ID_OPTION_NAME = INTEROP_PACKAGE_NAME.append(\"message_id\")\n\n    public static final QualifiedName INTEROP_PROVIDED_SERVICE_TITLE_OPTION_NAME = INTEROP_PACKAGE_NAME.append(QualifiedName.create(\"ProvidedServiceOptions\", \"title\"))\n    public static final QualifiedName INTEROP_PROVIDED_METHOD_TITLE_OPTION_NAME = INTEROP_PACKAGE_NAME.append(QualifiedName.create(\"ProvidedMethodOptions\", \"title\"))\n\n    @Inject\n    IQualifiedNameProvider qualifiedNameProvider\n\n    def static getOptionList(EObject obj) {\n        return obj.eContents.filter(typeof(Option)).toList()\n    }\n\n    def static getValueAsString(Option option) {\n        val constant = option.value\n        return switch (constant) {\n            IntConstant: return constant.value.toString\n            EnumConstant: return constant.value.name\n            StringConstant: return constant.value\n            BoolConstant: return constant.value.toString\n            DecimalConstant: return constant.value.toString\n        }\n    }\n\n    def static List<Service> getServices(Resource... resources) {\n        return Arrays.stream(resources)\n        .flatMap([resource | getServices(resource).stream()])\n        .collect(Collectors.toList());\n    }\n\n    def getServicesMap(Resource... resources) {\n        return getServices(resources)\n        .stream()\n        .collect(Collectors.toMap(\n                        [getFullName],\n                        [it],\n                        [value, duplicate | value]\n                ));\n    }\n\n    def getServiceMethodsMap(Resource... resources) {\n        return getServices(resources)\n        .stream()\n        .flatMap[s | s.getMethods().stream().map[m | {\n                    val methodId = s.getFullName() + \".\" + m.name;\n                    return methodId -> m;\n                }]]\n        .collect(Collectors.toMap([key], [value], [value, duplicate | value]));\n    }\n\n    def static List<Message> getMessages(Resource... resources) {\n        return Arrays.stream(resources)\n        .flatMap([resource | getMessages(resource).stream()])\n        .collect(Collectors.toList());\n    }\n\n    def Map<String, Message> getMessagesMap(Resource... resources) {\n        return getMessages(resources)\n        .stream()\n        .collect(Collectors.toMap([getFullName], [it], [f, s | f]));\n    }\n\n    def Map<String, Field> getFieldsMap(Resource... resources) {\n        return getMessages(resources)\n        .stream()\n        .flatMap([m | getFields(m).stream().map[f | f -> m]])\n        .collect(Collectors.toMap(\n                        [pair | pair.value.getFullName + \".\" + pair.key.name],\n                        [key],\n                        [value, duplicate | value]));\n    }\n\n    def String getType(Field field) {\n        val typeRef = field.getTypeReference();\n        switch typeRef {\n            PrimitiveFieldType: typeRef.getValue().literal.toLowerCase()\n            ComplexFieldType: getType(typeRef)\n            default: \"Unsupported\"\n        }\n    }\n\n    def static String getAliasOrName(ProvidedService providedService) {\n        return if(providedService.alias !== null) providedService.alias else providedService.service.name\n    }\n\n    def static String getAliasOrName(ConsumedService service) {\n        return if(service.alias !== null) service.alias else service.service.name\n    }\n\n    def static boolean isPrimitive(Field field) {\n        val typeRef = field.getTypeReference();\n        switch typeRef {\n            PrimitiveFieldType: true\n            default: false\n        }\n    }\n\n    def getQualifiedName(EObject obj) {\n        return qualifiedNameProvider.getFullyQualifiedName(obj)\n    }\n\n    def getFullName(EObject obj) {\n        return getQualifiedName(obj).skipFirst(1).toString()\n    }\n\n    def String getType(ComplexFieldType complexFieldType) {\n        val complexType = complexFieldType.getValue()\n        switch complexType {\n            Message: getFullName(complexType)\n            Enum: getFullName(complexType)\n            default: \"Unsupported\"\n        }\n    }\n\n    def static List<Field> getFields(Message message) {\n        return message\n        .elements\n        .stream()\n        .filter([el | el instanceof Field])\n        .map([el | el as Field])\n        .collect(Collectors.toList());\n    }\n\n    def static List<Message> getMessages(Resource resource) {\n        return resource.allContents\n        .filter(typeof(Message))\n        .toList();\n    }\n\n    def static List<Service> getServices(Resource resource) {\n        return resource.allContents\n        .filter(typeof(Service))\n        .toList();\n    }\n\n    def static List<Method> getMethods(Service service) {\n        return service.elements.filter(typeof(Method)).toList()\n    }\n\n    def static Service getService(Method method) {\n        var obj = method as EObject\n        while(obj !== null) {\n            val parent = obj.eContainer\n            val service = tryGetService(parent)\n            if(service !== null) {\n                return service\n            }\n            obj = obj.eContainer;\n        }\n        return null;\n    }\n\n    def private static Service tryGetService(EObject object) {\n        switch object {\n            ConsumedService: object.service\n            ProvidedService: object.service\n            Service: object\n            default: null\n        }\n    }\n\n    def static List<Application> getApplications(Resource... resources) {\n        return Arrays.stream(resources)\n        .flatMap([resource | getApplications(resource).stream()])\n        .collect(Collectors.toList());\n    }\n\n    def getApplicationsMap(Resource... resources) {\n        return getApplications(resources)\n        .stream()\n        .collect(Collectors.toMap(\n                        [getFullName],\n                        [it],\n                        [value, duplicate | value]\n                ));\n    }\n\n    def static List<Application> getApplications(Resource resource) {\n        return resource.allContents\n        .filter(typeof(Application))\n        .toList();\n    }\n\n    def static isPointToPoint(Method rpc) {\n        return !rpc.getRequest().getIsStream() && !rpc.getResponse().getIsStream();\n    }\n\n    def static isBidiStreaming(Method rpc) {\n        return rpc.getRequest().getIsStream() && rpc.getResponse().getIsStream();\n    }\n\n    def static isClientStreaming(Method rpc) {\n        return rpc.getRequest().getIsStream() && !rpc.getResponse().getIsStream();\n    }\n\n    def static isServerStreaming(Method rpc) {\n        return !rpc.getRequest().getIsStream() && rpc.getResponse().getIsStream();\n    }\n\n    def static List<ConsumedService> getConsumedServices(Application application) {\n        return application.elements.filter(typeof(ConsumedService)).toList()\n    }\n\n    def static List<ProvidedService> getProvidedServices(Application application) {\n        return application.elements.filter(typeof(ProvidedService)).toList()\n    }\n\n    def static List<ConsumedMethod> getMethods(ConsumedService service) {\n        return service.elements.filter(typeof(ConsumedMethod)).toList()\n    }\n\n    def static List<ProvidedMethod> getMethods(ProvidedService service) {\n        return service.elements.filter(typeof(ProvidedMethod)).toList()\n    }\n\n    def static List<String> getWildcards(ConsumedService service) {\n        if(service.restrictions === null) {\n            return new LinkedList<String>()\n        }\n        return service.restrictions.elements.map[x | x.wildcard]\n    }\n\n    def static List<String> getWildcards(ProvidedService service) {\n        if(service.restrictions === null) {\n            return new LinkedList<String>()\n        }\n        return service.restrictions.elements.map[x | x.wildcard]\n    }\n\n    def String getTitle(ProvidedService providedService) {\n        val titleOption = providedService.elements\n        .filter(typeof(Option))\n        .findFirst[o | getQualifiedName(o.descriptor).equals(INTEROP_PROVIDED_SERVICE_TITLE_OPTION_NAME)];\n        if(titleOption === null) {\n            return providedService.service.name\n        }\n        return titleOption.value.asString\n    }\n\n    def String getTitle(ProvidedMethod providedMethod) {\n        if(providedMethod.options === null) {\n            return providedMethod.method.name\n        }\n        val titleOption = providedMethod.options\n        .findFirst[o | getQualifiedName(o.descriptor).equals(INTEROP_PROVIDED_METHOD_TITLE_OPTION_NAME)];\n        if(titleOption === null) {\n            return providedMethod.method.name\n        }\n        return titleOption.value.asString\n    }\n\n    def static String getType(Method method) {\n        if(isBidiStreaming(method)) {\n            return \"DuplexStreaming\"\n        }\n        if(isServerStreaming(method)) {\n            return \"ServerStreaming\"\n        }\n        if(isClientStreaming(method)) {\n            return \"ClientStreaming\"\n        }\n        return \"Unary\"\n    }\n\n    def static String getAsString(Constant constant) {\n        if(constant instanceof StringConstant) {\n            return constant.value\n        }\n    }\n}"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/PlexusGenConfig.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport com.beust.jcommander.Parameter;\nimport com.beust.jcommander.Parameters;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n@Parameters(separators = \" =\")\npublic class PlexusGenConfig {\n\n    @Parameter(names = {\"-t\", \"--type\"}, required = true)\n    private String type;\n\n    @Parameter(names = {\"-i\", \"--input\"})\n    private String input = \"*.interop\";\n\n    @Parameter(names = {\"-o\", \"--out\"})\n    private String outDir = \"./out\";\n\n    @Parameter(names = {\"-of\", \"--outFile\"})\n    private String outFile;\n\n    @Parameter(names = {\"-b\", \"--baseDir\"})\n    private String baseDir = \".\";\n\n    @Parameter(names = {\"-n\", \"--namespace\"})\n    private String namespace = \"plexus\";\n\n    @Parameter(names = {\"-pc\", \"--protoc\"})\n    private String protocPath = \"protoc\";\n\n    @Parameter(names = {\"-v\", \"--verbose\"})\n    private boolean verbose;\n\n    @Parameter(names = {\"-d\", \"--descriptors\"})\n    private boolean includeProtoDescriptors;\n\n    @Parameter(names = {\"-tb\", \"--targetBaseDir\"})\n    private String targetBaseDir;\n\n    @Parameter(names = {\"-e\", \"--exclude\"})\n    private String excludePattern;\n\n    public String getExcludePattern() {\n        return excludePattern;\n    }\n\n    public void setExcludePattern(String excludePattern) {\n        this.excludePattern = excludePattern;\n    }\n\n    private List<String> externalDependencies = new ArrayList<>();\n\n    private String messagesMetadata;\n\n    public boolean isVerbose() {\n        return verbose;\n    }\n\n    public void setVerbose(boolean verbose) {\n        this.verbose = verbose;\n    }\n\n    public boolean isIncludeProtoDescriptors() {\n        return includeProtoDescriptors;\n    }\n\n    public void setIncludeProtoDescriptors(boolean includeProtoDescriptors) {\n        this.includeProtoDescriptors = includeProtoDescriptors;\n    }\n\n    public String getOutFile() {\n        return outFile;\n    }\n\n    public void setOutFile(String outFile) {\n        this.outFile = outFile;\n    }\n\n    public String getMessagesMetadata() {\n        return messagesMetadata;\n    }\n\n    public void setMessagesMetadata(String messagesMetadata) {\n        this.messagesMetadata = messagesMetadata;\n    }\n\n    public String getProtocPath() {\n        return protocPath;\n    }\n\n    public void setProtocPath(String protocPath) {\n        this.protocPath = protocPath;\n    }\n\n    public List<String> getExternalDependencies() {\n        return externalDependencies;\n    }\n\n    public void setExternalDependencies(List<String> externalDependencies) {\n        this.externalDependencies = externalDependencies;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public String getInput() {\n        return input;\n    }\n\n    public void setInput(String input) {\n        this.input = input;\n    }\n\n    public String getOutDir() {\n        return outDir;\n    }\n\n    public void setOutDir(String outDir) {\n        this.outDir = outDir;\n    }\n\n    public String getBaseDir() {\n        return baseDir;\n    }\n\n    public void setBaseDir(String baseDir) {\n        this.baseDir = baseDir;\n    }\n\n    public String getNamespace() {\n        return namespace;\n    }\n\n    public void setNamespace(String namespace) {\n        this.namespace = namespace;\n    }\n\n    public String getTargetBaseDir() {\n        return targetBaseDir;\n    }\n\n    public void setTargetBaseDir(String targetBaseDir) {\n        this.targetBaseDir = targetBaseDir;\n    }\n\n    @Override\n    public String toString() {\n        return \"PlexusGenConfig{\" +\n                \"type='\" + type + '\\'' +\n                \", input='\" + input + '\\'' +\n                \", outDir='\" + outDir + '\\'' +\n                \", outFile='\" + outFile + '\\'' +\n                \", baseDir='\" + baseDir + '\\'' +\n                \", namespace='\" + namespace + '\\'' +\n                \", protocPath='\" + protocPath + '\\'' +\n                \", verbose=\" + verbose +\n                \", includeProtoDescriptors=\" + includeProtoDescriptors +\n                \", target='\" + targetBaseDir + '\\'' +\n                \", externalDependencies=\" + externalDependencies +\n                \", messagesMetadata='\" + messagesMetadata + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/PlexusGeneratorModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen\n\nimport org.eclipse.xtext.resource.generic.AbstractGenericResourceRuntimeModule\n\nclass PlexusGeneratorModule extends AbstractGenericResourceRuntimeModule {\n\n    override protected String getLanguageName() { \"does.not.seem.to.matter\" }\n\n    override protected String getFileExtensions() { \"ecore\" }\n\n}"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/ResourceSetValidator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen\n\nimport com.db.plexus.interop.dsl.gen.errors.CodeGenerationException\nimport com.google.inject.Inject\nimport java.util.ArrayList\nimport java.util.List\nimport java.util.logging.Logger\nimport java.util.stream.Collectors\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport org.eclipse.xtext.diagnostics.Severity\nimport org.eclipse.xtext.util.CancelIndicator\nimport org.eclipse.xtext.validation.CheckMode\nimport org.eclipse.xtext.validation.IResourceValidator\nimport org.eclipse.xtext.validation.Issue\nimport org.eclipse.xtext.EcoreUtil2\n\npublic class ResourceSetValidator {\n\t\n    @Inject\n    protected IResourceValidator validator;\n\n    protected Logger logger = Logger.getLogger(\"PlexusResourceSetValidator\");\n\t\t\n\tpublic def validateResources(ResourceSet resourceSet) {\n\n        val allIssues = getValidationIssues(resourceSet)\n\n        val errors = errors(allIssues)\n\n        if (!errors.isEmpty()) {\n            this.logger.severe(validationErrorsMessage(errors))\n        }\n        \n        for (Issue error : errors) {\n            this.logger.severe(error.toString())\n        }\n\n        val otherIssues = warnings(allIssues)\n\n        if (!otherIssues.isEmpty()) {\n            this.logger.warning(String.format(\"%d validation warnings found:\", otherIssues.size()))\n        }\n\n        for (Issue warning : otherIssues) {\n            this.logger.warning(warning.toString())\n        }\n\n        if (!errors.isEmpty()) {\n            throw new CodeGenerationException(validationErrorsMessage(errors))\n        }\n    }\n\n    public def getValidationIssues(ResourceSet resourceSet) {\n        EcoreUtil2.resolveAll(resourceSet)\n        val allIssues = new ArrayList<Issue>()\n        for (Resource resource : resourceSet.getResources()) {\n            val issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl)\n            allIssues.addAll(issues)\n        }\n        return allIssues;\n    }\n\n    public def errors(List<Issue> issues) {\n        issues.stream().filter[issue | issue.getSeverity() == Severity.ERROR].collect(Collectors.toList())\n    }\n\n    public def warnings(List<Issue> issues) {\n        issues.stream().filter[issue | issue.getSeverity() != Severity.ERROR].collect(Collectors.toList())\n    }\n    \n   \tprivate def validationErrorsMessage(List<Issue> errors) {\n        return String.format(\"%d validation errors found in loaded resources\", errors.size())\n    }\n}"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/errors/CodeGenerationException.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.errors;\n\n\npublic class CodeGenerationException extends RuntimeException {\n\n    public CodeGenerationException(String message) {\n        super(message);\n    }\n\n    public CodeGenerationException(String message, Throwable cause) {\n        super(message, cause);\n    }\n\n    public CodeGenerationException(Throwable cause) {\n        super(cause);\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/util/CombinedFilePathMatcher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport java.nio.file.*;\n\npublic class CombinedFilePathMatcher implements PathMatcher {\n\n    private final PathMatcher globMatcher;\n    private final PathMatcher simplePathMatcher;\n\n    public CombinedFilePathMatcher(String pattern) {\n        this.globMatcher = FileSystems.getDefault()\n                .getPathMatcher(\"glob:\" + pattern);\n        this.simplePathMatcher = new SimplePathMatcher(pattern);\n    }\n\n    @Override\n    public boolean matches(Path path) {\n        return this.simplePathMatcher.matches(path) || this.globMatcher.matches(path);\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/util/FileUtils.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport org.apache.log4j.Logger;\n\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.nio.file.*;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.util.List;\nimport java.util.function.Consumer;\n\nimport static java.nio.file.FileVisitResult.CONTINUE;\n\npublic class FileUtils {\n\n    private static Logger log = Logger.getLogger(FileUtils.class);\n\n    public static File createTempDir() throws IOException {\n        final Path directory = Files.createTempDirectory(\"plexus\" + Long.toString(System.nanoTime()));\n        return directory.toFile();\n    }\n\n    public static void writeStringToFile(final File file, final String content) throws IOException {\n        if (file.getParentFile() != null) {\n            file.getParentFile().mkdirs();\n        }\n        FileWriter writer = new FileWriter(file);\n        try {\n            writer.append(content);\n        } finally {\n            writer.close();\n        }\n    }\n\n    public static void processFiles(String baseDir, String pattern, Consumer<Path> fileHandler) throws IOException {\n        Files.walkFileTree(Paths.get(baseDir), new Finder(pattern, fileHandler));\n    }\n\n    public static String commonPath(List<String> paths) {\n        String commonPath = \"\";\n        String[][] folders = new String[paths.size()][];\n        for (int i = 0; i < paths.size(); i++) {\n            folders[i] = paths.get(i).split(\"\\\\\" + File.separator);\n        }\n        for (int j = 0; j < folders[0].length; j++) {\n            String thisFolder = folders[0][j];\n            boolean allMatched = true;\n            for (int i = 1; i < folders.length && allMatched; i++) {\n                if (folders[i].length < j) {\n                    allMatched = false;\n                    break;\n                }\n                allMatched &= folders[i][j].equals(thisFolder);\n            }\n            if (allMatched) {\n                commonPath += thisFolder + File.separator;\n            } else {\n                break;\n            }\n        }\n        return commonPath;\n    }\n\n    private static class Finder extends SimpleFileVisitor<Path> {\n\n        private final PathMatcher matcher;\n        private final Consumer<Path> fileHandler;\n\n        Finder(String pattern, Consumer<Path> fileHandler) {\n            matcher = new CombinedFilePathMatcher(pattern);\n            this.fileHandler = fileHandler;\n        }\n\n        @Override\n        public FileVisitResult visitFile(Path file,\n                                         BasicFileAttributes attrs) {\n            Path name = file.getFileName();\n            if (matcher.matches(file) || (name != null && matcher.matches(name))) {\n                fileHandler.accept(file);\n            }\n            return CONTINUE;\n        }\n\n\n        @Override\n        public FileVisitResult visitFileFailed(Path file,\n                                               IOException exc) {\n            log.error(String.format(\"Failed to load %s file\", file.toString()), exc);\n            return CONTINUE;\n        }\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/util/ProcessResult.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\npublic class ProcessResult {\n\n    public final int code;\n    public final String stdout;\n\n    public ProcessResult(int code, String stdout) {\n        this.code = code;\n        this.stdout = stdout;\n    }\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/util/ProcessUtils.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class ProcessUtils {\n\n    public static ProcessResult execSync(final String[] args) throws IOException, InterruptedException {\n        final Process process = new ProcessBuilder(args)\n                .redirectErrorStream(true)\n                .start();\n        BufferedReader reader =\n                new BufferedReader(new InputStreamReader(process.getInputStream()));\n        StringBuilder builder = new StringBuilder();\n        String line;\n        while ((line = reader.readLine()) != null) {\n            builder.append(line);\n            builder.append(System.getProperty(\"line.separator\"));\n        }\n        int code = process.waitFor();\n        return new ProcessResult(code, builder.toString());\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/common/src/main/java/com/db/plexus/interop/dsl/gen/util/SimplePathMatcher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport java.nio.file.FileSystems;\nimport java.nio.file.Path;\nimport java.nio.file.PathMatcher;\n\npublic class SimplePathMatcher implements PathMatcher {\n\n    private Path path;\n\n    public SimplePathMatcher(String path) {\n        try {\n            this.path = FileSystems.getDefault().getPath(path).toAbsolutePath().normalize();\n        } catch (Exception e) {\n        }\n    }\n\n    @Override\n    public boolean matches(Path path) {\n        return this.path != null && this.path.equals(path);\n    }\n}"
  },
  {
    "path": "dsl/gen/common/src/test/java/com/db/plexus/interop/dsl/gen/BaseCodeGenTest.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\n\npublic class BaseCodeGenTest {\n\n    protected Path[] getExampleEntries() throws Exception {\n        return new Path[]{\n                Paths.get(getClass().getResource(\"/TestComponentA.interop\").toURI()),\n                Paths.get(getClass().getResource(\"/TestComponentB.interop\").toURI()),\n                Paths.get(getClass().getResource(\"/Model.proto\").toURI()),\n                Paths.get(getClass().getResource(\"/Services.proto\").toURI())\n        };\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/common/src/test/java/com/db/plexus/interop/dsl/gen/util/CombinedFilePathMatcherTest.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport org.junit.Test;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\n\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\npublic class CombinedFilePathMatcherTest {\n\n    private static final Path INTEROP_CLIENT_PATH = Paths.get(\"client.interop\");\n\n    @Test\n    public void testMatchesGlob() {\n        assertTrue(new CombinedFilePathMatcher(\"**\").matches(INTEROP_CLIENT_PATH));\n    }\n\n    @Test\n    public void testWrongGlobNotMatches() {\n        assertFalse(new CombinedFilePathMatcher(\"*.java\").matches(INTEROP_CLIENT_PATH));\n    }\n\n    @Test\n    public void testWrongPathNotMatches() {\n        assertFalse(new CombinedFilePathMatcher(\"do/not/exist.interop\").matches(INTEROP_CLIENT_PATH));\n    }\n\n}"
  },
  {
    "path": "dsl/gen/common/src/test/java/com/db/plexus/interop/dsl/gen/util/FileUtilsTest.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.util;\n\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport java.io.File;\nimport java.util.Arrays;\n\npublic class FileUtilsTest {\n\n    @Test\n    public void testCommonPath() {\n        Assert.assertEquals(\"C:\" + File.separator + \"common\" + File.separator, FileUtils.commonPath(Arrays.asList(\n                \"C:\" + File.separator + \"common\" + File.separator + \"first\" + File.separator + \"second\",\n                \"C:\" + File.separator + \"common\" + File.separator + \"third\" + File.separator + \"second\"\n                )));\n        Assert.assertEquals(\"C:\" + File.separator, FileUtils.commonPath(Arrays.asList(\n                \"C:\" + File.separator + \"first\",\n                \"C:\" + File.separator + \"second\"\n        )));\n    }\n}\n"
  },
  {
    "path": "dsl/gen/csharp/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:gen:common')\n    compile project(':dsl:gen:proto')\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/csharp/src/main/java/com/db/plexus/interop/dsl/gen/csharp/CsharpCodeGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.csharp\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.protobuf.Message\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport com.db.plexus.interop.dsl.protobuf.Option\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport com.db.plexus.interop.dsl.protobuf.Service\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.resource.XtextResource\n\nimport com.db.plexus.interop.dsl.Application\nimport com.db.plexus.interop.dsl.ProvidedService\nimport org.eclipse.emf.common.util.URI\nimport com.db.plexus.interop.dsl.ConsumedService\nimport org.eclipse.xtext.naming.QualifiedName\nimport com.db.plexus.interop.dsl.protobuf.StringConstant\nimport com.google.inject.Inject\nimport static extension com.db.plexus.interop.dsl.gen.GenUtils.*\nimport com.db.plexus.interop.dsl.gen.GenUtils\n\nclass CsharpCodeGenerator  {\n\t\n\tprivate static final QualifiedName CSHARP_NAMESPACE_OPTION_DESCRIPTOR_NAME = QualifiedName.create(\"\", \"google\", \"protobuf\", \"FileOptions\", \"csharp_namespace\")\n\t\n\t@Inject\n\tGenUtils utils \n\t    \n    IQualifiedNameProvider qualifiedNameProvider    \n    PlexusGenConfig config    \n    URI baseDirUri\n    String accessModifier\n      \n    new(PlexusGenConfig config, IQualifiedNameProvider qualifiedNameProvider, URI baseDirUri, String accessModifier) {\n    \tthis.accessModifier = accessModifier;    \t\n    \tthis.config = config\n    \tthis.qualifiedNameProvider = qualifiedNameProvider\n    \tthis.baseDirUri = baseDirUri\n    }\n    \n    def String gen(XtextResource resource) {\n\t\t'''\t\t\n\t\t\t// <auto-generated>\n\t\t\t// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n\t\t\t// \tsource: «resource.URI.deresolve(baseDirUri).toFileString»\n\t\t\t// </auto-generated>\n\t\t\t#pragma warning disable 1591, 0612, 3021\n\t\t\t#region Designer generated code\n\t\t\tnamespace «resource.csharpNamespace» {\n\t\t\t\t\n\t\t\t\tusing System;\n\t\t\t\tusing global::Plexus;\n\t\t\t\tusing global::Plexus.Channels;\n\t\t\t\tusing global::Plexus.Interop;\n\t\t\t\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\t\t\t\n\t\t\t\t«FOR service : resource.services SEPARATOR '\\n'»\n\t\t\t\t\t«gen(service)»\n\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\t\t\n\t\t\t\t«FOR application : resource.applications SEPARATOR '\\n'»\n\t\t\t\t\t«gen(application)»\n\t\t\t\t«ENDFOR»\n\t\t\t}\n\t\t\t#endregion Designer generated code\n\t\t'''\n\t}\n\t\n\tdef String gen(Application application) {\n\t\t'''\n\t\t\t«accessModifier» partial interface I«application.clientName»: IClient {\n\t\t\t\t«FOR consumedService: application.consumedServices SEPARATOR '\\n'»\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t«application.clientName».I«consumedService.aliasOrName»Proxy «consumedService.aliasOrName» { get; }\n\t\t\t\t«ENDFOR»\t\t\t\t\n\t\t\t}\n\n\t\t\t«accessModifier» sealed partial class «application.clientName»: ClientBase, I«application.clientName» {\n\t\t\t\t\n\t\t\t\tpublic const string Id = \"«utils.getFullName(application)»\";\n\t\t\t\t\n\t\t\t\t«IF application.providedServices.length > 0»\t\t\t\t\n\t\t\t\tprivate static ClientOptions CreateClientOptions(«application.clientName».ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\t\t\tserviceBinder.Bind(builder);\n\t\t\t\t\tif (setup != null) {\n\t\t\t\t\t\tbuilder = setup(builder);\n\t\t\t\t\t}\n\t\t\t\t\treturn builder.Build();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic «application.clientName»(\n\t\t\t\t\t«FOR providedService: application.providedServices»\n\t\t\t\t\t\t«application.clientName».I«providedService.aliasOrName»Impl «providedService.aliasOrName.toFirstLower»,\n\t\t\t\t\t«ENDFOR»\n\t\t\t\t\tFunc<ClientOptionsBuilder, ClientOptionsBuilder> setup = null\n\t\t\t\t)\n\t\t\t\t:this(new «application.clientName».ServiceBinder(\n\t\t\t\t\t«FOR providedService: application.providedServices SEPARATOR ','»\n\t\t\t\t\t\t«providedService.aliasOrName.toFirstLower»\n\t\t\t\t\t«ENDFOR»\t\t\t\t\t\n\t\t\t\t), setup) { }\n\t\t\t\t\n\t\t\t\tpublic «application.clientName»(«application.clientName».ServiceBinder serviceBinder, Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(serviceBinder, setup)) \n\t\t\t\t{\n\t\t\t\t\t«FOR consumedService : application.consumedServices»\n\t\t\t\t\t«consumedService.aliasOrName» = new «application.clientName».«consumedService.aliasOrName»Proxy(this.CallInvoker);\n\t\t\t\t\t«ENDFOR»\n\t\t\t\t}\n\n\t\t\t\tpublic sealed partial class ServiceBinder {\n\t\t\t\t\t\n\t\t\t\t\tpublic ServiceBinder(\n\t\t\t\t\t\t«FOR providedService: application.providedServices SEPARATOR ','»\n\t\t\t\t\t\t\t«application.clientName».I«providedService.aliasOrName»Impl «providedService.aliasOrName.toFirstLower»\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t) {\n\t\t\t\t\t\t«FOR providedService: application.providedServices»\n\t\t\t\t\t\t\t_«providedService.aliasOrName.toFirstLower»Binder = new «application.clientName».«providedService.aliasOrName»Binder(«providedService.aliasOrName.toFirstLower»);\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t«FOR providedService: application.providedServices»\n\t\t\t\t\t\tprivate «providedService.aliasOrName»Binder _«providedService.aliasOrName.toFirstLower»Binder;\n\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\n\t\t\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\t\t\t«FOR providedService: application.providedServices»\n\t\t\t\t\t\t\tbuilder = _«providedService.aliasOrName.toFirstLower»Binder.Bind(builder);\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t«FOR providedService: application.providedServices SEPARATOR '\\n'»\n\t\t\t\t\tpublic partial interface I«providedService.aliasOrName»Impl«IF providedService.methods.length > 0»:«ENDIF»\n\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t«providedService.service.csharpFullName».I«providedMethod.method.name.toFirstUpper»Impl\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t{ }\n\t\t\t\t\t\n\t\t\t\t\tprivate sealed partial class «providedService.aliasOrName»Binder {\n\t\t\t\t\t\t\n\t\t\t\t\t\t«IF providedService.alias !== null»\n\t\t\t\t\t\tpublic const string Alias = \"«providedService.alias»\";\n\t\t\t\t\t\t«ENDIF»\n\t\t\t\t\t\t\n\t\t\t\t\t\tprivate readonly I«providedService.aliasOrName»Impl _impl;\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic «providedService.aliasOrName»Binder(I«providedService.aliasOrName»Impl impl) {\n\t\t\t\t\t\t\t_impl = impl;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic ClientOptionsBuilder Bind(ClientOptionsBuilder builder) {\n\t\t\t\t\t\t\t«IF providedService.alias === null»\n\t\t\t\t\t\t\treturn builder.WithProvidedService(«providedService.service.getCsharpFullName()».Id, Bind);\n\t\t\t\t\t\t\t«ELSE»\n\t\t\t\t\t\t\treturn builder.WithProvidedService(«providedService.service.getCsharpFullName()».Id, Alias, Bind);\n\t\t\t\t\t\t\t«ENDIF»\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tprivate ProvidedServiceDefinition.Builder Bind(ProvidedServiceDefinition.Builder builder) {\n\t\t\t\t\t\t\t«FOR providedMethod : providedService.methods»\n\t\t\t\t\t\t\t\t«IF providedMethod.method.isPointToPoint»\n\t\t\t\t\t\t\t\tbuilder = builder.WithUnaryMethod«providedMethod.method.genericArgs»(«providedMethod.method.service.getCsharpFullName()».«providedMethod.method.name.toFirstUpper»MethodId, _impl.«providedMethod.method.name.toFirstUpper»);\n\t\t\t\t\t\t\t\t«ELSEIF providedMethod.method.serverStreaming»\n\t\t\t\t\t\t\t\tbuilder = builder.WithServerStreamingMethod«providedMethod.method.genericArgs»(«providedMethod.method.service.getCsharpFullName()».«providedMethod.method.name.toFirstUpper»MethodId, _impl.«providedMethod.method.name.toFirstUpper»);\n\t\t\t\t\t\t\t\t«ELSEIF providedMethod.method.clientStreaming»\n\t\t\t\t\t\t\t\tbuilder = builder.WithClientStreamingMethod«providedMethod.method.genericArgs»(«providedMethod.method.service.getCsharpFullName()».«providedMethod.method.name.toFirstUpper»MethodId, _impl.«providedMethod.method.name.toFirstUpper»);\n\t\t\t\t\t\t\t\t«ELSEIF providedMethod.method.bidiStreaming»\n\t\t\t\t\t\t\t\tbuilder = builder.WithDuplexStreamingMethod«providedMethod.method.genericArgs»(«providedMethod.method.service.getCsharpFullName()».«providedMethod.method.name.toFirstUpper»MethodId, _impl.«providedMethod.method.name.toFirstUpper»);\n\t\t\t\t\t\t\t\t«ENDIF»\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\treturn builder; \t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpublic sealed partial class «providedService.aliasOrName»Impl: I«providedService.aliasOrName»Impl\n\t\t\t\t\t{\n\t\t\t\t\t\t«FOR providedMethod : providedService.methods»\n\t\t\t\t\t\t\tprivate readonly «providedMethod.method.genHandlerSignature» _«providedMethod.method.name.toFirstLower»Handler;\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic «providedService.aliasOrName»Impl(\n\t\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t\t«providedMethod.method.genHandlerSignature» «providedMethod.method.name.toFirstLower»Handler\n\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t«FOR providedMethod : providedService.methods»\n\t\t\t\t\t\t\t\t_«providedMethod.method.name.toFirstLower»Handler = «providedMethod.method.name.toFirstLower»Handler;\n\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR '\\n'»\n\t\t\t\t\t\t\tpublic «genImplSignature(providedMethod.method)» {\n\t\t\t\t\t\t\t\treturn _«providedMethod.method.name.toFirstLower»Handler«genCallCode(providedMethod.method)»;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t«ENDFOR»\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpublic sealed partial class «providedService.aliasOrName»Impl<T>: I«providedService.aliasOrName»Impl\n\t\t\t\t\t\t«IF providedService.methods.length > 0»\n\t\t\t\t\t\t\twhere T:\n\t\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t\t«providedService.service.csharpFullName».I«providedMethod.method.name.toFirstUpper»Impl\n\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t«ENDIF» \n\t\t\t\t\t{\n\t\t\t\t\t\tprivate readonly T _impl;\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic «providedService.aliasOrName»Impl(T impl) {\n\t\t\t\t\t\t\t_impl = impl;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR '\\n'»\n\t\t\t\t\t\t\tpublic «genImplSignature(providedMethod.method)» {\n\t\t\t\t\t\t\t\treturn «genImplCallCode(providedMethod.method, \"_impl\")»;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t«ENDFOR»\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t«ENDFOR»\n\t\t\t\t«ELSE»\n\t\t\t\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\t\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\t\t\t\tif (setup != null) {\n\t\t\t\t\t\t\tbuilder = setup(builder);\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpublic «application.clientName»(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t\t\t\t{ \n\t\t\t\t\t\t«FOR consumedService : application.consumedServices»\n\t\t\t\t\t\t«consumedService.aliasOrName» = new «application.clientName».«consumedService.aliasOrName»Proxy(this.CallInvoker);\n\t\t\t\t\t\t«ENDFOR»\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t«ENDIF»\n\t\t\t\t\n\t\t\t\t«FOR consumedService: application.consumedServices SEPARATOR '\\n'»\t\t\t\t\t\n\t\t\t\t\tpublic partial interface I«consumedService.aliasOrName»Proxy«IF consumedService.methods.length > 0»:«ENDIF»\n\t\t\t\t\t\t«FOR consumedMethod : consumedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t«consumedService.service.csharpFullName».I«consumedMethod.method.name.toFirstUpper»Proxy\n\t\t\t\t\t\t«ENDFOR»\t\t\t\t\t\t\n\t\t\t\t\t{ }\n\t\t\t\t\t\n\t\t\t\t\tpublic sealed partial class «consumedService.aliasOrName»Proxy: I«consumedService.aliasOrName»Proxy {\n\t\t\t\t\t\t\n\t\t\t\t\t\t«IF consumedService.alias === null»\n\t\t\t\t\t\tpublic static «consumedService.service.csharpFullName».Descriptor Descriptor = «consumedService.service.csharpFullName».DefaultDescriptor;\n\t\t\t\t\t\t«ELSE»\n\t\t\t\t\t\tpublic const string Alias = \"«consumedService.alias»\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic static «consumedService.service.csharpFullName».Descriptor Descriptor = «consumedService.service.csharpFullName».CreateDescriptor(Alias);\n\t\t\t\t\t\t«ENDIF»\n\t\t\t\t\t\t\n\t\t\t\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tpublic «consumedService.aliasOrName»Proxy(IClientCallInvoker callInvoker) {\n\t\t\t\t\t\t\t_callInvoker = callInvoker;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t«FOR consumedMethod : consumedService.methods SEPARATOR '\\n'»\n\t\t\t\t\t\t\tpublic «consumedMethod.method.genProxySignature(\"request\")» {\n\t\t\t\t\t\t\t\t«IF consumedMethod.method.request.isStream»\n\t\t\t\t\t\t\t\t\treturn _callInvoker.Call(Descriptor.«consumedMethod.method.name.toFirstUpper»Method);\n\t\t\t\t\t\t\t\t«ELSE»\n\t\t\t\t\t\t\t\t\treturn _callInvoker.Call(Descriptor.«consumedMethod.method.name.toFirstUpper»Method, request);\n\t\t\t\t\t\t\t\t«ENDIF»\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpublic I«consumedService.aliasOrName»Proxy «consumedService.aliasOrName» { get; private set; }\n\t\t\t\t«ENDFOR»\n\t\t\t}\n\t\t'''\t\t\n\t}\n\t\n\tdef String gen(Service service) {\n\t\t'''\n\t\t\t«accessModifier» static partial class «service.name.toFirstUpper» {\n\t\t\t\t\n\t\t\t\tpublic const string Id = \"«utils.getFullName(service)»\";\t\t\t\n\t\t\t\t«FOR method : service.methods»\n\t\t\t\t\tpublic const string «method.name.toFirstUpper»MethodId = \"«method.name»\";\n\t\t\t\t«ENDFOR»\n\t\t\t\t\n\t\t\t\tpublic static readonly «service.name.toFirstUpper».Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\t\t\n\t\t\t\tpublic static «service.name.toFirstUpper».Descriptor CreateDescriptor() {\n\t\t\t\t\treturn new «service.name.toFirstUpper».Descriptor();\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tpublic static «service.name.toFirstUpper».Descriptor CreateDescriptor(string alias) {\n\t\t\t\t\treturn new «service.name.toFirstUpper».Descriptor(alias);\n\t\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\t\t«FOR method : service.methods SEPARATOR '\\n'»\n\t\t\t\tpublic partial interface I«method.name.toFirstUpper»Proxy {\n\t\t\t\t\t«genProxySignature(method, \"request\")»;\n\t\t\t\t}\n\t\t\t\t«ENDFOR»\n\t\t\t\t\n\t\t\t\t«FOR method : service.methods SEPARATOR '\\n'»\n\t\t\t\tpublic partial interface I«method.name.toFirstUpper»Impl {\n\t\t\t\t\t«genImplSignature(method)»;\n\t\t\t\t}\n\t\t\t\t«ENDFOR»\n\t\t\t\t\n\t\t\t\tpublic sealed partial class Descriptor {\n\t\t\t\t\n\t\t\t\t\t«FOR method : service.methods»\n\t\t\t\t\tpublic «method.csharpTypeDeclaration» «method.name.toFirstUpper»Method {get; private set; }\n\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\n\t\t\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\t\t\t«FOR method : service.methods»\n\t\t\t\t\t\t\t«method.name.toFirstUpper»Method = Method.«method.type»«method.genericArgs»(Id, «method.name.toFirstUpper»MethodId);\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tpublic Descriptor(string alias) {\n\t\t\t\t\t\t«FOR method : service.methods»\n\t\t\t\t\t\t\t«method.name.toFirstUpper»Method = Method.«method.type»«method.genericArgs»(Id, alias, «method.name.toFirstUpper»MethodId);\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t'''\n\t}\n\n\tdef String genProxySignature(Method method, String requestVarName) {\n\t\tif (method.pointToPoint) {\n\t\t\t'''IUnaryMethodCall<«method.response.message.csharpFullName»> «method.name.toFirstUpper»(«method.request.message.csharpFullName» «requestVarName»)'''\n\t\t} else if (method.serverStreaming) {\n\t\t\t'''IServerStreamingMethodCall<«method.response.message.csharpFullName»> «method.name.toFirstUpper»(«method.request.message.csharpFullName» «requestVarName»)'''\n\t\t} else if (method.clientStreaming) {\n\t\t\t'''IClientStreamingMethodCall<«method.request.message.csharpFullName», «method.response.message.csharpFullName»> «method.name.toFirstUpper»()'''\n\t\t} else if (method.bidiStreaming) {\n\t\t\t'''IDuplexStreamingMethodCall<«method.request.message.csharpFullName», «method.response.message.csharpFullName»> «method.name.toFirstUpper»()'''\n\t\t}\n\t}\n\n\tdef String genImplSignature(Method method) {\n\t\tif (method.pointToPoint) {\n\t\t\t'''Task<«method.response.message.csharpFullName»> «method.name.toFirstUpper»(«method.request.message.csharpFullName» request, MethodCallContext context)'''\n\t\t} else if (method.serverStreaming) {\n\t\t\t'''Task «method.name.toFirstUpper»(«method.request.message.csharpFullName» request, IWritableChannel<«method.response.message.csharpFullName»> responseStream, MethodCallContext context)'''\n\t\t} else if (method.clientStreaming) {\n\t\t\t'''Task<«method.response.message.csharpFullName»> «method.name.toFirstUpper»(IReadableChannel<«method.request.message.csharpFullName»> requestStream, MethodCallContext context)'''\n\t\t} else if (method.bidiStreaming) {\n\t\t\t'''Task «method.name.toFirstUpper»(IReadableChannel<«method.request.message.csharpFullName»> requestStream, IWritableChannel<«method.response.message.csharpFullName»> responseStream, MethodCallContext context)'''\n\t\t}\n\t}\n\t\n\tdef String genHandlerSignature(Method method) {\n\t\treturn '''«method.type»MethodHandler«method.genericArgs»'''\n\t}\t\n\t\n\n\tdef String genMethodDescriptorStaticDeclaration(Method method) {\n\t\t'''public static readonly «method.getCsharpTypeDeclaration» «method.name.toFirstUpper»Method = «genMethodDescriptorDeclaration(method)»;'''\n\t}\n\n\tdef String genMethodDescriptorDeclaration(Method method) {\n\t\tval serviceName = utils.getFullName(method.service);\n\t\tval type = method.type\n\t\t'''Method.«type»«method.genericArgs»(\"«serviceName»\", \"«method.name»\")'''\n\t}\n\n\tdef String genMethodDescriptorDeclaration(Method method, String aliasVar) {\n\t\tval serviceName = utils.getFullName(method.service);\n\t\tval type = method.type\n\t\t'''Method.«type»«method.genericArgs»(\"«serviceName»\", «aliasVar», \"«method.name»\")'''\n\t}\n\n\tdef String getGenericArgs(Method method) {\n\t\tval requestName = method.request.message.csharpFullName\n\t\tval responseName = method.response.message.csharpFullName\n\t\t'''<«requestName», «responseName»>'''\n\t}\n\n\tdef String getCsharpTypeDeclaration(Method method) {\n\t\t'''«method.type»Method«method.genericArgs»'''\n\t}\n\n\tdef static String getType(Method method) {\n\t\tvar methodType = \"Unary\"\n\t\tif (method.pointToPoint) {\n\t\t\tmethodType = \"Unary\"\n\t\t} else if (method.serverStreaming) {\n\t\t\tmethodType = \"ServerStreaming\"\n\t\t} else if (method.bidiStreaming) {\n\t\t\tmethodType = \"DuplexStreaming\"\n\t\t} else if (method.clientStreaming) {\n\t\t\tmethodType = \"ClientStreaming\"\n\t\t}\n\t}\n\n\tdef getCsharpNamespace(Resource resource) {\n\t\tvar ns = \"Plexus.Interop.Generated\";\n\t\tval package = resource.allContents.filter(typeof(Proto)).findFirst[x|true]\n\t\tif (package !== null) {\t\t\t\t\t\n\t\t\tns = qualifiedNameProvider.getFullyQualifiedName(package).skipFirst(1).segments.map[x|x.toFirstUpper].join(\".\");\t\t\n\t\t}\n\t\tval option = package.eContents\n\t\t\t.filter(typeof(Option))\n\t\t\t.findFirst[o|qualifiedNameProvider.getFullyQualifiedName(o.descriptor).equals(CSHARP_NAMESPACE_OPTION_DESCRIPTOR_NAME)]\n\t\tif (option !== null) {\n\t\t\tns = (option.value as StringConstant).value \t\t\t\t\t\t\n\t\t}\n\t\treturn ns\n\t}\n\n\tdef getCsharpFullName(Message obj) {\n\t\treturn \"global::\" + getCsharpNamespace(obj.eResource) + \".\" + obj.name.toFirstUpper\n\t}    \n\t\n\tdef getCsharpFullName(Service obj) {\n\t\treturn \"global::\" + getCsharpNamespace(obj.eResource) + \".\" + obj.name.toFirstUpper\n\t}\n\t\n\tdef String genCallCode(Method method) {\n\t\tif (method.pointToPoint) {\n\t\t\t'''(request, context)'''\n\t\t} else if (method.serverStreaming) {\n\t\t\t'''(request, responseStream, context)'''\n\t\t} else if (method.clientStreaming) {\n\t\t\t'''(requestStream, context)'''\n\t\t} else if (method.bidiStreaming) {\t\t\t\n\t\t\t'''(requestStream, responseStream, context)'''\n\t\t}\n\t}\t\n\t\n\tdef String genImplCallCode(Method method, String varName) {\n\t\tif (method.pointToPoint) {\n\t\t\t'''«varName».«method.name.toFirstUpper»«method.genCallCode»'''\n\t\t} else if (method.serverStreaming) {\n\t\t\t'''«varName».«method.name.toFirstUpper»«method.genCallCode»'''\n\t\t} else if (method.clientStreaming) {\n\t\t\t'''«varName».«method.name.toFirstUpper»«method.genCallCode»'''\n\t\t} else if (method.bidiStreaming) {\t\t\t\n\t\t\t'''«varName».«method.name.toFirstUpper»«method.genCallCode»'''\n\t\t}\n\t}\t\n\t\n\tdef String getAliasOrName(ProvidedService providedService) {\n\t\tif (providedService.alias !== null) providedService.alias.toFirstUpper else providedService.service.name.toFirstUpper \n\t}\n\t\n\tdef String getAliasOrName(ConsumedService consumedService) {\n\t\tif (consumedService.alias !== null) consumedService.alias.toFirstUpper else consumedService.service.name.toFirstUpper \n\t}\n\t\n\tdef getClientName(Application app) {\n\t\tif (app.name.endsWith(\"Client\")) {\n\t\t\treturn app.name.toFirstUpper\n\t\t} else {\n\t\t\treturn '''«app.name.toFirstUpper»Client'''\n\t\t}\t\t\n\t}\t\n}"
  },
  {
    "path": "dsl/gen/csharp/src/main/java/com/db/plexus/interop/dsl/gen/csharp/CsharpGenTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.csharp\n\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.gen.util.FileUtils\nimport com.google.inject.Inject\nimport java.io.File\nimport java.io.IOException\nimport java.nio.file.Paths\nimport java.util.LinkedList\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.resource.XtextResource\nimport org.eclipse.xtext.resource.XtextResourceSet\n\nimport static extension com.db.plexus.interop.dsl.gen.GenUtils.*\nimport com.google.inject.Injector\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport com.db.plexus.interop.dsl.protobuf.ProtoSyntax\n\nclass CsharpGenTask extends BaseGenTask {\n\n\t@Inject\n\tIQualifiedNameProvider qualifiedNameProvider\n\t\n\t@Inject\n\tInjector injector\n\t\t\t\t\t\n\toverride protected doGenWithResources(PlexusGenConfig config, XtextResourceSet resourceSet) throws IOException {\n\t\t\n\t\tvar accessModifier = \"public\"\n\t\tvar internalAccessArg = \"\"\t\t\n\t\tif (config.namespace !== null && config.namespace.startsWith(\"internal_access:\")) {\n\t\t\tconfig.namespace = config.namespace.substring(\"internal_access:\".length)\n\t\t\tif (config.namespace.isEmpty) {\n\t\t\t\tconfig.namespace = null\n\t\t\t}\n\t\t\taccessModifier = \"internal\"\t\n\t\t\tinternalAccessArg = \"internal_access:\"\t\t\t\n\t\t}\n\t\t\n\t\tvar generator = new CsharpCodeGenerator(config, qualifiedNameProvider, baseDirUri, accessModifier)\n\t\tinjector.injectMembers(generator)\n\n\t\tval resources = resourceSet.resources;\n\n\t\tfor (resource : resources) {\n\t\t\tval isBuiltIn = resource.URI.segmentCount > 2 \n\t\t\t\t&& resource.URI.segment(resource.URI.segmentCount - 3).equals(\"google\") \n\t\t\t\t&& resource.URI.segment(resource.URI.segmentCount - 2).equals(\"protobuf\")\n\t\t\tval isProto2 = resource.URI.lastSegment.endsWith(\".proto\") && resource.contents.filter(typeof(Proto)).findFirst[x | true].syntax == ProtoSyntax.PROTO2\n\t\t\tif (!isBuiltIn && !isProto2)\n\t\t\t{\n\t\t\t\tvar newUri = resource.URI.resolve(workingDirUri)\n\t\t\t\tvar path = newUri.toFileString\n\t\t\t\tif (newUri.toString().startsWith(baseDirUri.toString())) {\n\t\t\t\t\tnewUri = newUri.deresolve(baseDirUri).resolve(outDirUri)\n\t\t\t\t} else {\n\t\t\t\t\tnewUri = newUri.deresolve(resourceBaseUri).resolve(outDirUri)\n\t\t\t\t}\n\t\t\t\tif (newUri.toString.endsWith(\".proto\")) {\n\t\t\t\t\tval newPath = newUri.toFileString\t\t\t\t\n\t\t\t\t\tval file = new File(newPath)\n\t\t\t\t\tfile.parentFile.mkdirs\n\t\t\t\t\tval args = new LinkedList<String>()\n\t\t\t\t\targs.add(config.protocPath)\n\t\t\t\t\targs.add(\"--proto_path=\" + baseDirUri.toFileString)\n\t\t\t\t\tval resourceBasePath = resourceBaseUri.toFileString\n\t\t\t\t\tif (resourceBasePath !== null) { \t\t\t\t\n\t\t\t\t\t\targs.add(\"--proto_path=\" + resourceBaseUri.toFileString)\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\targs.add(\"--csharp_out=\" + internalAccessArg + Paths.get(newPath).parent)\n\t\t\t\t\targs.add(\"--csharp_opt=file_extension=.msg.g.cs\")\n\t\t\t\t\targs.add(path)\n\t\t\t\t\tval procBuilder = new ProcessBuilder(args)\n\t\t\t\t\tprocBuilder.inheritIO()\n\t\t\t\t\tlogger.info(\"Launching \" + String.join(\" \", procBuilder.command))\n\t\t\t\t\tvar Process proc = null\n\t\t\t\t\ttry {\n\t\t\t\t\t\tproc = procBuilder.start()\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IOException(\"Cannot start Protobuf compiler: \" + config.protocPath +\n\t\t\t\t\t\t\t\". Probably the path is wrong. You can change it using command-line argument --protoc=<path>.\",\n\t\t\t\t\t\t\te)\n\t\t\t\t\t}\n\t\t\t\t\tvar exitCode = proc.waitFor\n\t\t\t\t\tif (exitCode != 0) {\n\t\t\t\t\t\tthrow new IOException(\"protoc process exited with non-zero exit code: \" + exitCode)\n\t\t\t\t\t}\n\t\t\t\t\tlogger.info(\"Completed \" + String.join(\" \", procBuilder.command))\n\t\t\t\t}\n\t\t\t\tval fileNameSegments = newUri.lastSegment.split(\"_\").map[x | x.toFirstUpper]\n\t\t\t\tnewUri = newUri.trimSegments(1).appendSegment(String.join(\"\", fileNameSegments))\t\t\t\t\n\t\t\t\tif (resource.services.length > 0) {\n\t\t\t\t\tval newPath = newUri.toFileString.replace(\".proto\", \".svc.g.cs\");\t\t\t\t\n\t\t\t\t\tlogger.info(\"Generating \" + newPath);\n\t\t\t\t\tFileUtils.writeStringToFile(new File(newPath), generator.gen(resource as XtextResource))\n\t\t\t\t}\n\t\t\t\tif (resource.applications.length > 0) {\t\t\t\t\n\t\t\t\t\tval newPath = newUri.toFileString.replace(\".interop\", \".app.g.cs\");\t\t\t\t\n\t\t\t\t\tlogger.info(\"Generating \" + newPath);\n\t\t\t\t\tFileUtils.writeStringToFile(new File(newPath), generator.gen(resource as XtextResource))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/gen/js/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:gen:common')\n    testCompile project(':dsl:gen:common')\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/js/src/main/java/com/db/plexus/interop/dsl/gen/js/JsComponentApiGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.js\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.Application\nimport java.util.List\nimport org.eclipse.emf.ecore.resource.Resource\nimport com.db.plexus.interop.dsl.gen.ApplicationCodeGenerator\nimport com.google.inject.Inject\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.emf.ecore.EObject\nimport com.db.plexus.interop.dsl.ConsumedMethod\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport javax.inject.Named\nimport static extension com.db.plexus.interop.dsl.gen.GenUtils.*\nimport com.db.plexus.interop.dsl.ConsumedService\nimport com.db.plexus.interop.dsl.ProvidedService\n\n@Named\nclass JsComponentApiGenerator extends ApplicationCodeGenerator {\n\n    @Inject\n    IQualifiedNameProvider qualifiedNameProvider\n\n    def fullName(EObject obj) {\n        return qualifiedNameProvider.getFullyQualifiedName(obj).skipFirst(1).toString()\n    }\n\n    def namespace(EObject obj) {\n        return qualifiedNameProvider.getFullyQualifiedName(obj).skipFirst(1).skipLast(1).toString()\n    }\n\n    override def generate(PlexusGenConfig genConfig, Application app, List<Resource> resources) {\n\n        val consumedServices = app.getConsumedServices\n        val providedServices = app.getProvidedServices\n\n        '''\n«imports(genConfig)»\n\n«FOR consumedService : consumedServices SEPARATOR \"\\n\"»\n    /**\n     *  Internal Proxy implementation for «consumedService.aliasOrName.toFirstUpper» service\n     */\n    export class «consumedService.aliasOrName.toFirstUpper»Proxy {\n\n        constructor(genericClient) {\n            this.genericClient = genericClient;\n        }\n\n        «FOR consumedMethod : consumedService.methods SEPARATOR \"\\n\"»\n        «clientMethodSignature(consumedMethod, genConfig)» {\n            «clientMethodImpl(consumedMethod, consumedService, genConfig)»\n        }\n        «ENDFOR»\n\n    }\n«ENDFOR»\n\n/**\n * Client's API internal implementation\n *\n */\nclass «app.name»Client extends GenericClientApiBase {\n\n    constructor(\n        genericClient,\n        «FOR consumedService : consumedServices SEPARATOR ','»\n        «consumedService.aliasOrName.toFirstLower»Proxy\n        «ENDFOR»\n    ) {\n        super(genericClient);\n        «FOR consumedService : consumedServices »\n        this.«consumedService.aliasOrName.toFirstLower»Proxy = «consumedService.aliasOrName.toFirstLower»Proxy;\n        «ENDFOR»\n    }\n\n    «FOR consumedService : consumedServices SEPARATOR '\\n' »\n    get«consumedService.aliasOrName.toFirstUpper»Proxy() {\n        return this.«consumedService.aliasOrName.toFirstLower»Proxy;\n    }\n    «ENDFOR»\n\n}\n\n«FOR providedService : providedServices SEPARATOR '\\n' »\n    /**\n     * Client invocation handler for «providedService.aliasOrName.toFirstUpper», to be implemented by Client\n     *\n     */\n    export class «providedService.aliasOrName.toFirstUpper»InvocationHandler {\n\n        «FOR providedMethod : providedService.methods»\n        «clientHandlerSignature(providedMethod.method, genConfig)» {\n            // TODO implement handler\n        }\n        «ENDFOR»\n    }\n«ENDFOR»\n\n«FOR providedService : providedServices SEPARATOR '\\n' »\n    /**\n     * Internal invocation handler delegate for «providedService.aliasOrName.toFirstUpper»\n     *\n     */\n    class «providedService.aliasOrName.toFirstUpper»InvocationHandlerInternal {\n\n        constructor(clientHandler) {\n            this.clientHandler = clientHandler;\n        }\n\n        «FOR providedMethod : providedService.methods SEPARATOR '\\n'»\n        «genericClientHandlerSignature(providedMethod.method, genConfig)» {\n            «handlerMethodImpl(providedMethod.method, genConfig)»\n        }\n        «ENDFOR»\n    }\n«ENDFOR»\n\n/**\n * Client API builder\n *\n */\nexport class «app.name»ClientBuilder {\n\n    withClientDetails(clientId) {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    withAppInstanceId(appInstanceId) {\n        this.clientDetails = this.clientDetails || {};\n        this.clientDetails.applicationInstanceId = appInstanceId;\n        return this;\n    }\n\n    withAppId(appId) {\n        this.clientDetails = this.clientDetails || {};\n        this.clientDetails.applicationId = appId;\n        return this;\n    }\n\n    «FOR providedMethod : providedServices SEPARATOR '\\n' »\n    with«providedMethod.aliasOrName.toFirstUpper»InvocationsHandler(invocationsHandler) {\n        this.«providedMethod.aliasOrName.toFirstLower»Handler = new «providedMethod.aliasOrName.toFirstUpper»InvocationHandlerInternal(invocationsHandler);\n        return this;\n    }\n    «ENDFOR»\n\n    withTransportConnectionProvider(provider) {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    connect() {\n        return new ContainerAwareClientAPIBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            «FOR providedService : providedServices »\n                «FOR providedMethod : providedService.methods»\n                    «invocationHandlerBuilder(providedMethod.method, providedService, genConfig)»\n                «ENDFOR»\n            «ENDFOR»\n            .connect()\n            .then(genericClient => new «app.name»ClientImpl(\n                genericClient«IF !consumedServices.isEmpty»,«ENDIF»\n                «FOR consumedService : consumedServices SEPARATOR \",\"»\n                new «consumedService.aliasOrName.toFirstUpper»ProxyImpl(genericClient)\n                «ENDFOR»));\n    }\n}\n    '''\n    }\n\n    def invocationHandlerBuilder(Method rpcMethod, ProvidedService providedService, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''\n            .withUnaryInvocationHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            })\n            '''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''\n            .withBidiStreamingInvocationHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            })\n            '''\n            case rpcMethod.isServerStreaming: '''\n            .withServerStreamingInvocationHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            })\n            '''\n        }\n    }\n\n    def handlerBuilderParam(Method rpcMethod, ProvidedService providedService, PlexusGenConfig genConfig) {\n        return '''\n            serviceInfo: {\n                serviceId: \"«rpcMethod.service.fullName»\"«IF providedService.alias !== null»,\n                serviceAlias: \"«providedService.alias»\"«ENDIF»\n            },\n            handler: {\n                methodId: \"«rpcMethod.name»\",\n                handle: this.«providedService.aliasOrName.toFirstLower»Handler.on«rpcMethod.name».bind(this.«providedService.aliasOrName.toFirstLower»Handler)\n            }\n        '''\n    }\n\n    def imports(PlexusGenConfig genConfig) '''\nimport { MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from \"@plexus-interop/client\";\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from \"@plexus-interop/client\";\nimport { TransportConnection, UniqueId } from \"@plexus-interop/transport-common\";\nimport { Arrays, Observer } from \"@plexus-interop/common\";\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from \"@plexus-interop/client\";\n\nimport * as plexus from \"«genConfig.getExternalDependencies().get(0)»\";\n    '''\n\n    def clientMethodSignature(ConsumedMethod methodLink, PlexusGenConfig genConfig) {\n        clientMethodSignature(methodLink.method, genConfig)\n    }\n\n    def clientMethodSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''«rpcMethod.name.toFirstLower»(request)'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''«rpcMethod.name.toFirstLower»(responseObserver)'''\n            case rpcMethod.isServerStreaming: '''«rpcMethod.name.toFirstLower»(request, responseObserver)'''\n        }\n    }\n\n    def requestType(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.request.message.namespace.toLowerCase».I«rpcMethod.request.message.name»'''\n\n    def responseType(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.response.message.namespace.toLowerCase».I«rpcMethod.response.message.name»'''\n\n    def requestTypeImpl(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.request.message.namespace.toLowerCase».«rpcMethod.request.message.name»'''\n\n    def responseTypeImpl(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.response.message.namespace.toLowerCase».«rpcMethod.response.message.name»'''\n\n    def clientMethodImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: clientPointToPointImpl(consumed, consumedService, genConfig)\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: clientBidiStreamingImpl(consumed, consumedService, genConfig)\n            case rpcMethod.isServerStreaming: serverStreamingImpl(consumed, consumedService, genConfig)\n        }\n    }\n\n    def clientPointToPointImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientConverters(rpcMethod, genConfig)»\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return new Promise((resolve, reject) => {\n                this.genericClient.sendRawUnaryRequest(invocationInfo, requestToBinaryConverter(request), {\n                    value: responsePayload => {\n                        resolve(responseFromBinaryConverter(responsePayload));\n                    },\n                    error: (e) => {\n                        reject(e);\n                    }\n                });\n            });\n        '''\n    }\n\n    def clientBidiStreamingImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientConverters(rpcMethod, genConfig)»\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return this.genericClient.sendRawBidirectionalStreamingRequest(\n                invocationInfo,\n                new InvocationObserverConverter(responseObserver, responseFromBinaryConverter))\n                .then(baseClient =>  {\n                    return {\n                        next: (request: «requestType(rpcMethod, genConfig)») => baseClient.next(requestToBinaryConverter(request)),\n                        error: baseClient.error.bind(baseClient),\n                        complete: baseClient.complete.bind(baseClient),\n                        cancel: baseClient.cancel.bind(baseClient)\n                    };\n                });\n        '''\n    }\n\n    def serverStreamingImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientConverters(rpcMethod, genConfig)»\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return this.genericClient.sendRawServerStreamingRequest(\n                invocationInfo,\n                requestToBinaryConverter(request),\n                new InvocationObserverConverter(responseObserver, responseFromBinaryConverter));\n        '''\n    }\n\n    def clientConverters(Method rpcMethod, PlexusGenConfig genConfig) '''\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(«requestTypeImpl(rpcMethod, genConfig)».encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = «responseTypeImpl(rpcMethod, genConfig)».decode(new Uint8Array(from));\n            return «responseTypeImpl(rpcMethod, genConfig)».toObject(decoded);\n        };\n     '''\n\n    def clientInvocationInfo(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            const invocationInfo = {\n                methodId: \"«rpcMethod.name»\",\n                serviceId: \"«rpcMethod.service.fullName»\"«IF consumedService.alias !== null»,\n                serviceAlias: \"«consumedService.alias»\"«ENDIF»\n            };\n        '''\n    }\n\n    def clientHandlerSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''on«rpcMethod.name»(invocationContext, request)'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''on«rpcMethod.name»(invocationContext, hostClient)'''\n            case rpcMethod.isServerStreaming: '''on«rpcMethod.name»(invocationContext, request, hostClient)'''\n        }\n    }\n\n    def genericClientHandlerSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''on«rpcMethod.name»(invocationContext, request)'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''on«rpcMethod.name»(invocationContext, hostClient)'''\n            case rpcMethod.isServerStreaming: '''on«rpcMethod.name»(invocationContext, request, hostClient)'''\n        }\n    }\n\n    def handlerMethodImpl(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: handlerPointToPointImpl(rpcMethod, genConfig)\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: handlerBidiStreamingImpl(rpcMethod, genConfig)\n            case rpcMethod.isServerStreaming: handlerServerStreamingImpl(rpcMethod, genConfig)\n        }\n    }\n\n    def handlerPointToPointImpl(Method rpcMethod, PlexusGenConfig genConfig) '''\n        «handlerConverters(rpcMethod, genConfig)»\n        return this.clientHandler\n            .on«rpcMethod.name»(invocationContext, requestFromBinaryConverter(request))\n            .then(response => responseToBinaryConverter(response));\n    '''\n\n    def handlerBidiStreamingImpl(Method rpcMethod, PlexusGenConfig genConfig) '''\n        «handlerConverters(rpcMethod, genConfig)»\n        const baseObserver = this.clientHandler\n            .on«rpcMethod.name»(invocationContext, {\n                next: (response) => hostClient.next(responseToBinaryConverter(response)),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n        return {\n            next: (value) => baseObserver.next(requestFromBinaryConverter(value)),\n            complete: baseObserver.complete.bind(baseObserver),\n            error: baseObserver.error.bind(baseObserver),\n            streamCompleted: baseObserver.streamCompleted.bind(baseObserver)\n        };\n    '''\n\n    def handlerServerStreamingImpl(Method rpcMethod, PlexusGenConfig genConfig) '''\n        «handlerConverters(rpcMethod, genConfig)»\n        this.clientHandler\n            .on«rpcMethod.name»(invocationContext, requestFromBinaryConverter(request), {\n                next: (response) => hostClient.next(responseToBinaryConverter(response)),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n    '''\n\n    def handlerConverters(Method rpcMethod, PlexusGenConfig genConfig) '''\n        const responseToBinaryConverter = from => Arrays.toArrayBuffer(«responseTypeImpl(rpcMethod, genConfig)».encode(from).finish());\n        const requestFromBinaryConverter = from => {\n            const decoded = «requestTypeImpl(rpcMethod, genConfig)».decode(new Uint8Array(from));\n            return «requestTypeImpl(rpcMethod, genConfig)».toObject(decoded);\n        };\n    '''\n}"
  },
  {
    "path": "dsl/gen/js/src/main/java/com/db/plexus/interop/dsl/gen/js/JsGenTask.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.js;\n\nimport com.db.plexus.interop.dsl.Application;\nimport com.db.plexus.interop.dsl.InteropLangUtils;\nimport com.db.plexus.interop.dsl.gen.BaseGenTask;\nimport com.db.plexus.interop.dsl.gen.GenUtils;\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig;\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils;\nimport com.google.inject.Inject;\nimport org.eclipse.emf.common.util.EList;\nimport org.eclipse.emf.ecore.resource.Resource;\nimport org.eclipse.xtext.resource.XtextResourceSet;\n\nimport javax.inject.Named;\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\n@Named\npublic class JsGenTask extends BaseGenTask {\n\n    public static final String PROTO_JS_COMPILER = \"pbjs\";\n    public static final String PROTO_JS_COMPILER_CMD = \"pbjs.cmd\";\n    public static final String PLEXUS_MESSAGES_MODULES = \"plexus-messages\";\n\n    @Inject\n    private JsComponentApiGenerator codeOutputGenerator;\n\n    @Override\n    protected void doGenWithResources(PlexusGenConfig config, XtextResourceSet rs) throws IOException {\n    \t\n    \tEList<Resource> resources = rs.getResources();\n\n        String pbJsPath = null;\n\n        final String configProtocPath = config.getProtocPath();\n        if (configProtocPath == null || configProtocPath.isEmpty()) {\n            this.logger.info(\"Proto compiler not provided, messages generation will be skipped\");\n        } else if (!configProtocPath.endsWith(PROTO_JS_COMPILER)\n                && !configProtocPath.endsWith(PROTO_JS_COMPILER_CMD)) {\n            this.logger.warning(\"Only pbjs compiler supported, messages generation will be skipped\");\n        } else {\n            pbJsPath = configProtocPath;\n        }\n\n        final List<String> protoFilePaths = resources.stream()\n        \t\t.filter(x -> x.getURI().lastSegment().endsWith(\".proto\"))\n        \t\t.filter(x -> !x.getURI().toString().endsWith(ProtoLangUtils.DESCRIPTOR_RESOURCE_PATH))\n        \t\t.filter(x -> !x.getURI().toString().endsWith(InteropLangUtils.DESCRIPTOR_RESOURCE_PATH))        \t\t\n                .map(resource -> new File(resource.getURI().toFileString()).getAbsolutePath())                \n                .collect(Collectors.toList());\n\n        final String outDirPath = this.getAbsolutePath(config.getOutDir());\n\n        if (protoFilePaths.isEmpty()) {\n            this.logger.warning(\"No proto resources detected\");\n        }\n\n        if (pbJsPath != null) {\n            this.logger.info(\"Using \" + pbJsPath + \" to generate JS messages\");\n            final List<String> pbJsArgs = new ArrayList<>(Arrays.asList(pbJsPath));\n            pbJsArgs.addAll(jsProtoArgs(config, outDirPath));\n            pbJsArgs.addAll(protoFilePaths);\n            final int resultCode = generateMessages(pbJsArgs);\n            if (resultCode == 0) {\n                this.logger.info(\"Generated successfully\");\n            }\n        }\n\n        final List<Application> applications = GenUtils.getApplications(resources.toArray(new Resource[]{}));\n\n        config.setExternalDependencies(Arrays.asList(\"./\" + PLEXUS_MESSAGES_MODULES));\n\n        for (Application application : applications) {\n            this.logger.info(\"Generating JS Client for \" + application.getName());\n            String stringContent = codeOutputGenerator.generate(config, application, resources);\n            this.logger.info(\"Generated successfully\");\n            writeToFile(config.getOutDir() + \"/\" + application.getName() + \"GeneratedClient.js\", stringContent);\n        }\n\n    }\n\n    private List<String> jsProtoArgs(PlexusGenConfig config, String outDirPath) {\n        return Arrays.asList(\n                \"--force-long\",\n                \"-t\", \"static-module\",\n                \"-r\", config.getNamespace(),\n                \"-w\", \"commonjs\",\n                \"-o\", outDirPath + File.separator + PLEXUS_MESSAGES_MODULES + \".js\");\n    }\n}\n"
  },
  {
    "path": "dsl/gen/js/src/test/java/com/db/plexus/interop/dsl/gen/js/tests/JsComponentApiGeneratorTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.js.tests\n\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.gen.js.JsComponentApiGenerator\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport com.google.inject.Inject\nimport java.nio.file.Files\nimport java.nio.file.Paths\nimport java.util.Arrays\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport org.eclipse.xtext.testing.InjectWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport static org.junit.Assert.*\n\n@RunWith(typeof(XtextRunner))\n@InjectWith(typeof(InteropLangInjectionProvider))\nclass JsComponentApiGeneratorTest {\n\t\n    @Inject\n    private XtextResourceSet resourceSet;      \n\n    @Inject\n    JsComponentApiGenerator outputGenerator;\n    \n    @Test\n    def void testFullContentGeneration() {\n\t\t\t\t\t\t\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n\n        val apps = GenUtils.getApplications(resourceSet.getResources())\n\n        var plexusConfig = new PlexusGenConfig();\n        plexusConfig.namespace = \"plexus\"\n        plexusConfig.externalDependencies = Arrays.asList(\"./plexus-messages\")\n\n        val generatedResult = outputGenerator.generate(plexusConfig, apps.get(0), resourceSet.getResources())\n        \n        val expectedURI = ResourceUtils.resolveStandardURI(\"com/db/plexus/interop/dsl/gen/js/tests/expected.data\")\n        val expected = new String(Files.readAllBytes(Paths.get(expectedURI)))       \n\n        assertEqualsIgnoreWhiteSpaces(expected, generatedResult)                    \n    }\n  \n    def assertEqualsIgnoreWhiteSpaces(String s1, String s2) {\n        assertEquals(\"Equals ignoring whitespaces\", s1.replaceAll(\"\\\\s\", \"\"), s2.replaceAll(\"\\\\s\", \"\"))\n    }\n}"
  },
  {
    "path": "dsl/gen/js/src/test/resources/com/db/plexus/interop/dsl/gen/js/tests/expected.data",
    "content": "import { MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from \"@plexus-interop/client\";\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from \"@plexus-interop/client\";\nimport { TransportConnection, UniqueId } from \"@plexus-interop/transport-common\";\nimport { Arrays, Observer } from \"@plexus-interop/common\";\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from \"@plexus-interop/client\";\n\nimport * as plexus from \"./plexus-messages\";\n\n/**\n *  Internal Proxy implementation for ExampleService service\n */\nexport class ExampleServiceProxy {\n\n    constructor(genericClient) {\n        this.genericClient = genericClient;\n    }\n\n    pointToPoint(request) {\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Request.encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Response.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Response.toObject(decoded);\n        };\n        const invocationInfo = {\n            methodId: \"PointToPoint\",\n            serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendRawUnaryRequest(invocationInfo, requestToBinaryConverter(request), {\n                value: responsePayload => {\n                    resolve(responseFromBinaryConverter(responsePayload));\n                },\n                error: (e) => {\n                    reject(e);\n                }\n            });\n        });\n    }\n    \n    serverStreaming(request, responseObserver) {\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Request.encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Response.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Response.toObject(decoded);\n        };\n        const invocationInfo = {\n            methodId: \"ServerStreaming\",\n            serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n        };\n        return this.genericClient.sendRawServerStreamingRequest(\n            invocationInfo,\n            requestToBinaryConverter(request),\n            new InvocationObserverConverter(responseObserver, responseFromBinaryConverter));\n    }\n    \n    clientToServer(responseObserver) {\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Request.encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Response.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Response.toObject(decoded);\n        };\n        const invocationInfo = {\n            methodId: \"ClientToServer\",\n            serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n        };\n        return this.genericClient.sendRawBidirectionalStreamingRequest(\n            invocationInfo,\n            new InvocationObserverConverter(responseObserver, responseFromBinaryConverter))\n            .then(baseClient =>  {\n                return {\n                    next: (request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest) => baseClient.next(requestToBinaryConverter(request)),\n                    error: baseClient.error.bind(baseClient),\n                    complete: baseClient.complete.bind(baseClient),\n                    cancel: baseClient.cancel.bind(baseClient)\n                };\n            });\n    }\n    \n    bidiStreaming(responseObserver) {\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Request.encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Response.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Response.toObject(decoded);\n        };\n        const invocationInfo = {\n            methodId: \"BidiStreaming\",\n            serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n        };\n        return this.genericClient.sendRawBidirectionalStreamingRequest(\n            invocationInfo,\n            new InvocationObserverConverter(responseObserver, responseFromBinaryConverter))\n            .then(baseClient =>  {\n                return {\n                    next: (request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest) => baseClient.next(requestToBinaryConverter(request)),\n                    error: baseClient.error.bind(baseClient),\n                    complete: baseClient.complete.bind(baseClient),\n                    cancel: baseClient.cancel.bind(baseClient)\n                };\n            });\n    }\n\n}\n\n/**\n *  Internal Proxy implementation for NoLaunchExampleService service\n */\nexport class NoLaunchExampleServiceProxy {\n\n    constructor(genericClient) {\n        this.genericClient = genericClient;\n    }\n\n    pointToPoint(request) {\n        const requestToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Request.encode(from).finish());\n        const responseFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Response.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Response.toObject(decoded);\n        };\n        const invocationInfo = {\n            methodId: \"PointToPoint\",\n            serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n            serviceAlias: \"NoLaunchExampleService\"\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendRawUnaryRequest(invocationInfo, requestToBinaryConverter(request), {\n                value: responsePayload => {\n                    resolve(responseFromBinaryConverter(responsePayload));\n                },\n                error: (e) => {\n                    reject(e);\n                }\n            });\n        });\n    }\n\n}\n\n/**\n * Client's API internal implementation\n *\n */\nclass ComponentAClient extends GenericClientApiBase {\n\n    constructor(\n        genericClient,\n        exampleServiceProxy,\n        noLaunchExampleServiceProxy\n    ) {\n        super(genericClient);\n        this.exampleServiceProxy = exampleServiceProxy;\n        this.noLaunchExampleServiceProxy = noLaunchExampleServiceProxy;\n    }\n\n    getExampleServiceProxy() {\n        return this.exampleServiceProxy;\n    }\n    \n    getNoLaunchExampleServiceProxy() {\n        return this.noLaunchExampleServiceProxy;\n    }\n\n}\n\n/**\n * Client invocation handler for ExampleService, to be implemented by Client\n *\n */\nexport class ExampleServiceInvocationHandler {\n\n    onPointToPoint(invocationContext, request) {\n        // TODO implement handler\n    }\n    onServerStreaming(invocationContext, request, hostClient) {\n        // TODO implement handler\n    }\n    onClientToServer(invocationContext, hostClient) {\n        // TODO implement handler\n    }\n    onBidiStreaming(invocationContext, hostClient) {\n        // TODO implement handler\n    }\n}\n\n/**\n * Internal invocation handler delegate for ExampleService\n *\n */\nclass ExampleServiceInvocationHandlerInternal {\n\n    constructor(clientHandler) {\n        this.clientHandler = clientHandler;\n    }\n\n    onPointToPoint(invocationContext, request) {\n        const responseToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Response.encode(from).finish());\n        const requestFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Request.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Request.toObject(decoded);\n        };\n        return this.clientHandler\n            .onPointToPoint(invocationContext, requestFromBinaryConverter(request))\n            .then(response => responseToBinaryConverter(response));\n    }\n    \n    onServerStreaming(invocationContext, request, hostClient) {\n        const responseToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Response.encode(from).finish());\n        const requestFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Request.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Request.toObject(decoded);\n        };\n        this.clientHandler\n            .onServerStreaming(invocationContext, requestFromBinaryConverter(request), {\n                next: (response) => hostClient.next(responseToBinaryConverter(response)),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n    }\n    \n    onClientToServer(invocationContext, hostClient) {\n        const responseToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Response.encode(from).finish());\n        const requestFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Request.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Request.toObject(decoded);\n        };\n        const baseObserver = this.clientHandler\n            .onClientToServer(invocationContext, {\n                next: (response) => hostClient.next(responseToBinaryConverter(response)),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n        return {\n            next: (value) => baseObserver.next(requestFromBinaryConverter(value)),\n            complete: baseObserver.complete.bind(baseObserver),\n            error: baseObserver.error.bind(baseObserver),\n            streamCompleted: baseObserver.streamCompleted.bind(baseObserver)\n        };\n    }\n    \n    onBidiStreaming(invocationContext, hostClient) {\n        const responseToBinaryConverter = from => Arrays.toArrayBuffer(plexus.com.db.plexus.interop.dsl.gen.test.model.Response.encode(from).finish());\n        const requestFromBinaryConverter = from => {\n            const decoded = plexus.com.db.plexus.interop.dsl.gen.test.model.Request.decode(new Uint8Array(from));\n            return plexus.com.db.plexus.interop.dsl.gen.test.model.Request.toObject(decoded);\n        };\n        const baseObserver = this.clientHandler\n            .onBidiStreaming(invocationContext, {\n                next: (response) => hostClient.next(responseToBinaryConverter(response)),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n        return {\n            next: (value) => baseObserver.next(requestFromBinaryConverter(value)),\n            complete: baseObserver.complete.bind(baseObserver),\n            error: baseObserver.error.bind(baseObserver),\n            streamCompleted: baseObserver.streamCompleted.bind(baseObserver)\n        };\n    }\n}\n\n/**\n * Client API builder\n *\n */\nexport class ComponentAClientBuilder {\n\n    withClientDetails(clientId) {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    withAppInstanceId(appInstanceId) {\n        this.clientDetails = this.clientDetails || {};\n        this.clientDetails.applicationInstanceId = appInstanceId;\n        return this;\n    }\n\n    withAppId(appId) {\n        this.clientDetails = this.clientDetails || {};\n        this.clientDetails.applicationId = appId;\n        return this;\n    }\n\n    withExampleServiceInvocationsHandler(invocationsHandler) {\n        this.exampleServiceHandler = new ExampleServiceInvocationHandlerInternal(invocationsHandler);\n        return this;\n    }\n\n    withTransportConnectionProvider(provider) {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    connect() {\n        return new ContainerAwareClientAPIBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            .withUnaryInvocationHandler({\n                serviceInfo: {\n                    serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n                },\n                handler: {\n                    methodId: \"PointToPoint\",\n                    handle: this.exampleServiceHandler.onPointToPoint.bind(this.exampleServiceHandler)\n                }\n            })\n            .withServerStreamingInvocationHandler({\n                serviceInfo: {\n                    serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n                },\n                handler: {\n                    methodId: \"ServerStreaming\",\n                    handle: this.exampleServiceHandler.onServerStreaming.bind(this.exampleServiceHandler)\n                }\n            })\n            .withBidiStreamingInvocationHandler({\n                serviceInfo: {\n                    serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n                },\n                handler: {\n                    methodId: \"ClientToServer\",\n                    handle: this.exampleServiceHandler.onClientToServer.bind(this.exampleServiceHandler)\n                }\n            })\n            .withBidiStreamingInvocationHandler({\n                serviceInfo: {\n                    serviceId: \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\"\n                },\n                handler: {\n                    methodId: \"BidiStreaming\",\n                    handle: this.exampleServiceHandler.onBidiStreaming.bind(this.exampleServiceHandler)\n                }\n            })\n            .connect()\n            .then(genericClient => new ComponentAClientImpl(\n                genericClient,\n                new ExampleServiceProxyImpl(genericClient),\n                                new NoLaunchExampleServiceProxyImpl(genericClient)\n                ));\n    }\n}\n"
  },
  {
    "path": "dsl/gen/meta/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:gen:common')\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/gen/meta/ListMetadataFilesTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.meta\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport java.io.IOException\nimport com.db.plexus.interop.dsl.gen.util.FileUtils\nimport java.io.File\nimport javax.inject.Named\n\n@Named\nclass ListMetadataFilesTask extends BaseGenTask {\n\n    override doGenWithResources(PlexusGenConfig config, XtextResourceSet rs) throws IOException {\n\n        val loadedResourcesString = rs.resources\n            .map[resource | resource.getURI.toFileString]\n            .filterNull\n            .sort\n            .join(System.lineSeparator)\n\n        if (config.outFile !== null && !config.outFile.isEmpty()) {\n            val file = new File(config.outFile)\n            println(\"Saving metadata files list to: \" + file.absolutePath)\n            FileUtils.writeStringToFile(file, loadedResourcesString)\n        } else {\n            println(loadedResourcesString)\n        }\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/gen/meta/MetaJsonGenTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.meta\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport java.io.IOException\nimport com.google.inject.Inject\nimport com.db.plexus.interop.dsl.gen.util.FileUtils\nimport java.io.File\nimport java.util.Arrays\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport static com.db.plexus.interop.dsl.gen.util.ProcessUtils.*\n\nclass MetaJsonGenTask extends BaseGenTask {\n\n    @Inject\n    MetaJsonGenerator generator\n\n    override doGenWithResources(PlexusGenConfig config, XtextResourceSet rs) throws IOException {\n        val resources = rs.getResources()\n        val protoFilePaths = getProtoFilePaths(resources, config)\n        val protoFilesGlob = FileUtils.commonPath(protoFilePaths) + \"**\" + File.separator + \"*.proto\";\n        var messagesJson = \"[]\";\n        if(!protoFilePaths.isEmpty() && config.getProtocPath() !== null) {\n            val pbJsArgs = newArrayList(config.getProtocPath());\n            pbJsArgs.addAll(this.protoArgs())\n            pbJsArgs.add(protoFilesGlob);\n            this.logger.info(String.format(\"Running ProtoJS compiler with args [%s]\", String.join(\" \", pbJsArgs)));\n            val result = execSync(pbJsArgs);\n            if(result.code !=  0) {\n                this.logger.severe(\"ProtoJS compiler has returned non-zero result code: \" + result.code);\n                this.logger.severe(\"ProtoJS compiler output:\" + result.stdout);\n                System.exit(1);\n            } else {\n                messagesJson = result.stdout;\n            }\n        }\n        config.setMessagesMetadata(messagesJson);\n        val str = generator.generate(config, rs)\n        FileUtils.writeStringToFile(new File(config.outDir + \"/interop.json\"), str)\n    }\n\n    override inputFilesGlob(PlexusGenConfig config) {\n        \"*.interop\"\n    }\n\n    def protoArgs() {\n        return Arrays.asList(\"-t\", \"json\");\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/gen/meta/MetaJsonGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.meta\n\nimport com.db.plexus.interop.dsl.gen.CodeOutputGenerator\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport org.eclipse.emf.ecore.resource.Resource\nimport com.google.inject.Inject\nimport org.eclipse.emf.ecore.EObject\nimport java.util.List\nimport static extension com.db.plexus.interop.dsl.gen.GenUtils.*\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.db.plexus.interop.dsl.protobuf.Option\n\nclass MetaJsonGenerator extends CodeOutputGenerator {\n\t\t\n\t@Inject\n\tGenUtils utils\n\t\n\tdef fullName(EObject obj) {\n\t\treturn utils.getFullName(obj)\n\t}\n\t\n\tdef generateOptionsField(List<Option> options) {\n\t\t'''\n\t\t\"options\": [\n\t\t\t«FOR option : options SEPARATOR ','»\n\t\t\t{\n\t\t\t\t\"id\": \"«option.descriptor.fullName»\",\n\t\t\t\t\"value\": \"«option.valueAsString»\"\n\t\t\t}\n\t\t\t«ENDFOR»\n\t\t]\n\t\t'''\n\t}\n\t\n    protected override def generate(PlexusGenConfig genConfig, List<Resource> resources) {\n        println(\"Generating interop meta JSON\")\n        '''\n\t\t{\n\t\t\t\"messages\": «genConfig.messagesMetadata»,\n\t\t\t\"services\": [\n\t\t\t\t«FOR service : resources.services SEPARATOR ','»\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"«service.fullName»\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t«FOR method: service.methods SEPARATOR ','»\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"«method.name»\",\n\t\t\t\t\t\t\t\"request\": \"«method.request.message.fullName»\",\n\t\t\t\t\t\t\t\"response\": \"«method.response.message.fullName»\",\n\t\t\t\t\t\t\t\"type\": \"«method.type»\"«IF method.optionList.length > 0»,\n\t\t\t\t\t\t\t«generateOptionsField(method.optionList)»«ENDIF»\n\t\t\t\t\t\t}\n        \t\t\t\t«ENDFOR»\n\t\t\t\t\t]«IF service.optionList.length > 0»,\n\t\t\t\t\t«generateOptionsField(service.optionList)»«ENDIF»\n\t\t\t\t}\n\t\t\t\t«ENDFOR»\n\t\t\t],\n\t\t\t\"applications\": [\n\t\t\t\t«FOR application : resources.applications SEPARATOR ','»\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"«application.fullName»\"«IF application.optionList.length > 0»,\n\t\t\t\t\t«generateOptionsField(application.optionList)»«ENDIF»«IF application.consumedServices.length > 0»,\n\t\t\t\t\t\"consumes\": [\n\t\t\t\t\t\t«FOR consumedService : application.consumedServices SEPARATOR ','»        \t\t\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"service\": \"«consumedService.service.fullName»\",\n\t\t\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t\t\t«FOR consumedMethod : consumedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"«consumedMethod.method.name»\"«IF consumedMethod.optionList.length > 0»,\n\t\t\t\t\t\t\t\t\t«generateOptionsField(consumedMethod.optionList)»«ENDIF»\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\t]«IF consumedService.alias !== null»,\n\t\t\t\t\t\t\t\"alias\": \"«consumedService.alias»\"«ENDIF»«IF consumedService.wildcards.length > 0»,\n\t\t\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\t\t«FOR restriction : consumedService.wildcards SEPARATOR ','»\n\t\t\t\t\t\t\t\t\t\"«restriction»\"\n        \t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\t]«ENDIF»«IF consumedService.optionList.length > 0»,\n\t\t\t\t\t\t\t«generateOptionsField(consumedService.optionList)»«ENDIF»\n\t\t\t\t\t\t}\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t]«ENDIF»«IF application.providedServices.length > 0»,\n\t\t\t\t\t\"provides\": [\n\t\t\t\t\t\t«FOR providedService : application.providedServices SEPARATOR ','»\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"service\": \"«providedService.service.fullName»\",\n\t\t\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t\t\t«FOR providedMethod : providedService.methods SEPARATOR ','»\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"«providedMethod.method.name»\"«IF providedMethod.optionList.length > 0»,\n\t\t\t\t\t\t\t\t\t«generateOptionsField(providedMethod.optionList)»«ENDIF»\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\t]«IF providedService.alias !== null»,\n\t\t\t\t\t\t\t\"alias\": \"«providedService.alias»\"«ENDIF»«IF providedService.wildcards.length > 0»,\n\t\t\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\t\t«FOR restriction : providedService.wildcards SEPARATOR ','»\n\t\t\t\t\t\t\t\t\"«restriction»\"\n\t\t\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t\t\t]«ENDIF»«IF providedService.optionList.length > 0»,\n\t\t\t\t\t\t\t«generateOptionsField(providedService.optionList)»«ENDIF»\n\t\t\t\t\t\t}\n\t\t\t\t\t\t«ENDFOR»\n\t\t\t\t\t]«ENDIF»\n\t\t\t\t}\n\t\t\t\t«ENDFOR»\n\t\t\t]\n\t\t}\n\t\t'''\n    }\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/gen/meta/MetaPatchValidatorTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.meta\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\nimport com.db.plexus.interop.dsl.validation.MetadataPatchValidator\nimport com.google.inject.Inject\n\nclass MetaPatchValidatorTask extends BaseGenTask {\n\n    public static val NAME = \"validate-patch\"\n\n    @Inject\n    var MetadataPatchValidator metadataPatchValidator\n\n    override doGen(PlexusGenConfig config) {\n\n        val workingDirUri = getWorkingDir()\n        val sourceBaseDir = getRelativeURI(config.baseDir, workingDirUri)\n        val targetBaseDir = getRelativeURI(config.targetBaseDir, workingDirUri)\n\n        val sourceResourceSet = new XtextResourceSet\n        val targetResourceSet = new XtextResourceSet\n\n        loadResources(sourceResourceSet, sourceBaseDir, config.isVerbose, \"*.{proto,interop}\");\n        loadResources(targetResourceSet, targetBaseDir, config.isVerbose, \"*.{proto,interop}\");\n\n        val issues = metadataPatchValidator.validatePatch(targetResourceSet, sourceResourceSet)\n        if (!issues.empty) {\n            if(config.isVerbose()) {\n                val issuesString = issuesToString(issues.sortWith(issuesComparator));\n                println(issuesString)\n            }\n            if (hasErrors(issues)) {\n                System.exit(1);\n            }\n        }\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/gen/meta/MetaValidatorTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.meta\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport java.io.IOException\nimport com.db.plexus.interop.dsl.gen.util.FileUtils\nimport java.io.File\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass MetaValidatorTask extends BaseGenTask {\n\n    override doGenWithResources(PlexusGenConfig config, XtextResourceSet rs) throws IOException {\n        val issues = validator.getValidationIssues(rs)\n        if(!issues.empty) {\n            val issuesString = issuesToString(issues.sortWith(issuesComparator));\n            if(config.isVerbose() || config.getOutFile() === null) {\n                println(issuesString)\n            }\n            if(config.outFile !== null) {\n                FileUtils.writeStringToFile(new File(config.outFile), issuesString)\n            }\n            if(hasErrors(issues)) {\n                System.exit(1);\n            }\n        }\n    }\n\n    override validateResources(PlexusGenConfig config, XtextResourceSet resourceSet) {\n        // skip default validation\n    }\n\n    override inputFilesGlob(PlexusGenConfig config) {\n        \"*.interop\"\n    }\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/Issues.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation\n\nimport org.eclipse.xtext.diagnostics.Severity\nimport org.eclipse.xtext.validation.Issue;\nimport java.util.Comparator\nimport java.util.List\nimport java.util.stream.Collectors\n\npublic class Issues {\n\n    def static Issue createError(String message, String code) {\n        val issue = new Issue.IssueImpl();\n        issue.setCode(code)\n        issue.setMessage(message)\n        issue.setSeverity(Severity.ERROR)\n        return issue\n    }\n\n    def static Comparator<Issue> issuesComparator() {\n        new IssuesComparator()\n    }\n\n    def static issuesToString(List<Issue> issues) {\n        if(issues.isEmpty) {\n            return successStringResult()\n        }\n        val errorsBuilder = new StringBuilder()\n        issues.fold(errorsBuilder) [builder, issue | builder.append(issueToString(issue)).append(\"\\n\")]\n        return errorsBuilder.toString()\n    }\n\n    def static issueToString(Issue issue) {\n        val result = new StringBuilder(issue.severity.name());\n        result.append(\": \").append(issue.getMessage());\n        result.append(\" [\");\n        if(issue.getUriToProblem() !== null) {\n            result.append(issue.getUriToProblem().trimFragment());\n        }\n        if(issue.lineNumber !== null || issue.column !== null) {\n            result.append(\" line : \")\n            .append(issue.lineNumber).append(\" column : \").append(issue.column);\n        }\n        return result.append(\"]\").toString();\n    }\n\n    def static boolean hasErrors(List<Issue> issues) {\n        return !issues.stream()\n        .filter[issue | issue.getSeverity() == Severity.ERROR]\n        .collect(Collectors.toList)\n        .isEmpty\n    }\n\n    def static successStringResult() { \"No issues found\" }\n\n}\n\nclass IssuesComparator implements Comparator<Issue> {\n    override int compare (Issue function1, Issue function2) {\n        if(function1.getSeverity() == function2.getSeverity()) {\n            return 0;\n        } else {\n            return if(function1.getSeverity() == Severity.ERROR) 1 else -1;\n        }\n    }\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/MetadataPatchValidator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.validation.rules.UpdateRule\nimport com.google.inject.Inject\nimport java.util.Set\nimport org.eclipse.xtext.EcoreUtil2\nimport java.util.stream.Collectors\nimport org.eclipse.xtext.validation.Issue\nimport java.util.List\n\nclass MetadataPatchValidator {\n\n    val Set<UpdateRule> updateRules;\n\n    @Inject\n    new (Set<UpdateRule> rules) {\n        this.updateRules = rules;\n    }\n\n    def List<Issue> validatePatch(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        EcoreUtil2.resolveAll(baseResourceSet)\n        EcoreUtil2.resolveAll(updatedResourceSet)\n        updateRules\n        .stream()\n        .flatMap[rule | rule.validate(baseResourceSet, updatedResourceSet).stream()]\n        .collect(Collectors.toList)\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoAppsDeletedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass NoAppsDeletedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''app-deleted'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseElements = genUtils.getApplicationsMap(baseResourceSet.resources);\n        val updatedIds = genUtils.getApplicationsMap(updatedResourceSet.resources).keySet;\n        return baseElements.keySet\n        .filter[id | !updatedIds.contains(id)]\n        .map([id | createError('''Application «id» is deleted''', getCode)])\n        .toList()\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoFieldsChangedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.PrimitiveFieldType\nimport com.db.plexus.interop.dsl.protobuf.ComplexFieldType\n\nclass NoFieldsChangedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''message-field-updated'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseFields = genUtils.getFieldsMap(baseResourceSet.resources)\n        val updatedFields = genUtils.getFieldsMap(updatedResourceSet.resources)\n        val updatedFieldIds = updatedFields.keySet;\n        return baseFields.entrySet\n        .filter[fieldEntry | updatedFieldIds.contains(fieldEntry.key)]\n        .filter[fieldEntry | !fieldsEqual(fieldEntry.value, updatedFields.get(fieldEntry.key))]\n        .map([fieldEntry | createError('''Message field «fieldEntry.key» updated''', getCode)])\n        .toList()\n    }\n\n    def fieldsEqual(Field first, Field second) {\n        if (!first.number.equals(second.number)) {\n            return false\n        }\n        val labelsEqual = (first.label === null && second.label === null)\n            || (first.label.equals(second.label));\n        if (!labelsEqual) {\n            return false\n        }\n        val firstType = first.typeReference\n        val secondType = second.typeReference\n        if (!firstType.class.equals(secondType.class)) {\n            return false\n        }\n        switch (firstType) {\n            PrimitiveFieldType: return firstType.value.equals((secondType as PrimitiveFieldType).value),\n            ComplexFieldType: return complexTypesEqual(firstType, secondType as ComplexFieldType)\n        }\n    }\n\n    def complexTypesEqual(ComplexFieldType first, ComplexFieldType second) {\n        if (!first.class.equals(second.class)) {\n            return false;\n        }\n        return genUtils.getFullName(first.value)\n                .equals(genUtils.getFullName(second.value));\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoFieldsDeletedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass NoFieldsDeletedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''message-field-deleted'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseFields = genUtils.getFieldsMap(baseResourceSet.resources)\n        val updatedFieldIds = genUtils.getFieldsMap(updatedResourceSet.resources).keySet\n        return baseFields.keySet\n        .filter[id | !updatedFieldIds.contains(id)]\n        .map[id | createError('''Message field «id» is deleted''', getCode)]\n        .toList()\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoMessagesDeletedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass NoMessagesDeletedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''message-deleted'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseMessages = genUtils.getMessagesMap(baseResourceSet.resources);\n        val updatedIds = genUtils.getMessagesMap(updatedResourceSet.resources).keySet;\n        return baseMessages.keySet\n        .filter[id | !updatedIds.contains(id)]\n        .map([id | createError('''Message «id» is deleted''', getCode)])\n        .toList()\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoMethodTypesChangedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\nimport com.db.plexus.interop.dsl.protobuf.Method\n\nclass NoMethodTypesChangedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''service-method-updated'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseMethods = genUtils.getServiceMethodsMap(baseResourceSet.resources);\n        val updatedMethods = genUtils.getServiceMethodsMap(updatedResourceSet.resources);\n        val updatedIds = updatedMethods.keySet;\n        return baseMethods.entrySet\n        .filter[methodEntry | updatedIds.contains(methodEntry.key)]\n        .filter(baseMethodEntry | !methodsEqual(baseMethodEntry.value, updatedMethods.get(baseMethodEntry.key)))\n        .map([methodEntry | createError('''Service Method «methodEntry.key» is updated''', getCode)])\n        .toList()\n    }\n\n    def methodsEqual(Method first, Method second) {\n\n        if(!genUtils.getFullName(first.request.message)\n        .equals(genUtils.getFullName(second.request.message))) {\n            return false;\n        }\n\n        if(!first.request.isStream.equals(second.request.isStream)) {\n            return false;\n        }\n\n        if(!genUtils.getFullName(first.response.message)\n        .equals(genUtils.getFullName(second.response.message))) {\n            return false;\n        }\n\n        if(!first.response.isStream.equals(second.response.isStream)) {\n            return false;\n        }\n\n        return true;\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoMethodsDeletedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass NoMethodsDeletedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''service-method-deleted'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseMethods = genUtils.getServiceMethodsMap(baseResourceSet.resources);\n        val updatedIds = genUtils.getServiceMethodsMap(updatedResourceSet.resources).keySet;\n        return baseMethods.keySet\n        .filter[id | !updatedIds.contains(id)]\n        .map([id | createError('''Service Method «id» is deleted''', getCode)])\n        .toList()\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/NoServiceDeletedRule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.google.inject.Inject\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\nclass NoServicesDeletedRule implements UpdateRule {\n\n    val GenUtils genUtils;\n\n    @Inject\n    new(GenUtils genUtils) {\n        this.genUtils = genUtils;\n    }\n\n    override getCode() '''service-deleted'''\n\n    override validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet) {\n        val baseServices = genUtils.getServicesMap(baseResourceSet.resources);\n        val updatedIds = genUtils.getServicesMap(updatedResourceSet.resources).keySet;\n        return baseServices.keySet\n        .filter[id | !updatedIds.contains(id)]\n        .map([id | createError('''Service «id» is deleted''', getCode)])\n        .toList()\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/RulesModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport com.google.inject.AbstractModule\nimport com.google.inject.multibindings.Multibinder\n\nclass RulesModule extends AbstractModule {\n\n    override def configure() {\n        val rulesBinder = Multibinder.newSetBinder(binder(), typeof(UpdateRule));\n        rulesBinder.addBinding().to(typeof(NoFieldsChangedRule))\n        rulesBinder.addBinding().to(typeof(NoFieldsDeletedRule))\n        rulesBinder.addBinding().to(typeof(NoMessagesDeletedRule))\n        rulesBinder.addBinding().to(typeof(NoMethodsDeletedRule))\n        rulesBinder.addBinding().to(typeof(NoMethodTypesChangedRule))\n        rulesBinder.addBinding().to(typeof(NoServicesDeletedRule))\n        rulesBinder.addBinding().to(typeof(NoAppsDeletedRule))\n    }\n}"
  },
  {
    "path": "dsl/gen/meta/src/main/java/com/db/plexus/interop/dsl/validation/rules/UpdateRule.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules;\n\nimport org.eclipse.xtext.resource.XtextResourceSet;\nimport org.eclipse.xtext.validation.Issue;\n\nimport java.util.List;\n\n/**\n * Checks incremental full metadata update\n */\npublic interface UpdateRule {\n\n    String getCode();\n\n    List<Issue> validate(XtextResourceSet baseResourceSet, XtextResourceSet updatedResourceSet);\n\n}\n"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/gen/metadata/tests/MetaJsonGeneratorTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.metadata.tests\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.gen.ResourceSetValidator\nimport com.db.plexus.interop.dsl.gen.meta.MetaJsonGenerator\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport com.google.inject.Inject\nimport java.nio.file.Files\nimport java.nio.file.Paths\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport org.eclipse.xtext.testing.InjectWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport static org.junit.Assert.*\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass MetaJsonGeneratorTest {\n\n    @Inject\n    private XtextResourceSet resourceSet;\n    \n    @Inject\n    private ResourceSetValidator validator;\n\n    @Inject\n    private MetaJsonGenerator outputGenerator;\n            \n    @Test\n    def testFullContentGeneration() {\n        \t    \n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n        \n        validator.validateResources(resourceSet)\n\n        val expected = new String(Files.readAllBytes(Paths.get(ResourceUtils.resolveStandardURI(\"com/db/plexus/interop/dsl/gen/metadata/tests/expected.json\"))));\n\n        val genConfig = new PlexusGenConfig();\n        genConfig.setMessagesMetadata(\"[]\");\n        val generatedResult = outputGenerator.generate(genConfig, resourceSet)\n\n        assertEqualsIgnoreWhiteSpaces(expected, generatedResult)\n    }\n\n    def assertEqualsIgnoreWhiteSpaces(String s1, String s2) {\n        assertEquals(\"Equals ignoring whitespaces\", s1.replaceAll(\"\\\\s\", \"\"), s2.replaceAll(\"\\\\s\", \"\"))\n    }\n}\n"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/gen/metadata/tests/MetaValidatorTaskTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.metadata.tests\n\nimport com.db.plexus.interop.dsl.gen.ResourceSetValidator\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport com.google.inject.Inject\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport org.eclipse.xtext.testing.InjectWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport static org.hamcrest.CoreMatchers.*;\n\nimport static org.junit.Assert.*\nimport static com.db.plexus.interop.dsl.validation.Issues.*;\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass MetaValidatorTaskTest {\n\n    @Inject\n    protected ResourceSetValidator validator;\n\n    @Test\n    def testValidMetadata() {\n\n        val resourceSet = new XtextResourceSet()\n\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n\n        val stringResult = issuesToString(validator.getValidationIssues(resourceSet))\n\n        assertEquals(successStringResult(), stringResult)\n    }\n\n    @Test\n    def testInvalidMetadata() {\n\n        val resourceSet = new XtextResourceSet()\n\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a_invalid.interop\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n\n        val stringResult = issuesToString(validator.getValidationIssues(resourceSet))\n\n        assertThat(stringResult, containsString(\"ERROR: Couldn't resolve reference to Service 'com.db.plexus.interop.dsl.gen.test.services.ExampleService_NotExists\"));\n        assertThat(stringResult, containsString(\"ERROR: Couldn't resolve reference to Method 'PointToPoint'\"));\n\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/BaseRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\n\nclass BaseRuleTest {\n\n    def testFalsePositive(UpdateRule rule) {\n        val resourceSet = new XtextResourceSet()\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        EcoreUtil2.resolveAll(resourceSet)\n        val issues = rule.validate(resourceSet, resourceSet);\n        assertThat(issues, hasSize(0))\n    }\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoAppsDeletedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoAppsDeletedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoAppsDeletedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(1))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"Application\"))\n        assertThat(issue.getMessage(), containsString(\"is deleted\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoFieldsChangedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoFieldsChangedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoFieldsChangedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/updated_message_fields.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(4))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"_field updated\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoFieldsDeletedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoFieldsDeletedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoFieldsDeletedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/missed_message_field.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(1))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"sint\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoMessagesDeletedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoMessagesDeletedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoMessagesDeletedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/missed_message.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(1))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"Response\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoMethodTypesChangedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoMethodTypesChangedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoMethodTypesChangedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/updated_service_methods.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(4))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"is updated\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoMethodsDeletedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoMethodsDeletedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoMethodsDeletedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/deleted_service_method.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(1))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"PointToPoint is deleted\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/java/com/db/plexus/interop/dsl/validation/rules/NoServiceDeletedRuleTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.validation.rules\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.google.inject.Inject\nimport org.junit.Test\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass NoServicesDeletedRuleTest extends BaseRuleTest {\n\n    @Inject\n    var NoServicesDeletedRule rule\n\n    @Test\n    def testFalsePositive() {\n        super.testFalsePositive(this.rule)\n    }\n\n    @Test\n    def testNegative() {\n\n        val baseResource = new XtextResourceSet()\n        baseResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        EcoreUtil2.resolveAll(baseResource)\n\n        val updatedResource = new XtextResourceSet()\n        updatedResource.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/deleted_service.proto\"), true)\n        EcoreUtil2.resolveAll(updatedResource)\n\n        val issues = rule.validate(baseResource, updatedResource)\n        assertThat(issues, hasSize(1))\n\n        val issue = issues.get(0)\n        assertThat(issue.getCode(), is(equalTo(rule.getCode())))\n        assertThat(issue.getMessage(), containsString(\"deleted\"))\n        assertThat(issue.getSeverity(), is(equalTo(Severity.ERROR)))\n\n    }\n\n}"
  },
  {
    "path": "dsl/gen/meta/src/test/resources/com/db/plexus/interop/dsl/gen/metadata/tests/expected.json",
    "content": "{\n\t\"messages\": [],\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"PointToPoint\",\n\t\t\t\t\t\"request\": \"com.db.plexus.interop.dsl.gen.test.model.Request\",\n\t\t\t\t\t\"response\": \"com.db.plexus.interop.dsl.gen.test.model.Response\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"com.db.plexus.interop.dsl.gen.test.model.Request\",\n\t\t\t\t\t\"response\": \"com.db.plexus.interop.dsl.gen.test.model.Response\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientToServer\",\n\t\t\t\t\t\"request\": \"com.db.plexus.interop.dsl.gen.test.model.Request\",\n\t\t\t\t\t\"response\": \"com.db.plexus.interop.dsl.gen.test.model.Response\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"BidiStreaming\",\n\t\t\t\t\t\"request\": \"com.db.plexus.interop.dsl.gen.test.model.Request\",\n\t\t\t\t\t\"response\": \"com.db.plexus.interop.dsl.gen.test.model.Response\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.samples.ExampleService\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"com.db.plexus.interop.dsl.gen.test.model.service_option_bool\",\n\t\t\t\t\t\"value\": \"true\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"com.db.plexus.interop.dsl.gen.test.components.ComponentA\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"PointToPoint\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"com.db.plexus.interop.dsl.gen.test.model.consumed_method_option_enum\",\n\t\t\t\t\t\t\t\t\t\"value\": \"VALUE2\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientToServer\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"BidiStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"PointToPoint\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"alias\": \"NoLaunchExampleService\",\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"com.db.plexus.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"PointToPoint\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.launch_on_call\",\n\t\t\t\t\t\t\t\t\t\"value\": \"ALWAYS\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Point-to-point\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientToServer\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"BidiStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.launch_on_call\",\n\t\t\t\t\t\t\t\t\t\"value\": \"DISABLED\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"com.db.plexus.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"com.db.plexus.interop.dsl.gen.test.components.ComponentC\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"com.db.plexus.interop.dsl.gen.test.services.ExampleService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"PointToPoint\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientToServer\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"BidiStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"com.db.plexus.*\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Example Service\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "dsl/gen/proto/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:gen:common')\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/proto/src/main/java/com/db/plexus/interop/dsl/gen/proto/ProtoGenTask.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.proto\n\nimport com.db.plexus.interop.dsl.gen.BaseGenTask\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.Import\nimport com.db.plexus.interop.dsl.protobuf.Message\nimport com.db.plexus.interop.dsl.protobuf.NamedElement\nimport com.db.plexus.interop.dsl.protobuf.Option\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\nimport com.db.plexus.interop.dsl.protobuf.ProtobufFactory\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.db.plexus.interop.dsl.protobuf.Service\nimport com.google.inject.Inject\nimport java.io.File\nimport java.io.FileOutputStream\nimport java.io.IOException\nimport java.util.Collections\nimport java.util.LinkedList\nimport org.eclipse.emf.common.util.URI\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.diagnostics.Severity\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport org.eclipse.xtext.util.CancelIndicator\nimport org.eclipse.xtext.validation.CheckMode\nimport org.eclipse.xtext.validation.IResourceValidator\nimport org.eclipse.xtext.validation.Issue\nimport org.eclipse.xtext.naming.QualifiedName\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils\n\npublic class ProtoGenTask extends BaseGenTask {\n\t\n\tprivate static final QualifiedName CSHARP_NAMESPACE_OPTION_DESCRIPTOR_NAME = \n\t\tQualifiedName.create(\"\", \"google\", \"protobuf\", \"FileOptions\", \"csharp_namespace\")\n\t\t\n\t@Inject\n\tProtoLangUtils utils\n\t\n\t\n\t@Inject\n\tIResourceValidator validator\n\n\t@Inject\n\tIQualifiedNameProvider qualifiedNameProvider\n\t\t\n\t@Inject\n\tProtoLangImportResolver importResolver \n\n\toverride public validateResources(PlexusGenConfig config, XtextResourceSet resourceSet) {\n\t\tsuper.validateResources(config, resourceSet);\n\t\tthis.validateInteropResourceLoaded(config, resourceSet);\n\t}\n\n\toverride protected doGenWithResources(PlexusGenConfig config, XtextResourceSet rs) throws IOException {\n\n\t\tlogger.info(\"Generating proto contract for \" + config.input + \" to folder \" + config.outDir)\n\n\t\tval optionsUri = URI.createURI(\n\t\t\tClassLoader.getSystemClassLoader().getResource(GenUtils.INTEROP_OPTIONS_RESOURCE_PATH).toURI().toString())\n\t\t\t\n\t\tval descriptorUri = URI.createURI(\n\t\t\tClassLoader.getSystemClassLoader().getResource(GenUtils.PROTOBUF_DESCRIPTOR_RESOURCE_PATH).toURI().toString())\t\t\n\t\t\t\n\t\tvar interopResourceBaseUri = optionsUri.trimSegments(2).appendSegment(\"\");\n\t\tvar protoResourceBaseUri = descriptorUri.trimSegments(3).appendSegment(\"\");\n\t\t\n\t\tif (rs.resources.findFirst[r|r.URI.toString().endsWith(GenUtils.INTEROP_OPTIONS_RESOURCE_PATH)] === null) {\n\t\t\trs.getResource(optionsUri, true)\n\t\t}\n\n\t\tEcoreUtil2.resolveAll(rs)\n\n\t\tval allIssues = new LinkedList<Issue>()\n\t\tfor (resource : rs.resources) {\n\t\t\tlogger.info(\"Loaded resource: \" + resource.URI)\n\t\t\tval issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl)\n\t\t\tallIssues.addAll(issues)\n\t\t}\n\t\tvar errors = allIssues.filter[x|x.severity == Severity.ERROR].toList()\n\t\tvar otherIssues = allIssues.filter[x|x.severity != Severity.ERROR]\n\t\tfor (issue : otherIssues) {\n\t\t\tlogger.warning(issue.toString)\n\t\t}\n\t\tif (errors.length > 0) {\n\t\t\tfor (issue : errors) {\n\t\t\t\tlogger.severe(issue.toString)\t\t\t\t\n\t\t\t}\n\t\t\tthrow new IOException(\"Errors found in the loaded resources\")\n\t\t}\n\t\t\n\t\tvar namespace = config.namespace;\t\t\n\t\tif (namespace === null) {\n\t\t\tnamespace = \"\"\t\t\t\n\t\t}\n\t\tvar namespaceIsPrefix = false\n\t\tif (namespace.startsWith(\"internal_access:\")) {\n\t\t\tnamespace = namespace.substring(\"internal_access:\".length)\n\t\t}\n\t\tif (namespace.endsWith(\"*\")) {\n\t\t\tnamespaceIsPrefix = true\n\t\t\tnamespace = namespace.substring(0, namespace.length-1)\n\t\t}\n\t\t\n\t\tval description = utils.getDescriptorResourceDescription(rs)\n\t\tval csharpNamespaceOptionDescriptor = description.getExportedObjects(\n\t\t\tProtobufPackage.Literals.FIELD, \n\t\t\tCSHARP_NAMESPACE_OPTION_DESCRIPTOR_NAME, \n\t\t\tfalse\n\t\t\t).findFirst[x | true].EObjectOrProxy as Field\n\t\t\t\t\n\t\tval oldResources = new LinkedList<Resource>\n\t\toldResources.addAll(rs.resources)\n\t\t\n\t\tval optionsResourceDescription = importResolver.resolveResourceDescription(rs, GenUtils.INTEROP_OPTIONS_RESOURCE_PATH)\n\n\t\tfor (r : oldResources) {\n\t\t\n\t\t\t\t\t\t\n\t\t\tval serviceIdOptionDescriptor = \n\t\t\t\toptionsResourceDescription\n\t\t\t\t\t.getExportedObjects(ProtobufPackage.Literals.FIELD, GenUtils.INTEROP_SERVICE_ID_OPTION_NAME, false)\n\t\t\t\t\t.findFirst[x|x.name.equals(GenUtils.INTEROP_SERVICE_ID_OPTION_NAME)].EObjectOrProxy as Field\n\t\t\t\t\t\n\t\t\tval messageIdOptionDescriptor = \n\t\t\t\toptionsResourceDescription\n\t\t\t\t\t.getExportedObjects(ProtobufPackage.Literals.FIELD, GenUtils.INTEROP_MESSAGE_ID_OPTION_NAME, false)\n\t\t\t\t\t.findFirst[x|x.name.equals(GenUtils.INTEROP_MESSAGE_ID_OPTION_NAME)].EObjectOrProxy as Field\t\t\n\n\t\t\tif (r.contents.length > 0) {\n\n\t\t\t\tlogger.info(\"Processing \" + r.URI)\n\n\t\t\t\tval uriStr = r.URI.toString()\n\t\t\t\tval isProto = uriStr.endsWith(\".proto\")\n\t\t\t\tval isDescriptorProto = isProto && (uriStr.endsWith(GenUtils.PROTOBUF_DESCRIPTOR_RESOURCE_PATH) || uriStr.endsWith(GenUtils.INTEROP_DESCRIPTOR_RESOURCE_PATH))\n\t\t\t\tvar isBuiltIn = r.URI.segmentCount > 2 && r.URI.segment(r.URI.segmentCount - 2).equals(\"protobuf\") && r.URI.segment(r.URI.segmentCount - 3).equals(\"google\")\n\t\t\t\tval needAddCustomOptions = !isBuiltIn && !isDescriptorProto\n\t\t\t\tval needAddPlexusOptions = !isBuiltIn && !isDescriptorProto && !uriStr.endsWith(GenUtils.INTEROP_OPTIONS_RESOURCE_PATH)\n\n\t\t\t\tval root = r.contents.get(0) as Proto\n\t\t\t\tval firstDefinition = root.elements.findFirst[x|x instanceof NamedElement]\n\t\t\t\tvar addIndex = root.elements.length;\n\t\t\t\tif (firstDefinition !== null) {\n\t\t\t\t\taddIndex = root.elements.indexOf(firstDefinition)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (needAddPlexusOptions) {\n\t\t\t\t\t\n\t\t\t\t\tval needAddImport = r.allContents\n\t\t\t\t\t\t.filter(typeof(Import))\n\t\t\t\t\t\t.findFirst(x|x.importURI.endsWith(GenUtils.INTEROP_OPTIONS_RESOURCE_PATH)) === null\t\t\t\t\t\t\n\t\t\t\t\tif (needAddImport) {\n\t\t\t\t\t\tval importElement = ProtobufFactory.eINSTANCE.createImport\n\t\t\t\t\t\timportElement.importURI = GenUtils.INTEROP_OPTIONS_RESOURCE_PATH\n\t\t\t\t\t\troot.elements.add(addIndex, importElement)\n\t\t\t\t\t\taddIndex++\n\t\t\t\t\t}\t\t\t\t\t\n\n\t\t\t\t\tfor (service : r.allContents.toIterable().filter(typeof(Service))) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tval needSetOption = service.elements\n\t\t\t\t\t\t\t.filter(typeof(Option))\n\t\t\t\t\t\t\t.findFirst [o | qualifiedNameProvider.getFullyQualifiedName(o.descriptor).equals(GenUtils.INTEROP_SERVICE_ID_OPTION_NAME)] === null\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (needSetOption) {\n\t\t\t\t\t\t\tvar id = qualifiedNameProvider.getFullyQualifiedName(service).skipFirst(1).toString()\n\t\t\t\t\t\t\tval stringConstant = ProtobufFactory.eINSTANCE.createStringConstant\n\t\t\t\t\t\t\tstringConstant.value = id\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tval option = ProtobufFactory.eINSTANCE.createOption()\n\t\t\t\t\t\t\toption.isCustom = true\t\t\t\t\t\t\t\n\t\t\t\t\t\t\toption.descriptor = serviceIdOptionDescriptor\t\t\t\t\t\t\t\n\t\t\t\t\t\t\toption.value = stringConstant\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tservice.elements.add(0, option)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (message : r.allContents.toIterable().filter(typeof(Message))) {\n\t\t\t\t\t\tval needSetOption = message.elements\n\t\t\t\t\t\t\t.filter(typeof(Option))\n\t\t\t\t\t\t\t.findFirst[o | qualifiedNameProvider.getFullyQualifiedName(o.descriptor).equals(GenUtils.INTEROP_MESSAGE_ID_OPTION_NAME)] === null\n\t\t\t\t\t\tif (needSetOption) {\n\t\t\t\t\t\t\tvar id = qualifiedNameProvider.getFullyQualifiedName(message).skipFirst(1).toString()\n\t\t\t\t\t\t\tval stringConstant = ProtobufFactory.eINSTANCE.createStringConstant\n\t\t\t\t\t\t\tstringConstant.value = id\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tval option = ProtobufFactory.eINSTANCE.createOption()\n\t\t\t\t\t\t\toption.isCustom = true\n\t\t\t\t\t\t\toption.descriptor = messageIdOptionDescriptor\n\t\t\t\t\t\t\toption.value = stringConstant\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmessage.elements.add(0, option)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (needAddCustomOptions) {\n\t\t\t\t\t\n\t\t\t\t\tif (namespaceIsPrefix || !namespace.isEmpty) {\n\t\t\t\t\t\n\t\t\t\t\t\t// Injecting C# namespace option\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar namespaceToSet = namespace\n\t\t\t\t\t\tif (namespaceIsPrefix) {\n\t\t\t\t\t\t\tval protoNamespace = qualifiedNameProvider.getFullyQualifiedName(root).skipFirst(1).segments.map[x|x.toFirstUpper].join(\".\");\n\t\t\t\t\t\t\tif (protoNamespace !== null && !protoNamespace.isEmpty) {\n\t\t\t\t\t\t\t\tif (!namespace.isEmpty) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tnamespaceToSet = namespace + \".\" + protoNamespace\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnamespaceToSet = protoNamespace\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tval csharpNamespaceOption = ProtobufFactory.eINSTANCE.createOption()\n\t\t\t\t\t\tcsharpNamespaceOption.isCustom = false\n\t\t\t\t\t\tcsharpNamespaceOption.descriptor = csharpNamespaceOptionDescriptor\n\t\t\t\t\t\tval stringConstant = ProtobufFactory.eINSTANCE.createStringConstant()\n\t\t\t\t\t\tstringConstant.value = namespaceToSet\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tcsharpNamespaceOption.value = stringConstant\n\t\t\t\t\t\tvar existingOption = root.elements\n\t\t\t\t\t\t\t.filter(typeof(Option))\n\t\t\t\t\t\t\t.findFirst [o | qualifiedNameProvider.getFullyQualifiedName(o.descriptor).equals(qualifiedNameProvider.getFullyQualifiedName(csharpNamespaceOptionDescriptor))]\n\t\t\t\t\t\tif (existingOption === null) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\troot.elements.add(addIndex, csharpNamespaceOption)\n\t\t\t\t\t\t\taddIndex++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\texistingOption.value = EcoreUtil2.cloneIfContained(csharpNamespaceOption.value)\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tvar uri = r.URI\t\t\t\t\n\t\t\t\tif (uri.toString().startsWith(baseDirUri.toString())) {\n\t\t\t\t\turi = uri.deresolve(baseDirUri)\t\t\t\t\t\n\t\t\t\t} else if (uri.toString().startsWith(interopResourceBaseUri.toString())) {\n\t\t\t\t\turi = uri.deresolve(interopResourceBaseUri)\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\turi = uri.deresolve(protoResourceBaseUri)\n\t\t\t\t}\n\t\t\t\tval deresolvedStr = uri.toString()\n\t\t\t\tif (deresolvedStr.startsWith(\"/\")) {\n\t\t\t\t\turi = URI.createURI(deresolvedStr.substring(1))\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\turi = uri.resolve(outDirUri)\n\n\t\t\t\tlogger.info(\"Saving \" + uri)\n\t\t\t\tvar FileOutputStream fop\n\t\t\t\ttry {\n\t\t\t\t\tval file = new File(uri.toFileString())\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif (file.exists()) {\n\t\t\t\t\t\tfile.delete()\n\t\t\t\t\t}\n\t\t\t\t\tfile.parentFile.mkdirs()\n\t\t\t\t\tfile.createNewFile()\n\t\t\t\t\tfop = new FileOutputStream(file);\n\t\t\t\t\tr.save(fop, Collections.EMPTY_MAP)\n\t\t\t\t\tfop.flush()\n\t\t\t\t} finally {\n\t\t\t\t\tif (fop !== null) {\n\t\t\t\t\t\tfop.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlogger.info(\"Saved \" + uri)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/gen/proto/src/main/java/com/db/plexus/interop/dsl/gen/proto/ProtoOption.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.proto\n\nimport org.eclipse.xtext.naming.QualifiedName\n\npublic class ProtoOption {\n\t\t\t\n\tprivate QualifiedName name\n\tprivate String value\n\t\n\tnew(QualifiedName name, String value) {\n\t\tthis.name = name\n\t\tthis.value = value\n\t}\n\t\n\tdef getName() {\n\t\tname\n\t}\n\t\n\tdef getValue() {\n\t\tvalue\n\t}\n}"
  },
  {
    "path": "dsl/gen/test/build.gradle",
    "content": "dependencies {\n        compile group: 'junit', name: 'junit', version: '4.12'\n        compile \"org.eclipse.xtext:org.eclipse.xtext.junit4:${xtextJunitVersion}\"\n        compile \"org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}\"\n        compile \"org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}\"\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/test/src/main/java/com/db/plexus/interop/dsl/gen/test/InteropLangInjectionProvider.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.test;\n\nimport org.eclipse.xtext.testing.IInjectorProvider;\n\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup;\nimport com.google.inject.Injector;\n\npublic class InteropLangInjectionProvider implements IInjectorProvider {\n    @Override\n    public Injector getInjector() {\n        return new InteropLangStandaloneSetup().createInjectorAndDoEMFRegistration();\n    }\n}\n"
  },
  {
    "path": "dsl/gen/test/src/main/java/com/db/plexus/interop/dsl/gen/test/ResourceUtils.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.test\n\nimport org.eclipse.emf.common.util.URI\n\npublic class ResourceUtils {\n\t\n\tdef public static resolveStandardURI(String resourcePath) {\n\t\treturn ClassLoader.systemClassLoader.getResource(resourcePath).toURI\n\t}\n\t\n\tdef public static resolveURI(String resourcePath) {\n\t\treturn URI.createURI(resolveStandardURI(resourcePath).toString)\n\t}\t\t\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/components/component_a.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"com/db/plexus/interop/dsl/gen/test/services/services.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\n\npackage com.db.plexus.interop.dsl.gen.test.components;\n\napplication ComponentA {\n\n    consumes com.db.plexus.interop.dsl.gen.test.services.ExampleService { PointToPoint; ServerStreaming [(model.consumed_method_option_enum)=VALUE2]; ClientToServer; BidiStreaming; }\n\n    consumes com.db.plexus.interop.dsl.gen.test.services.ExampleService as NoLaunchExampleService from com.db.plexus.* {\n        PointToPoint;\n    }\n\n    provides services.ExampleService to com.db.plexus.* {\n        PointToPoint [launch_on_call=ALWAYS, title=\"Point-to-point\"]; \n        ServerStreaming; \n        ClientToServer; \n        BidiStreaming [launch_on_call=DISABLED]; \n    }\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/components/component_a_invalid.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"com/db/plexus/interop/dsl/gen/test/services/services.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\n\npackage com.db.plexus.interop.dsl.gen.test.components;\n\napplication ComponentA {\n    consumes com.db.plexus.interop.dsl.gen.test.services.ExampleService_NotExists { PointToPoint; }\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/components/component_c.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"com/db/plexus/interop/dsl/gen/test/services/services.proto\";\n\npackage com.db.plexus.interop.dsl.gen.test.components;\n\napplication ComponentC {\n    provides services.ExampleService to com.db.plexus.*\n    {\n    \toption title = \"Example Service\";\n    \tPointToPoint;\n    \tServerStreaming;\n    \tClientToServer;\n    \tBidiStreaming;\n    };\n}\n"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/model/messages.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.model;\n\nimport \"interop/options.proto\";\n\nmessage Request {\n\toption (.interop.message_id) = \"com.plexus.mode.Request\";\n    string string_field = 1;\n    bool boolean_field = 2;\n    sint32 sint_field = 3;\n    uint32 uint_field = 4;\n    Request request_field = 5;\n}\n\nmessage Response {\n\toption (.interop.message_id) = \"com.plexus.mode.Response\";\n    string result = 1;\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/model/missed_message.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.model;\n\nimport \"interop/options.proto\";\n\nmessage Request {\n\toption (.interop.message_id) = \"com.plexus.mode.Request\";\n    string string_field = 1;\n    bool boolean_field = 2;\n    sint32 sint_field = 3;\n    uint32 uint_field = 4;\n    Request request_field = 5;\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/model/missed_message_field.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.model;\n\nimport \"interop/options.proto\";\n\nmessage Request {\n\toption (.interop.message_id) = \"com.plexus.mode.Request\";\n    string string_field = 1;\n    bool boolean_field = 2;\n    // commented to check validation rule\n    // sint32 sint_field = 3;\n    uint32 uint_field = 4;\n    Request request_field = 5;\n}\n\nmessage Response {\n\toption (.interop.message_id) = \"com.plexus.mode.Response\";\n    string result = 1;\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/model/options.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.model;\n\nimport \"interop/descriptor.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nextend .google.protobuf.MessageOptions {\n\tdouble message_option_double = 10000;\t\n}\n\nextend .google.protobuf.ServiceOptions {\n\tstring service_option_string = 10001;\t\t\n\tbool service_option_bool = 21000;\n}\n\nextend .interop.ConsumedMethodOptions {\n\tTestEnum consumed_method_option_enum = 10;\n}\n\nenum TestEnum {\n\tVALUE1 = 1;\n\tVALUE2 = 2;\n\tVALUE3 = 3;\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/model/updated_message_fields.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.model;\n\nimport \"interop/options.proto\";\n\nmessage Request {\n\toption (.interop.message_id) = \"com.plexus.mode.Request\";\n    // primitive to primitive\n    bool string_field = 1;\n    // primitive to complex\n    Request boolean_field = 2;\n    // non repeated to repeated\n    repeated sint32 sint_field = 3;\n    uint32 uint_field = 4;\n    // complex to complex\n    Response request_field = 5;\n}\n\nmessage Response {\n\toption (.interop.message_id) = \"com.plexus.mode.Response\";\n    string result = 1;\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/services/deleted_service.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.services;\n\nimport \"com/db/plexus/interop/dsl/gen/test/model/messages.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\nimport \"interop/options.proto\";"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/services/deleted_service_method.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.services;\n\nimport \"com/db/plexus/interop/dsl/gen/test/model/messages.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\nimport \"interop/options.proto\";\n\nservice ExampleService {\n    // rpc PointToPoint(com.db.plexus.interop.dsl.gen.test.model.Request) returns (model.Response) {}\n    rpc ServerStreaming(test.model.Request) returns (stream .com.db.plexus.interop.dsl.gen.test.model.Response) {}\n    rpc ClientToServer(stream model.Request) returns (test.model.Response) {}\n    rpc BidiStreaming(stream .com.db.plexus.interop.dsl.gen.test.model.Request) returns (stream dsl.gen.test.model.Response) {}\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/services/services.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.services;\n\nimport \"com/db/plexus/interop/dsl/gen/test/model/messages.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\nimport \"interop/options.proto\";\n\nservice ExampleService {\n\n    option (.interop.service_id)=\"interop.samples.ExampleService\";\n    option (model.service_option_bool) = true;\n\n    rpc PointToPoint(com.db.plexus.interop.dsl.gen.test.model.Request) returns (model.Response) {}\n\n    // A server-to-client streaming RPC.\n    rpc ServerStreaming(test.model.Request) returns (stream .com.db.plexus.interop.dsl.gen.test.model.Response) {}\n\n    // A client-to-server streaming RPC.\n    rpc ClientToServer(stream model.Request) returns (test.model.Response) {}\n\n    // A Bidirectional streaming RPC.\n    rpc BidiStreaming(stream .com.db.plexus.interop.dsl.gen.test.model.Request) returns (stream dsl.gen.test.model.Response) {}\n\n}"
  },
  {
    "path": "dsl/gen/test/src/main/resources/com/db/plexus/interop/dsl/gen/test/services/updated_service_methods.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.gen.test.services;\n\nimport \"com/db/plexus/interop/dsl/gen/test/model/messages.proto\";\nimport \"com/db/plexus/interop/dsl/gen/test/model/options.proto\";\nimport \"interop/options.proto\";\n\nservice ExampleService {\n\n    // request type\n    rpc PointToPoint(model.Response) returns (model.Response) {}\n\n    // response type\n    rpc ServerStreaming(test.model.Request) returns (stream test.model.Request) {}\n\n    // request stream\n    rpc ClientToServer(model.Request) returns (test.model.Response) {}\n\n    // response stream\n    rpc BidiStreaming(stream .com.db.plexus.interop.dsl.gen.test.model.Request) returns (dsl.gen.test.model.Response) {}\n\n}"
  },
  {
    "path": "dsl/gen/ts/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:gen:common')\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/gen/ts/src/main/java/com/db/plexus/interop/dsl/gen/ts/TsGenTask.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.ts;\n\nimport com.db.plexus.interop.dsl.Application;\nimport com.db.plexus.interop.dsl.gen.BaseGenTask;\nimport com.db.plexus.interop.dsl.gen.GenUtils;\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig;\nimport com.google.inject.Inject;\nimport org.eclipse.emf.common.util.EList;\nimport org.eclipse.emf.ecore.resource.Resource;\nimport org.eclipse.xtext.resource.XtextResourceSet;\n\nimport javax.inject.Named;\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n@Named\npublic class TsGenTask extends BaseGenTask {\n\n    public static final String PROTO_TS_COMPILER = \"pbts\";\n    public static final String PROTO_TS_COMPILER_CMD = \"pbts.cmd\";\n    public static final String PROTO_JS_COMPILER = \"pbjs\";\n    public static final String PROTO_JS_COMPILER_CMD = \"pbjs.cmd\";\n    public static final String PLEXUS_MESSAGES_MODULES = \"plexus-messages\";\n\n    @Inject\n    private TypescriptApplicationApiGenerator codeOutputGenerator;\n\n    @Override\n    public void validateResources(PlexusGenConfig config, XtextResourceSet resourceSet) {\n        super.validateResources(config, resourceSet);\n        this.validateInteropResourceLoaded(config, resourceSet);\n    }\n\n    @Override\n    protected void doGenWithResources(PlexusGenConfig config, XtextResourceSet resourceSet) throws IOException {\n    \t\n    \tEList<Resource> resources = resourceSet.getResources();\n\n        String pbTsPath = null;\n        String pbJsPath = null;\n\n        final String configProtocPath = config.getProtocPath();\n        if (configProtocPath == null || configProtocPath.isEmpty()) {\n            this.logger.info(\"Proto compiler not provided, messages generation will be skipped\");\n        } else if (!configProtocPath.endsWith(PROTO_TS_COMPILER)\n                    && !configProtocPath.endsWith(PROTO_TS_COMPILER_CMD)) {\n            this.logger.warning(\"Only pbts compiler supported, messages generation will be skipped\");\n        } else {\n            pbTsPath = configProtocPath;\n            pbJsPath = configProtocPath.endsWith(PROTO_TS_COMPILER) ?\n                        configProtocPath.substring(0, configProtocPath.lastIndexOf(PROTO_TS_COMPILER)) + PROTO_JS_COMPILER\n                            : configProtocPath.substring(0, configProtocPath.lastIndexOf(PROTO_TS_COMPILER_CMD)) + PROTO_JS_COMPILER_CMD;\n        }\n\n        final List<String> protoFilePaths = getProtoFilePaths(resources, config);\n\n        final String outDirPath = this.getAbsolutePath(config.getOutDir());\n\n        if (protoFilePaths.isEmpty()) {\n            this.logger.warning(\"No proto resources detected\");\n        }\n\n        if (!protoFilePaths.isEmpty() && pbJsPath != null) {\n            this.logger.info(\"Using \" + pbJsPath + \" to generate JS messages\");\n            final List<String> pbJsArgs = new ArrayList<>(Arrays.asList(pbJsPath));\n            pbJsArgs.addAll(jsProtoArgs(config, outDirPath));\n            pbJsArgs.addAll(protoFilePaths);\n            final int resultCode = generateMessages(pbJsArgs);\n            if (resultCode == 0) {\n                this.logger.info(\"Generated successfully\");\n                this.logger.info(\"Using \" + pbTsPath + \" to generate TS messages definitions\");\n                final List<String> pbTsArgs = new ArrayList<>(Arrays.asList(pbTsPath));\n                pbTsArgs.addAll(tsProtoArgs(config, outDirPath));\n                final int code = generateMessages(pbTsArgs);\n                if (code == 0) {\n                    this.logger.info(\"Generated successfully\");\n                }\n            }\n        }\n\n        final List<Application> applications = GenUtils.getApplications(resources.toArray(new Resource[]{}));\n\n        config.setExternalDependencies(Arrays.asList(\"./\" + PLEXUS_MESSAGES_MODULES));\n\n        for (Application application : applications) {\n            this.logger.info(\"Generating TS Client for \" + application.getName());\n            String stringContent = codeOutputGenerator.generate(config, application, resources);\n            this.logger.info(\"Generated successfully\");\n            writeToFile(config.getOutDir() + \"/\" + application.getName() + \"GeneratedClient.ts\", stringContent);\n        }\n\n    }\n\n    private List<String> tsProtoArgs(PlexusGenConfig config, String outDirPath) {\n        return Arrays.asList(\n                \"--force-long\",\n                \"-t\", \"static-module\",\n                \"-r\", config.getNamespace(),\n                \"-w\", \"commonjs\",\n                \"-o\", outDirPath + File.separator + PLEXUS_MESSAGES_MODULES + \".d.ts\", outDirPath + File.separator + PLEXUS_MESSAGES_MODULES + \".js\");\n    }\n\n    private List<String> jsProtoArgs(PlexusGenConfig config, String outDirPath) {\n        return Arrays.asList(\n                \"--force-long\",\n                \"-t\", \"static-module\",\n                \"-r\", config.getNamespace(),\n                \"-w\", \"commonjs\",\n                \"-o\", outDirPath + File.separator + PLEXUS_MESSAGES_MODULES + \".js\");\n    }\n}\n"
  },
  {
    "path": "dsl/gen/ts/src/main/java/com/db/plexus/interop/dsl/gen/ts/TypescriptApplicationApiGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.ts\n\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.Application\nimport java.util.List\nimport org.eclipse.emf.ecore.resource.Resource\nimport com.db.plexus.interop.dsl.gen.ApplicationCodeGenerator\nimport com.google.inject.Inject\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.emf.ecore.EObject\nimport com.db.plexus.interop.dsl.ConsumedMethod\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport javax.inject.Named\nimport static extension com.db.plexus.interop.dsl.gen.GenUtils.*\nimport com.db.plexus.interop.dsl.ConsumedService\nimport com.db.plexus.interop.dsl.ProvidedService\n\n@Named\nclass TypescriptApplicationApiGenerator extends ApplicationCodeGenerator {\n\n    @Inject\n    IQualifiedNameProvider qualifiedNameProvider\n\n    def fullName(EObject obj) {\n        return qualifiedNameProvider.getFullyQualifiedName(obj).skipFirst(1).toString()\n    }\n\n    def namespace(EObject obj) {\n        return qualifiedNameProvider.getFullyQualifiedName(obj).skipFirst(1).skipLast(1).toString()\n    }\n\n    override def generate(PlexusGenConfig genConfig, Application app, List<Resource> resources) {\n\n        val consumedServices = app.getConsumedServices\n        val providedServices = app.getProvidedServices\n\n        '''\n«imports(genConfig)»\n\nexport interface CancellableUnaryResponse<T> {\n    invocation: InvocationClient;\n    response: Promise<T>;\n}\n\n«FOR consumedService : consumedServices SEPARATOR \"\\n\"»\n    /**\n     *  Proxy interface of «consumedService.aliasOrName.toFirstUpper» service, to be consumed by Client API\n     */\n    export abstract class «consumedService.aliasOrName.toFirstUpper»Proxy {\n\n        «FOR consumedMethod : consumedService.methods SEPARATOR \"\\n\"»\n        public abstract «clientMethodSignature(consumedMethod, genConfig)»;\n        «IF consumedMethod.method.isPointToPoint»\n        public abstract «cancellableUnaryMethodSignature(consumedMethod.method, genConfig)»;\n        «ENDIF»\n        «ENDFOR»\n    }\n«ENDFOR»\n\n«FOR consumedService : consumedServices SEPARATOR \"\\n\"»\n    /**\n     *  Internal Proxy implementation for «consumedService.aliasOrName.toFirstUpper» service\n     */\n    export class «consumedService.aliasOrName.toFirstUpper»ProxyImpl implements «consumedService.aliasOrName.toFirstUpper»Proxy {\n\n        constructor(private readonly genericClient: GenericClientApi) { }\n\n        «FOR consumedMethod : consumedService.methods SEPARATOR \"\\n\"»\n        public «clientMethodSignature(consumedMethod, genConfig)» {\n            «clientMethodImpl(consumedMethod, consumedService, genConfig)»\n        }\n        «IF consumedMethod.method.isPointToPoint»\n        public «cancellableUnaryMethodSignature(consumedMethod.method, genConfig)» {\n            «clientCancellablePointToPointImpl(consumedMethod, consumedService, genConfig)»\n        }\n        «ENDIF»\n        «ENDFOR»\n\n    }\n«ENDFOR»\n\n/**\n * Main client API\n */\nexport interface «app.name»Client extends GenericClientApi  {\n\n    «FOR consumedService : consumedServices SEPARATOR \"\\n\"»\n    get«consumedService.aliasOrName.toFirstUpper»Proxy(): «consumedService.aliasOrName.toFirstUpper»Proxy;\n    «ENDFOR»\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass «app.name»ClientImpl extends GenericClientApiBase implements «app.name»Client {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n        «FOR consumedService : consumedServices SEPARATOR ',' »\n        private readonly «consumedService.aliasOrName.toFirstLower»Proxy: «consumedService.aliasOrName.toFirstUpper»Proxy\n        «ENDFOR»\n    ) {\n        super(genericClient);\n    }\n\n    «FOR consumedService : consumedServices SEPARATOR '\\n' »\n    public get«consumedService.aliasOrName.toFirstUpper»Proxy(): «consumedService.aliasOrName.toFirstUpper»Proxy {\n        return this.«consumedService.aliasOrName.toFirstLower»Proxy;\n    }\n    «ENDFOR»\n\n}\n\n«FOR providedService : providedServices SEPARATOR '\\n' »\n    /**\n     * Client invocation handler for «providedService.aliasOrName.toFirstUpper», to be implemented by Client\n     */\n    export abstract class «providedService.aliasOrName.toFirstUpper»InvocationHandler {\n\n        «FOR providedMethod : providedService.methods SEPARATOR '\\n'»\n        public abstract «clientHandlerSignature(providedMethod.method, genConfig)»;\n        «ENDFOR»\n    }\n«ENDFOR»\n\n/**\n * Client API builder\n */\nexport class «app.name»ClientBuilder implements ClientApiBuilder<«app.name»Client, «app.name»ClientBuilder> {\n\n    protected genericBuilder: GenericClientApiBuilder =\n        new ContainerAwareClientAPIBuilder()\n            .withApplicationId('«app.fullName»');\n\n    «FOR providedElement : providedServices SEPARATOR '\\n' »\n        private «providedElement.aliasOrName.toFirstLower»Handler: «providedElement.aliasOrName.toFirstUpper»InvocationHandler;\n    «ENDFOR»\n\n    «FOR providedMethod : providedServices SEPARATOR '\\n' »\n    public with«providedMethod.aliasOrName.toFirstUpper»InvocationsHandler(invocationsHandler: «providedMethod.aliasOrName.toFirstUpper»InvocationHandler): «app.name»ClientBuilder {\n        this.«providedMethod.aliasOrName.toFirstLower»Handler = invocationsHandler;\n        return this;\n    }\n    «ENDFOR»\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): «app.name»ClientBuilder {\n        this.genericBuilder.withClientApiDecorator(clientApiDecorator);\n        return this;\n    }\n\n    public withClientExtension(extension: (builder: ClientApiBuilder<«app.name»Client, «app.name»ClientBuilder>) => void): «app.name»ClientBuilder {\n        extension(this);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): «app.name»ClientBuilder {\n        this.genericBuilder.withTransportConnectionProvider(provider);\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): «app.name»ClientBuilder {\n        this.genericBuilder.withAppInstanceId(appInstanceId);\n        return this;\n    }\n\n    public withAppId(appId: string): «app.name»ClientBuilder {\n        this.genericBuilder.withApplicationId(appId);\n        return this;\n    }\n\n    public withDisconnectCallback(onDisconnect: () => Promise<void>): «app.name»ClientBuilder {\n        this.genericBuilder.withDisconnectCallback(onDisconnect);\n        return this;\n    }\n\n    public connect(): Promise<«app.name»Client> {\n        «FOR providedService : providedServices »\n        if (!this.«providedService.aliasOrName.toFirstLower»Handler) {\n            return Promise.reject('Invocation handler for «providedService.aliasOrName» is not provided');\n        }\n        «ENDFOR»\n        return this.genericBuilder\n            «FOR providedService : providedServices »\n                «FOR providedMethod : providedService.methods»\n                    «invocationHandlerBuilder(providedMethod.method, providedService, genConfig)»\n                «ENDFOR»\n            «ENDFOR»\n            .connect()\n            .then(genericClient => new «app.name»ClientImpl(\n                genericClient«IF !consumedServices.isEmpty»,«ENDIF»\n                «FOR consumedService : consumedServices SEPARATOR \",\"»\n                new «consumedService.aliasOrName.toFirstUpper»ProxyImpl(genericClient)\n                «ENDFOR»));\n    }\n}\n    '''\n    }\n\n    def invocationHandlerBuilder(Method rpcMethod, ProvidedService providedService, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''\n            .withTypeAwareUnaryHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            }, «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»)\n            '''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''\n            .withTypeAwareBidiStreamingHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            }, «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»)\n            '''\n            case rpcMethod.isServerStreaming: '''\n            .withTypeAwareServerStreamingHandler({\n                «handlerBuilderParam(rpcMethod, providedService, genConfig)»\n            }, «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»)\n            '''\n        }\n    }\n\n    def handlerBuilderParam(Method rpcMethod, ProvidedService providedService, PlexusGenConfig genConfig) {\n        return '''\n            serviceInfo: {\n                serviceId: '«rpcMethod.service.fullName»'«IF providedService.alias !== null»,\n                serviceAlias: '«providedService.alias»'«ENDIF»\n            },\n            methodId: '«rpcMethod.name»',\n            handle: this.«providedService.aliasOrName.toFirstLower»Handler.on«rpcMethod.name».bind(this.«providedService.aliasOrName.toFirstLower»Handler)\n        '''\n    }\n\n    def imports(PlexusGenConfig genConfig) '''\nimport { InternalGenericClientApi, ClientApiBuilder, MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as «genConfig.namespace» from '«genConfig.getExternalDependencies().get(0)»';\n    '''\n\n    def clientMethodSignature(ConsumedMethod methodLink, PlexusGenConfig genConfig) {\n        clientMethodSignature(methodLink.method, genConfig)\n    }\n\n    def cancellableUnaryMethodSignature(Method rpcMethod, PlexusGenConfig genConfig) '''«rpcMethod.name.toFirstLower»WithCancellation(request: «requestType(rpcMethod, genConfig)»): Promise<CancellableUnaryResponse<«responseType(rpcMethod, genConfig)»>>'''\n    \n    def clientMethodSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''«rpcMethod.name.toFirstLower»(request: «requestType(rpcMethod, genConfig)»): Promise<«responseType(rpcMethod, genConfig)»>'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''«rpcMethod.name.toFirstLower»(responseObserver: InvocationObserver<«responseType(rpcMethod, genConfig)»>): Promise<StreamingInvocationClient<«requestType(rpcMethod, genConfig)»>>'''\n            case rpcMethod.isServerStreaming: '''«rpcMethod.name.toFirstLower»(request: «requestType(rpcMethod, genConfig)», responseObserver: InvocationObserver<«responseType(rpcMethod, genConfig)»>): Promise<InvocationClient>'''\n        }\n    }\n\n    def requestType(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.request.message.namespace.toLowerCase».I«rpcMethod.request.message.name»'''\n\n    def responseType(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.response.message.namespace.toLowerCase».I«rpcMethod.response.message.name»'''\n\n    def requestTypeImpl(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.request.message.namespace.toLowerCase».«rpcMethod.request.message.name»'''\n\n    def responseTypeImpl(Method rpcMethod, PlexusGenConfig genConfig)\n    '''«genConfig.namespace».«rpcMethod.response.message.namespace.toLowerCase».«rpcMethod.response.message.name»'''\n\n    def clientMethodImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: clientPointToPointImpl(consumed, consumedService, genConfig)\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: clientBidiStreamingImpl(consumed, consumedService, genConfig)\n            case rpcMethod.isServerStreaming: serverStreamingImpl(consumed, consumedService, genConfig)\n        }\n    }\n\n    def clientPointToPointImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return new Promise((resolve, reject) => {\n                this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                    value: responsePayload => resolve(responsePayload),\n                    error: e => reject(e)\n                }, «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»);\n            });\n        '''\n    }\n\n    def clientCancellablePointToPointImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return new Promise<CancellableUnaryResponse<«responseType(rpcMethod, genConfig)»>>((resolveInvocation, rejectInvocation) => {\n                const responsePromise = new Promise<«responseType(rpcMethod, genConfig)»>((resolveResponse, rejectResponse) => {\n                    this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                        value: responsePayload => resolveResponse(responsePayload),\n                        error: e => rejectResponse(e)\n                    }, «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»)\n                    .then(invocationClient => resolveInvocation({ invocation: invocationClient, response: responsePromise }))\n                    .catch(rejectInvocation);\n                });\n            });\n        '''\n    }\n\n    def clientBidiStreamingImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return this.genericClient.sendBidirectionalStreamingRequest(\n                invocationInfo,\n                responseObserver,\n                «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»);\n        '''\n    }\n\n    def serverStreamingImpl(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            «clientInvocationInfo(consumed, consumedService, genConfig)»\n            return this.genericClient.sendServerStreamingRequest(\n                invocationInfo,\n                request,\n                responseObserver,\n                «requestTypeImpl(rpcMethod, genConfig)», «responseTypeImpl(rpcMethod, genConfig)»\n            );\n        '''\n    }\n\n    def clientInvocationInfo(ConsumedMethod consumed, ConsumedService consumedService, PlexusGenConfig genConfig) {\n        val rpcMethod = consumed.method\n        return '''\n            const invocationInfo: InvocationRequestInfo = {\n                methodId: '«rpcMethod.name»',\n                serviceId: '«rpcMethod.service.fullName»'«IF consumedService.alias !== null»,\n                serviceAlias: '«consumedService.alias»'«ENDIF»\n            };\n        '''\n    }\n\n    def clientHandlerSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, request: «requestType(rpcMethod, genConfig)»): Promise<«responseType(rpcMethod, genConfig)»>'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<«responseType(rpcMethod, genConfig)»>): InvocationObserver<«requestType(rpcMethod, genConfig)»>'''\n            case rpcMethod.isServerStreaming: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, request: «requestType(rpcMethod, genConfig)», hostClient: StreamingInvocationClient<«responseType(rpcMethod, genConfig)»>): void'''\n        }\n    }\n\n    def genericClientHandlerSignature(Method rpcMethod, PlexusGenConfig genConfig) {\n        switch (rpcMethod) {\n            case rpcMethod.isPointToPoint: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, request: ArrayBuffer): Promise<ArrayBuffer>'''\n            case rpcMethod.isBidiStreaming\n                    || rpcMethod.isClientStreaming: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<ArrayBuffer>): InvocationObserver<ArrayBuffer>'''\n            case rpcMethod.isServerStreaming: '''on«rpcMethod.name»(invocationContext: MethodInvocationContext, request: ArrayBuffer, hostClient: StreamingInvocationClient<ArrayBuffer>): void'''\n        }\n    }\n\n}"
  },
  {
    "path": "dsl/gen/ts/src/test/java/com/db/plexus/interop/dsl/gen/ts/tests/TypescriptComponentApiGeneratorTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.gen.ts.tests\n\nimport com.db.plexus.interop.dsl.gen.GenUtils\nimport com.db.plexus.interop.dsl.gen.PlexusGenConfig\nimport com.db.plexus.interop.dsl.gen.test.InteropLangInjectionProvider\nimport com.db.plexus.interop.dsl.gen.test.ResourceUtils\nimport com.db.plexus.interop.dsl.gen.ts.TypescriptApplicationApiGenerator\nimport com.google.inject.Inject\nimport java.nio.file.Files\nimport java.nio.file.Paths\nimport java.util.Arrays\nimport org.eclipse.xtext.resource.XtextResourceSet\nimport org.eclipse.xtext.testing.InjectWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport static org.junit.Assert.*\n\n@RunWith(typeof(XtextRunner))\n@InjectWith(typeof(InteropLangInjectionProvider))\nclass TypescriptComponentApiGeneratorTest {\n\n    @Inject\n    private XtextResourceSet resourceSet;\n\n    @Inject\n    TypescriptApplicationApiGenerator outputGenerator;\n\n    @Test\n    def void testFullContentGeneration() {\n\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/services/services.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/model/messages.proto\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_a.interop\"), true)\n        resourceSet.getResource(ResourceUtils.resolveURI(\"com/db/plexus/interop/dsl/gen/test/components/component_c.interop\"), true)\n\n        val apps = GenUtils.getApplications(resourceSet.getResources())\n\n        var plexusConfig = new PlexusGenConfig();\n        plexusConfig.namespace = \"plexus\"\n        plexusConfig.externalDependencies = Arrays.asList(\"./plexus-messages\")\n\n        val generatedResult = outputGenerator.generate(plexusConfig, apps.get(0),\n        resourceSet.getResources())\n        \n        val expectedURI = ResourceUtils.resolveStandardURI(\"com/db/plexus/interop/dsl/gen/ts/tests/expected.data\")\n        val expected = new String(Files.readAllBytes(Paths.get(expectedURI)))\t\n\n        assertEqualsIgnoreWhiteSpaces(expected, generatedResult)                    \n    }\n    \n    def assertEqualsIgnoreWhiteSpaces(String s1, String s2) {\n        assertEquals(\"Equals ignoring whitespaces\", s1.replaceAll(\"\\\\s\", \"\"), s2.replaceAll(\"\\\\s\", \"\"))\n    }\n\n}\n"
  },
  {
    "path": "dsl/gen/ts/src/test/resources/com/db/plexus/interop/dsl/gen/ts/tests/expected.data",
    "content": "import { InternalGenericClientApi, ClientApiBuilder, MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as plexus from './plexus-messages';\n\nexport interface CancellableUnaryResponse<T> {\n    invocation: InvocationClient;\n    response: Promise<T>;\n}\n\n/**\n *  Proxy interface of ExampleService service, to be consumed by Client API\n */\nexport abstract class ExampleServiceProxy {\n\n    public abstract pointToPoint(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>;\n    public abstract pointToPointWithCancellation(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>>;\n    \n    public abstract serverStreaming(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest, responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<InvocationClient>;\n    \n    public abstract clientToServer(responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>>;\n    \n    public abstract bidiStreaming(responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>>;\n}\n\n/**\n *  Proxy interface of NoLaunchExampleService service, to be consumed by Client API\n */\nexport abstract class NoLaunchExampleServiceProxy {\n\n    public abstract pointToPoint(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>;\n    public abstract pointToPointWithCancellation(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>>;\n}\n\n/**\n *  Internal Proxy implementation for ExampleService service\n */\nexport class ExampleServiceProxyImpl implements ExampleServiceProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public pointToPoint(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'PointToPoint',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response);\n        });\n    }\n    public pointToPointWithCancellation(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'PointToPoint',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n        };\n        return new Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>>((resolveInvocation, rejectInvocation) => {\n            const responsePromise = new Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>((resolveResponse, rejectResponse) => {\n                this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                    value: responsePayload => resolveResponse(responsePayload),\n                    error: e => rejectResponse(e)\n                }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n                .then(invocationClient => resolveInvocation({ invocation: invocationClient, response: responsePromise }))\n                .catch(rejectInvocation);\n            });\n        });\n    }\n    \n    public serverStreaming(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest, responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<InvocationClient> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ServerStreaming',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n        };\n        return this.genericClient.sendServerStreamingRequest(\n            invocationInfo,\n            request,\n            responseObserver,\n            plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response\n        );\n    }\n    \n    public clientToServer(responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ClientToServer',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response);\n    }\n    \n    public bidiStreaming(responseObserver: InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): Promise<StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'BidiStreaming',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response);\n    }\n\n}\n\n/**\n *  Internal Proxy implementation for NoLaunchExampleService service\n */\nexport class NoLaunchExampleServiceProxyImpl implements NoLaunchExampleServiceProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public pointToPoint(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'PointToPoint',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService',\n            serviceAlias: 'NoLaunchExampleService'\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response);\n        });\n    }\n    public pointToPointWithCancellation(request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'PointToPoint',\n            serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService',\n            serviceAlias: 'NoLaunchExampleService'\n        };\n        return new Promise<CancellableUnaryResponse<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>>((resolveInvocation, rejectInvocation) => {\n            const responsePromise = new Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>((resolveResponse, rejectResponse) => {\n                this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                    value: responsePayload => resolveResponse(responsePayload),\n                    error: e => rejectResponse(e)\n                }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n                .then(invocationClient => resolveInvocation({ invocation: invocationClient, response: responsePromise }))\n                .catch(rejectInvocation);\n            });\n        });\n    }\n\n}\n\n/**\n * Main client API\n */\nexport interface ComponentAClient extends GenericClientApi  {\n\n    getExampleServiceProxy(): ExampleServiceProxy;\n    \n    getNoLaunchExampleServiceProxy(): NoLaunchExampleServiceProxy;\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass ComponentAClientImpl extends GenericClientApiBase implements ComponentAClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n        private readonly exampleServiceProxy: ExampleServiceProxy,\n        private readonly noLaunchExampleServiceProxy: NoLaunchExampleServiceProxy\n    ) {\n        super(genericClient);\n    }\n\n    public getExampleServiceProxy(): ExampleServiceProxy {\n        return this.exampleServiceProxy;\n    }\n    \n    public getNoLaunchExampleServiceProxy(): NoLaunchExampleServiceProxy {\n        return this.noLaunchExampleServiceProxy;\n    }\n\n}\n\n/**\n * Client invocation handler for ExampleService, to be implemented by Client\n */\nexport abstract class ExampleServiceInvocationHandler {\n\n    public abstract onPointToPoint(invocationContext: MethodInvocationContext, request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest): Promise<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>;\n    \n    public abstract onServerStreaming(invocationContext: MethodInvocationContext, request: plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest, hostClient: StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): void;\n    \n    public abstract onClientToServer(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>;\n    \n    public abstract onBidiStreaming(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.com.db.plexus.interop.dsl.gen.test.model.IResponse>): InvocationObserver<plexus.com.db.plexus.interop.dsl.gen.test.model.IRequest>;\n}\n\n/**\n * Client API builder\n */\nexport class ComponentAClientBuilder implements ClientApiBuilder<ComponentAClient, ComponentAClientBuilder> {\n\n    protected genericBuilder: GenericClientApiBuilder =\n        new ContainerAwareClientAPIBuilder()\n            .withApplicationId('com.db.plexus.interop.dsl.gen.test.components.ComponentA');\n\n    private exampleServiceHandler: ExampleServiceInvocationHandler;\n\n    public withExampleServiceInvocationsHandler(invocationsHandler: ExampleServiceInvocationHandler): ComponentAClientBuilder {\n        this.exampleServiceHandler = invocationsHandler;\n        return this;\n    }\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): ComponentAClientBuilder {\n        this.genericBuilder.withClientApiDecorator(clientApiDecorator);\n        return this;\n    }\n\n    public withClientExtension(extension: (builder: ClientApiBuilder<ComponentAClient, ComponentAClientBuilder>) => void): ComponentAClientBuilder {\n        extension(this);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): ComponentAClientBuilder {\n        this.genericBuilder.withTransportConnectionProvider(provider);\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): ComponentAClientBuilder {\n        this.genericBuilder.withAppInstanceId(appInstanceId);\n        return this;\n    }\n\n    public withAppId(appId: string): ComponentAClientBuilder {\n        this.genericBuilder.withApplicationId(appId);\n        return this;\n    }\n\n    public withDisconnectCallback(onDisconnect: () => Promise<void>): ComponentAClientBuilder {\n        this.genericBuilder.withDisconnectCallback(onDisconnect);\n        return this;\n    }\n\n    public connect(): Promise<ComponentAClient> {\n        if (!this.exampleServiceHandler) {\n            return Promise.reject('Invocation handler for ExampleService is not provided');\n        }\n        return this.genericBuilder\n            .withTypeAwareUnaryHandler({\n                serviceInfo: {\n                    serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n                },\n                methodId: 'PointToPoint',\n                handle: this.exampleServiceHandler.onPointToPoint.bind(this.exampleServiceHandler)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n            .withTypeAwareServerStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n                },\n                methodId: 'ServerStreaming',\n                handle: this.exampleServiceHandler.onServerStreaming.bind(this.exampleServiceHandler)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n            .withTypeAwareBidiStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n                },\n                methodId: 'ClientToServer',\n                handle: this.exampleServiceHandler.onClientToServer.bind(this.exampleServiceHandler)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n            .withTypeAwareBidiStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'com.db.plexus.interop.dsl.gen.test.services.ExampleService'\n                },\n                methodId: 'BidiStreaming',\n                handle: this.exampleServiceHandler.onBidiStreaming.bind(this.exampleServiceHandler)\n            }, plexus.com.db.plexus.interop.dsl.gen.test.model.Request, plexus.com.db.plexus.interop.dsl.gen.test.model.Response)\n            .connect()\n            .then(genericClient => new ComponentAClientImpl(\n                genericClient,\n                new ExampleServiceProxyImpl(genericClient),\n                                new NoLaunchExampleServiceProxyImpl(genericClient)\n                ));\n    }\n}\n"
  },
  {
    "path": "dsl/gradle.properties",
    "content": "xtextVersion=2.13.0\nxtextJunitVersion=2.10.0"
  },
  {
    "path": "dsl/ide-common/build.gradle",
    "content": "dependencies {\n    compile project(':dsl:proto-lang')\n    compile \"org.eclipse.xtext:org.eclipse.xtext.ide:${xtextVersion}\"\n    compile \"org.eclipse.xtext:org.eclipse.xtext.xbase.ide:${xtextVersion}\"\n}"
  },
  {
    "path": "dsl/ide-common/src/main/java/com/db/plexus/interop/ide/assist/ImportContentProvider.java",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.ide.assist;\n\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver;\nimport com.google.inject.Inject;\nimport org.eclipse.xtext.AbstractElement;\nimport org.eclipse.xtext.Assignment;\nimport org.eclipse.xtext.ide.editor.contentassist.ContentAssistContext;\nimport org.eclipse.xtext.ide.editor.contentassist.ContentAssistEntry;\nimport org.eclipse.xtext.ide.editor.contentassist.IIdeContentProposalAcceptor;\nimport org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider;\nimport org.eclipse.xtext.impl.RuleCallImpl;\n\npublic class ImportContentProvider extends IdeContentProposalProvider {\n\n    @Inject\n    private ProtoLangImportResolver importResolver;\n\n    @Override\n    protected void _createProposals(Assignment assignment, ContentAssistContext context, IIdeContentProposalAcceptor acceptor) {\n        final AbstractElement terminal = assignment.getTerminal();\n        if (terminal instanceof RuleCallImpl) {\n            final String feature = assignment.getFeature();\n            final String operator = assignment.getOperator();\n            if (\"importURI\".equals(feature) && \"=\".equals(operator)) {\n                importResolver.importCandidates(context.getResource())\n                        .stream()\n                        .map(uri -> uri.toFileString().replace(\"\\\\\", \"/\"))\n                        .map(uriString -> \"\\\"\" + uriString + \"\\\"\")\n                        .forEach(value -> {\n                            final ContentAssistEntry proposal = getProposalCreator()\n                                    .createProposal(value, context);\n                            acceptor.accept(proposal, getProposalPriorities().getDefaultPriority(proposal));\n                        });\n                return;\n            }\n        }\n        super._createProposals(assignment, context, acceptor);\n    }\n\n}\n"
  },
  {
    "path": "dsl/ide-common/src/main/java/com/db/plexus/interop/ide/server/DebugServerLauncher.java",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.ide.server;\n\nimport org.eclipse.lsp4j.jsonrpc.Launcher;\nimport org.eclipse.lsp4j.jsonrpc.MessageConsumer;\nimport org.eclipse.lsp4j.services.LanguageClient;\nimport org.eclipse.xtext.ide.server.LanguageServerImpl;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport java.net.SocketAddress;\nimport java.nio.channels.AsynchronousServerSocketChannel;\nimport java.nio.channels.AsynchronousSocketChannel;\nimport java.nio.channels.Channels;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.Future;\nimport java.util.function.Function;\n\npublic class DebugServerLauncher {\n\n    public static void launch(LanguageServerImpl languageServer, int port) throws InterruptedException, ExecutionException, IOException {\n        Launcher<LanguageClient> launcher = createSocketLauncher(\n                languageServer,\n                LanguageClient.class,\n                new InetSocketAddress(\"localhost\", port),\n                Executors.newCachedThreadPool(),\n                consumer -> consumer);\n        languageServer.connect(launcher.getRemoteProxy());\n        Future<?> future = launcher.startListening();\n        future.get();\n    }\n\n    static <T> Launcher<T> createSocketLauncher(Object localService, Class<T> remoteInterface, SocketAddress socketAddress, ExecutorService executorService, Function<MessageConsumer, MessageConsumer> wrapper) throws IOException, ExecutionException, InterruptedException {\n        final AsynchronousServerSocketChannel serverSocket = AsynchronousServerSocketChannel.open().bind(socketAddress);\n        final AsynchronousSocketChannel socketChannel = serverSocket.accept().get();\n        return Launcher.createIoLauncher(\n                localService,\n                remoteInterface,\n                Channels.newInputStream(socketChannel),\n                Channels.newOutputStream(socketChannel),\n                executorService,\n                wrapper);\n    }\n\n}\n"
  },
  {
    "path": "dsl/interop-lang/build.gradle",
    "content": "dependencies {\n    \n\ttestCompile \"junit:junit:4.12\"\n\ttestCompile project(':dsl:model')\n\ttestCompile project(':dsl:proto-lang')\n\ttestCompile \"org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}\"\n\ttestCompile \"org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}\"\n    \t\n\tcompile project(':dsl:model')\n\tcompile project(':dsl:proto-lang')\n    compile \"org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}\"\n    compile \"org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}\"\n\tcompile \"org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}\"\n\n}\nconfigurations {\n    mwe2 {\n        extendsFrom compile\n    }\n}\n\ndependencies {\n    mwe2 \"org.eclipse.emf:org.eclipse.emf.mwe2.launch:2.9.1.201705291010\"\n    mwe2 \"org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}\"\n    mwe2 \"org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}\"\n    mwe2 \"org.eclipse.xtext:xtext-antlr-generator:[2.1.1, 3)\"\n\n\t// added for Xcore support\n\tmwe2 'org.eclipse.emf:org.eclipse.emf.ecore.xcore:1.3.1'\n\tmwe2 'org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:1.2.0'\n}\n\ntask generateXtextLanguage(type: JavaExec) {\n    main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'\n    classpath = configurations.mwe2\n    inputs.file \"src/main/java/com/db/plexus/interop/dsl/GenerateInteropLang.mwe2\"\n    inputs.file \"src/main/java/com/db/plexus/interop/dsl/InteropLang.xtext\"\n    outputs.dir \"src/main/xtext-gen\"\n    args += \"src/main/java/com/db/plexus/interop/dsl/GenerateInteropLang.mwe2\"\n    args += \"-p\"\n    args += \"rootPath=/${projectDir}/..\"\n}\n\ngenerateXtext.dependsOn(generateXtextLanguage)\ngenerateXtext.dependsOn(':dsl:proto-lang:build')\nclean.dependsOn(cleanGenerateXtextLanguage)\neclipse.classpath.plusConfigurations += [configurations.mwe2]\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/GenerateInteropLang.mwe2",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nmodule com.db.plexus.interop.dsl.InteropLang\n\nimport org.eclipse.xtext.xtext.generator.*\nimport org.eclipse.xtext.xtext.generator.model.project.*\n\nvar rootPath = \"..\"\n\nWorkflow {\n\n\tbean = org.eclipse.emf.mwe.utils.StandaloneSetup {\n\t\tprojectMapping = {\n\t\t\tpath = \"${rootPath}/model\"\n\t\t\tprojectName = \"com.db.plexus.interop.dsl.model\"\n\t\t}\n\n\t\tprojectMapping = {\n\t\t\tpath = \"${rootPath}/proto-lang\"\n\t\t\tprojectName = \"com.db.plexus.interop.dsl.protobuf\"\n\t\t}\n\t}\n\n\tcomponent = XtextGenerator {\n\t\tconfiguration = {\n\t\t\tproject = StandardProjectConfig {\n\t\t\t\tbaseName = \"interop-lang\"\t\t\t\t\n\t\t\t\trootPath = rootPath\n\t\t\t\tmavenLayout = true\n\t\t\t\truntimeTest = {\n\t\t\t\t\tenabled = true\n\t\t\t\t}\n                genericIde = {\n                    enabled = true\n                }\n\t\t\t}\n\t\t\tcode = {\n\t\t\t\tpreferXtendStubs = true\n\t\t\t\tencoding = \"UTF-8\"\n\t\t\t\tlineDelimiter = \"\\n\"\n\t\t\t\tfileHeader = \"/*\\n * generated by Xtext \\${version}\\n */\"\n\t\t\t}\n\t\t}\n\t\tlanguage = StandardLanguage {\n\t\t\tname = \"com.db.plexus.interop.dsl.InteropLang\"\n\t\t\t\n\t\t\tfileExtensions = \"interop\"\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tparserGenerator = {\t\t\t\t\n\t\t\t\toptions = parser.antlr.AntlrOptions {\n\t\t\t\t\tclassSplitting = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treferencedResource = \"platform:/resource/com.db.plexus.interop.dsl.model/src/main/java/interop.xcore\"\n\t\t\treferencedResource = \"platform:/resource/com.db.plexus.interop.dsl.model/src/main/java/proto.xcore\"\n\t\t\treferencedResource = \"platform:/resource/com.db.plexus.interop.dsl.protobuf/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLang.xtext\"\n\t\t\t\n\t\t\tformatter={\n    \t\t\tgenerateStub = true\n\t\t\t}\n\t\t\tserializer = {\n\t\t\t\tgenerateStub = false\n\t\t\t}\n\t\t\tvalidator = {\n\t\t\t}\n\t\t\twebSupport = {\n\t\t\t\tframework = \"Ace\"\n\t\t\t}\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/GlobalLangConfigHolder.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl;\n\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangConfig;\n\npublic class GlobalLangConfigHolder {\n\n    public static ProtoLangConfig protoLangConfig;\n\n    public static ProtoLangConfig interopLangConfig;\n\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/InteropLang.xtext",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngrammar com.db.plexus.interop.dsl.InteropLang with com.db.plexus.interop.dsl.protobuf.ProtoLang \n\nimport \"http://www.db.com/plexus/interop/dsl/protobuf\"\nimport \"http://www.db.com/plexus/interop/dsl\"\n\n@Override\nProto: {Proto}\n\telements+=ProtoElement*\n;\n\n@Override\nProtoElement:\n\t(Package | Import | Option | ProtoDefinition)\n;\n\n@Override \nProtoDefinition:\n\tApplication\n;\n\nApplication:\n\t'application' name=VALID_INTEROP_ID '{'\n\t\t(elements+=ApplicationElement)*\n\t'}' ';'*\n;\n\nApplicationElement:\n\tConsumedService\t| ProvidedService | InteropOption\n;\n\nInteropOption:\n\t(-> CustomInteropOption | PredefinedInteropOption)\n;\n\nPredefinedInteropOption returns InteropOption: \n\t'option' descriptor=[Field|SHORT_ID] '=' value=Constant ';'+\n;\n\nCustomInteropOption returns InteropOption:\n\t'option' (-> isCustom?='(') descriptor=[Field|FULL_ID] ')' '=' value=Constant ';'+\n;\n\nConsumedService:\n\t'consumes' service=[Service|FULL_ID] (('{' (elements+=ConsumedServiceElement)* '}') & ('as' alias=VALID_INTEROP_ID)? & ('from' restrictions=RestrictionList)?) ';'*\n;\n\nRestrictionList:\n\telements+=WildcardRestriction (',' elements+=WildcardRestriction)*\n;\n\nWildcardRestriction:\n\twildcard=WILDCARD\n;\n\nConsumedServiceElement:\n\tConsumedMethod | InteropOption\n;\n\nConsumedMethod:\n\tmethod=[Method|VALID_INTEROP_ID] ('[' options+=InteropOptionListItem (','  options+=InteropOptionListItem)* ']')? ';'+\n;\n\nProvidedService:\n\t'provides' service=[Service|FULL_ID] (('{'(elements+=ProvidedServiceElement)* '}') & ('as' alias=VALID_INTEROP_ID)? & ('to' restrictions=RestrictionList)?) ';'*\n;\n\nProvidedServiceElement:\n\tProvidedMethod | InteropOption\n;\n\nProvidedMethod:\n\tmethod=[Method|VALID_INTEROP_ID] ('[' options+=InteropOptionListItem (','  options+=InteropOptionListItem)* ']')? ';'+\n;\n\nInteropOptionListItem returns InteropOption: \n\t(-> CustomInteropOptionItem | PredefinedInteropOptionItem)\n;\n\nPredefinedInteropOptionItem returns InteropOption:\n\tdescriptor=[Field|SHORT_ID] -> '=' value=Constant\n;\n\nCustomInteropOptionItem returns InteropOption:\n\tisCustom?='(' descriptor=[Field|FULL_ID] ')' -> '=' value=Constant\n;\n\n\nINTEROP_KEYWORD:\n\t'application' | 'consumes' | 'provides'\n;\n \nVALID_INTEROP_ID:\n\t INTEROP_KEYWORD | SHORT_ID\t \n;\n\nWILDCARD:\n\t'*' | (FULL_ID ('*'|'.*')?)\n;"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/InteropLangRuntimeModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl\n\nimport com.google.inject.Binder\nimport org.eclipse.xtext.formatting2.FormatterPreferenceValuesProvider\nimport org.eclipse.xtext.formatting2.FormatterPreferences\nimport org.eclipse.xtext.preferences.IPreferenceValuesProvider\nimport org.eclipse.xtext.scoping.IGlobalScopeProvider\nimport org.eclipse.xtext.scoping.IScopeProvider\nimport com.google.inject.name.Names\nimport org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangLocalScopeProvider\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangGlobalScopeProvider\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangConfig\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangQualifiedNameProvider\n\n/**\n * Use this class to register components to be used at runtime / without the Equinox extension registry.\n */\nclass InteropLangRuntimeModule extends AbstractInteropLangRuntimeModule {\n\n\t// workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=495851\n\tdef void configureIPreferenceValuesProvider(Binder binder) {\n\t\tbinder.bind(IPreferenceValuesProvider).annotatedWith(FormatterPreferences).to(FormatterPreferenceValuesProvider)\n\t}\n\n\toverride def Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {\n\t\treturn typeof(ProtoLangGlobalScopeProvider);\n\t}\n\n\toverride configureIScopeProviderDelegate(Binder binder) {\n\t\tbinder.bind(IScopeProvider).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(\n\t\t\tProtoLangLocalScopeProvider);\n\t}\n\n\toverride Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {\n\t\treturn typeof(ProtoLangQualifiedNameProvider);\n\t}\n\n\tdef configureProtoLangConfig(Binder binder) {\n\t\tbinder.bind(typeof(ProtoLangConfig))\n\t\tbinder.bind(typeof(InteropLangUtils))\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/InteropLangStandaloneSetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl\n\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangConfig\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangStandaloneSetup\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.google.inject.Injector\nimport org.eclipse.emf.common.util.URI\nimport org.eclipse.emf.ecore.EPackage\nimport static com.db.plexus.interop.dsl.GlobalLangConfigHolder.*;\n/**\n * Initialization support for running Xtext languages without Equinox extension registry.\n */\nclass InteropLangStandaloneSetup extends InteropLangStandaloneSetupGenerated {\n\t\n\tprivate Injector protoLangInjector\n\tprivate Injector interopLangInjector\n\n\tdef Injector getInteropLangInjector() { \n\t\treturn interopLangInjector\t\n\t}\n\t\n\tdef Injector getProtoLangInjector() {\n\t\treturn protoLangInjector\n\t}\n\t\n\tdef void addBaseURI(URI baseURI) {\n\t\tprotoLangConfig.addBaseURI(baseURI)\n\t\tinteropLangConfig.addBaseURI(baseURI)\n\t}\n\t\n\tdef void removeBaseURI(URI baseURI) {\n\t\tprotoLangConfig.removeBaseURI(baseURI)\n\t\tinteropLangConfig.removeBaseURI(baseURI)\t\t\n\t}\n\t\t\t\t\t\t\t\n\toverride createInjectorAndDoEMFRegistration() {\n\t\tprotoLangInjector = new ProtoLangStandaloneSetup().createInjectorAndDoEMFRegistration()\n\t\tprotoLangConfig = protoLangInjector.getInstance(typeof(ProtoLangConfig))\n\t\tinteropLangInjector = createInjector();\n\t\tinteropLangConfig = interopLangInjector.getInstance(typeof(ProtoLangConfig))\n\t\tfor (uri: protoLangConfig.baseURIs) {\n\t\t\tinteropLangConfig.addBaseURI(uri)\n\t\t}\t\t\n\t\tregister(interopLangInjector);\n\t\treturn interopLangInjector;\n\t}\n\t\t\n\toverride register(Injector injector) {\n\t\tif (!EPackage.Registry.INSTANCE.containsKey(ProtobufPackage.eNS_URI)) {\n\t\t\tEPackage.Registry.INSTANCE.put(ProtobufPackage.eNS_URI, ProtobufPackage.eINSTANCE);\n\t\t}\t\t\n\t\tif (!EPackage.Registry.INSTANCE.containsKey(DslPackage.eNS_URI)) {\n\t\t\tEPackage.Registry.INSTANCE.put(DslPackage.eNS_URI, DslPackage.eINSTANCE);\n\t\t}\n\t\tsuper.register(injector)\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/InteropLangUtils.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl\n\nimport com.db.plexus.interop.dsl.protobuf.Message\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.google.inject.Inject\nimport org.eclipse.emf.ecore.EObject\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport org.eclipse.xtext.naming.QualifiedName\nimport org.eclipse.xtext.resource.IResourceDescription\nimport org.eclipse.xtext.resource.IResourceDescriptionsProvider\nimport com.google.inject.Singleton\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\n\n@Singleton\nclass InteropLangUtils {\n\t\n\tpublic static final String DESCRIPTOR_RESOURCE_PATH = \"interop/descriptor.proto\"\t\n\tpublic static final QualifiedName DESCRIPTOR_PACKAGE_NAME = QualifiedName.create(\"\", \"interop\")\n\t\n\t@Inject\n\tprotected IResourceDescriptionsProvider resourceDescriptionsProvider\n\n\t@Inject\n\tprotected ProtoLangImportResolver importResolver\n\n    @Inject\n    protected IQualifiedNameProvider qualifiedNameProvider\n\n    def public Message getDescriptorsContainer(InteropOption option) {\n\t\tval name = option.descriptorContainerName\n        val resourceSet = option.eResource.resourceSet\n\t\tval description = resourceSet.descriptorResourceDescription\n        if (description === null) {\n            val descriptorResource = importResolver.resolveResource(resourceSet, DESCRIPTOR_RESOURCE_PATH)\n            val message = descriptorResource.allContents\n                .filter(typeof(Message))\n                .findFirst[m | name.equals(qualifiedNameProvider.getFullyQualifiedName(m))]\n\t\t    return message;\n        }\n\t\tval objects = description.getExportedObjects(ProtobufPackage.Literals.MESSAGE, name, false)\n\t\tval message = objects.findFirst[x|true];\n\t\treturn if (message !== null) message.EObjectOrProxy as Message else null\n\t}\n\t\n\tdef public IResourceDescription getDescriptorResourceDescription(ResourceSet resourceSet) {\n\t\treturn importResolver.resolveResourceDescription(resourceSet, DESCRIPTOR_RESOURCE_PATH)\n\t}\n\t\n\tdef private static QualifiedName getDescriptorContainerName(InteropOption option) {\n\t\treturn DESCRIPTOR_PACKAGE_NAME.append(option.eContainer.optionDescriptorMessageName)\n\t}\n\t\n\tdef private static String getOptionDescriptorMessageName(EObject container) {\n\t\treturn switch (container) {\n\t\t\tApplication: \"ApplicationOptions\"\n\t\t\tProvidedService: \"ProvidedServiceOptions\"\n\t\t\tProvidedMethod: \"ProvidedMethodOptions\"\n\t\t\tConsumedService: \"ConsumedServiceOptions\"\n\t\t\tConsumedMethod: \"ConsumedMethodOptions\"\n\t\t\tdefault: throw new Exception(\"Unexpected option container: \" + container.eClass.name)\n\t\t}\n\t}\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/formatting2/InteropLangFormatter.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.formatting2\n\nimport com.db.plexus.interop.dsl.protobuf.formatting2.ProtoLangFormatter\n\nclass InteropLangFormatter extends ProtoLangFormatter {\t\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/generator/InteropLangGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.generator\n\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.generator.AbstractGenerator\nimport org.eclipse.xtext.generator.IFileSystemAccess2\nimport org.eclipse.xtext.generator.IGeneratorContext\n\n/**\n * Generates code from your model files on save.\n * \n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation\n */\nclass InteropLangGenerator extends AbstractGenerator {\n\n\toverride void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {\n//\t\tfsa.generateFile('greetings.txt', 'People to greet: ' + \n//\t\t\tresource.allContents\n//\t\t\t\t.filter(Greeting)\n//\t\t\t\t.map[name]\n//\t\t\t\t.join(', '))\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/scoping/InteropLangQualifiedNameProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.scoping\n\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangQualifiedNameProvider\n\nclass InteropLangQualifiedNameProvider extends ProtoLangQualifiedNameProvider {\n}\n\t\t"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/scoping/InteropLangScopeProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.scoping\n\nimport com.db.plexus.interop.dsl.ConsumedMethod\nimport com.db.plexus.interop.dsl.ConsumedService\nimport com.db.plexus.interop.dsl.DslPackage\nimport com.db.plexus.interop.dsl.InteropLangUtils\nimport com.db.plexus.interop.dsl.InteropOption\nimport com.db.plexus.interop.dsl.ProvidedMethod\nimport com.db.plexus.interop.dsl.ProvidedService\nimport com.db.plexus.interop.dsl.protobuf.Extend\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.google.inject.Inject\nimport org.eclipse.emf.ecore.EObject\nimport org.eclipse.emf.ecore.EReference\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.naming.QualifiedName\nimport org.eclipse.xtext.scoping.IScope\nimport org.eclipse.xtext.scoping.Scopes\nimport org.eclipse.xtext.scoping.impl.SimpleScope\n\n/**\n * This class contains custom scoping description.\n * \n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping\n * on how and when to use it.\n */\nclass InteropLangScopeProvider extends AbstractInteropLangScopeProvider {\n\t\n\t@Inject\n\tInteropLangUtils utils\n\n\toverride getScope(EObject context, EReference reference) {\n\t\t\n\t\tif (context instanceof ConsumedMethod && reference == DslPackage.Literals.CONSUMED_METHOD__METHOD) {\n\t\t\tval consumedService = EcoreUtil2.getContainerOfType(context, typeof(ConsumedService))\n\t\t\tval service = consumedService.service\n\t\t\tval serviceMethods = EcoreUtil2.getAllContentsOfType(service, typeof(Method))\n\t\t\treturn Scopes.scopeFor(serviceMethods)\n\t\t}\n\t\t\n\t\tif (context instanceof ProvidedMethod && reference == DslPackage.Literals.PROVIDED_METHOD__METHOD) {\n\t\t\tval providedService = EcoreUtil2.getContainerOfType(context, typeof(ProvidedService))\n\t\t\tval service = providedService.service\n\t\t\tval serviceMethods = EcoreUtil2.getAllContentsOfType(service, typeof(Method))\n\t\t\treturn Scopes.scopeFor(serviceMethods)\n\t\t}\n\t\t\n\t\tif (context instanceof InteropOption && reference == ProtobufPackage.Literals.OPTION__DESCRIPTOR) {\n\t\t\tval option = context as InteropOption\n\t\t\tval optionMsg = utils.getDescriptorsContainer(option)\n\t\t\tif (optionMsg === null) {\n\t\t\t\treturn super.getScope(context, reference);\n\t\t\t}\n\t\t\tif (option.isCustom) {\n\t\t\t\tval superScope = super.getScope(context, reference).allElements\n\t\t\t\tval extendFields = \n\t\t\t\t\tsuperScope\n\t\t\t\t\t\t.filter[x | x.EClass.equals(ProtobufPackage.Literals.FIELD)]\n\t\t\t\t\t\t.filter[x | x.EObjectOrProxy.eContainer instanceof Extend]\n\t\t\t\t\t\t.filter[x | (x.EObjectOrProxy.eContainer as Extend).message.equals(optionMsg)]\n\t\t\t\treturn new SimpleScope(extendFields)\n\t\t\t} else {\n\t\t\t\tval optionFields = optionMsg.elements.filter(typeof(Field))\n\t\t\t\treturn Scopes.scopeFor(optionFields, [x|QualifiedName.create(x.name)], IScope.NULLSCOPE)\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn super.getScope(context, reference);\n\t}\t\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/java/com/db/plexus/interop/dsl/validation/InteropLangValidator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.validation\n\nimport com.db.plexus.interop.dsl.ConsumedMethod\nimport com.db.plexus.interop.dsl.DslPackage\nimport com.db.plexus.interop.dsl.ProvidedMethod\nimport com.db.plexus.interop.dsl.ProvidedService\nimport com.db.plexus.interop.dsl.InteropOption\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.validation.Check\n\n/**\n * This class contains custom validation rules. \n *\n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation\n */\nclass InteropLangValidator extends AbstractInteropLangValidator {\n\n\toverride def isLanguageSpecific() {\n\t\tfalse\n\t}\n\n\t@Check\n\tdef checkUniqueConsumedMethod(ConsumedMethod consumedMethod) {\n\t\tfor (otherConsumedMethod : EcoreUtil2.getSiblingsOfType(consumedMethod, typeof(ConsumedMethod))) {\n\t\t\tif (otherConsumedMethod.method.equals(consumedMethod.method)) {\n\t\t\t\terror(\"Duplicated consumed method definition: \" + consumedMethod.method.name, DslPackage.Literals.CONSUMED_METHOD__METHOD);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Check\n\tdef checkUniqueProvidedMethod(ProvidedMethod providedMethod) {\n\t\tfor (otherProvidedMethod : EcoreUtil2.getSiblingsOfType(providedMethod, typeof(ProvidedMethod))) {\n\t\t\tif (otherProvidedMethod.method.equals(providedMethod.method)) {\n\t\t\t\terror(\"Duplicated provided method definition: \" + providedMethod.method.name, DslPackage.Literals.PROVIDED_METHOD__METHOD);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Check\n\tdef checkProvidedServiceHasNoAlias(ProvidedService providedService) {\n\t\tif (providedService.alias !== null && !providedService.alias.isEmpty()) {\n\t\t\terror(\"Provided service alias not empty: \" + providedService.alias, DslPackage.Literals.PROVIDED_SERVICE__ALIAS);\n\t\t}\n\t}\n\n\t@Check\n\tdef checkUniqueProvidedService(ProvidedService providedService) {\n\t\tfor (otherProvidedService : EcoreUtil2.getSiblingsOfType(providedService, typeof(ProvidedService))) {\n\t\t\tif (otherProvidedService.service.name.equals(providedService.service.name)) {\n\t\t\t\terror(\"Duplicated provided service definition: \" + providedService.service.name, DslPackage.Literals.PROVIDED_SERVICE__SERVICE);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Check\n\tdef checkUniqueProvidedServiceOption(ProvidedService providedService) {\n\t\tvar options = EcoreUtil2.typeSelect(providedService.elements, typeof(InteropOption))\n\t\tfor (var i = 1; i < options.size(); i++) {\n\t\t\tfor (var j = 0; j < i; j++) {\n\t\t\t\tvar name = options.get(i).descriptor.name\n\t\t\t\tif (name.equals(options.get(j).descriptor.name)) {\n\t\t\t\t\terror(\"Duplicated option definition: \" + name, DslPackage.Literals.PROVIDED_SERVICE__ELEMENTS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_connection_descriptor.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax=\"proto3\";\n\npackage interop;\n\nimport \"interop/unique_id.proto\";\n\nmessage AppConnectionDescriptor {\n    UniqueId connection_id = 1;\n    string app_id = 2;\n    UniqueId app_instance_id = 3;\n    TransportType transport_type = 4;\n}\n\nenum TransportType {\n    Unknown = 0;\n    Pipe = 1;\n    Ws = 2;\n    Wss = 3;\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_launch_mode.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nenum AppLaunchMode {\t\n\tSINGLE_INSTANCE = 0;\n\tMULTI_INSTANCE = 1;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_launcher_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"google/protobuf/empty.proto\";\n\nimport \"interop/unique_id.proto\";\nimport \"interop/app_launch_mode.proto\";\n\nservice AppLauncherService {\n\trpc Launch(AppLaunchRequest) returns (AppLaunchResponse);\n\n\trpc AppLaunchedEventStream(.google.protobuf.Empty) returns (stream AppLaunchedEvent);\n}\n\nmessage AppLaunchRequest {\n\tstring app_id = 1;\n\tstring launch_params_json = 2;\n\tAppLaunchMode launch_mode = 3;\n\tUniqueId suggested_app_instance_id = 4;\n\tAppLaunchReferrer referrer = 5;\n}\n\nmessage AppLaunchReferrer {\n\tstring app_id = 1;\n\tUniqueId app_instance_id = 2;\t\n\tUniqueId connection_id = 3;\n}\n\nmessage AppLaunchResponse {\n\tUniqueId app_instance_id = 1;\n}\n\n message AppLaunchedEvent {\n \tUniqueId app_instance_id = 1;\n\trepeated string app_ids = 2;\n\tAppLaunchReferrer referrer = 3;\n }\n"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_lifecycle_manager.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage interop;\n\nimport \"interop/app_launcher_service.proto\";\nimport \"interop/app_lifecycle_service.proto\";\nimport \"interop/app_metadata_service.proto\";\nimport \"interop/context_linkage.proto\";\nimport \"interop/app_registration_service.proto\";\n\napplication AppLifecycleManager {\n\n\tconsumes AppLauncherService { Launch; AppLaunchedEventStream; }\n\n\tprovides AppLifecycleService { ResolveApp; GetLifecycleEventStream; GetInvocationEventStream; GetConnections; GetConnectionsStream; }\n\n\tprovides AppMetadataService { GetAppMetadataChangedEventStream; GetMetamodelChangedEventStream; }\n\n\tprovides ContextLinkageService {\n\t\tContextLoadedStream;\n\t\tCreateContext;\n\t\tCreateContext2;\n\t\tJoinContext;\n\t\tGetContexts;\n\t\tGetLinkedInvocations;\n\t\tGetAllLinkedInvocations;\n\t\tAppJoinedContextStream;\n\t\tRestoreContextsLinkage;\n\t}\n\n\tprovides AppRegistrationService { RequestInstanceId; RegisterInstanceId; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_lifecycle_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"interop/unique_id.proto\";\nimport \"interop/app_launch_mode.proto\";\nimport \"interop/app_connection_descriptor.proto\";\nimport \"interop/invocation_descriptor.proto\";\nimport \"google/protobuf/empty.proto\";\n\nservice AppLifecycleService {\n\trpc ResolveApp (ResolveAppRequest) returns (ResolveAppResponse);\n\trpc GetLifecycleEventStream (google.protobuf.Empty) returns (stream AppLifecycleEvent);\n\trpc GetInvocationEventStream (google.protobuf.Empty) returns (stream InvocationEvent);\n\trpc GetConnections (GetConnectionsRequest) returns (GetConnectionsResponse);\n\trpc GetConnectionsStream (GetConnectionsRequest) returns (stream GetConnectionsEvent);\n}\n\nmessage ResolveAppRequest {\n\tstring app_id = 1;\n\tAppLaunchMode app_resolve_mode = 2;\n}\n\nmessage ResolveAppResponse {\n\tUniqueId app_instance_id = 1;\n\tUniqueId app_connection_id = 2;\n\tbool is_new_instance_launched = 3;\n}\n\nmessage AppLifecycleEvent {\t\n\toneof event {\n\t\tAppConnectedEvent connected = 1;\n\t\tAppDisconnectedEvent disconnected = 2;\n\t\tAppConnectionErrorEvent error = 3;\n\t}\n}\n\nmessage InvocationEvent {\n\toneof event {\n\t\tInvocationStartedEvent invocation_started = 1;\n\t\tInvocationFinishedEvent invocation_finished = 2;\n\t}\n}\n\nmessage AppConnectedEvent {\n\tAppConnectionDescriptor connection_descriptor = 1;\n}\n\nmessage AppDisconnectedEvent {\n\tAppConnectionDescriptor connection_descriptor = 1;\t\n}\n\nmessage AppConnectionErrorEvent {\n\tAppConnectionDescriptor connection_descriptor = 1;\n}\n\nmessage InvocationStartedEvent {\t\n\tInvocationDescriptor invocation_descriptor = 1;\n}\n\nmessage InvocationFinishedEvent {\n\tInvocationDescriptor invocation_descriptor = 1;\n\tInvocationResult result = 2;\n\tint64 duration_ms = 3;\n}\n\nenum InvocationResult {\n\tSucceeded = 0;\n\tCanceled = 1;\n\tFailed = 2;\n}\n\nmessage GetConnectionsRequest {\n\tstring application_id = 1;\n\tUniqueId app_instance_id = 2;\n\tUniqueId connection_id = 3;\n}\n\nmessage GetConnectionsResponse {\n\trepeated AppConnectionDescriptor connections = 1;\n}\n\nmessage GetConnectionsEvent {\n\trepeated AppConnectionDescriptor connections = 1;\n\toneof event {\n\t\tAppConnectionDescriptor new_connection = 2;\n\t\tAppConnectionDescriptor closed_connection = 3;\n\t}\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_metadata_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"interop/unique_id.proto\";\nimport \"interop/app_launch_mode.proto\";\nimport \"interop/app_connection_descriptor.proto\";\nimport \"interop/invocation_descriptor.proto\";\nimport \"google/protobuf/empty.proto\";\n\nservice AppMetadataService {\n    rpc GetAppMetadataChangedEventStream (google.protobuf.Empty) returns (stream AppMetadataChangedEvent);\n    rpc GetMetamodelChangedEventStream (google.protobuf.Empty) returns (stream MetamodelChangedEvent);\n}\n\nmessage AppMetadataChangedEvent {\n    repeated AppMetadataInfo apps = 1;\n}\n\nmessage AppMetadataInfo {\n    string id = 1;\n    string display_name = 2;\n    string launcher_id = 3;\n    repeated OptionParameter launcher_params = 4;\n}\n\nmessage MetamodelChangedEvent {\n    repeated .interop.AppMetamodelInfo applications = 1;\n    repeated Service services = 2;\n}\n\nmessage AppMetamodelInfo {\n    string id = 1;\n    repeated ConsumedService consumed_services = 2;\n    repeated ProvidedService provided_services = 3;\n}\n\nmessage ProvidedService {\n    string service_id = 1;\n    string alias = 2;\n    repeated ProvidedMethod methods =3;\n}\n\nmessage ConsumedService {\n    string service_id = 1;\n    string alias = 2;\n    repeated ConsumedMethod methods = 3;\n}\n\nmessage ConsumedMethod {\n    string name = 1;\n}\n\nmessage ProvidedMethod {\n    string name = 1;\n    string title = 2;\n    enum MetamodelLaunchMode {\n        None = 0;\n        SingleInstance = 1;\n        MultiInstance = 2;\n    }\n    MetamodelLaunchMode launch_mode = 3;\n    int32 timeout_ms = 4;\n    repeated OptionParameter options = 5;\n}\n\nmessage Service {\n    string id = 1;\n    repeated MethodInfo methods = 2;\n    repeated OptionParameter options = 3;\n}\n\nmessage MethodInfo {\n    string name = 1;\n    string request_message_id = 3;\n    string response_message_id = 4;\n    enum MethodType {\n        Unary = 0;\n        ServerStreaming = 1;\n        ClientStreaming = 2;\n        DuplexStreaming = 3;\n    }\n    MethodType type = 5;\n}\n\nmessage OptionParameter {\n    string key = 1;\n    string value = 2;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/app_registration_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"interop/unique_id.proto\";\n\nservice AppRegistrationService {\n\trpc RequestInstanceId(RequestInstanceIdRequest) returns (UniqueId);\n\trpc RegisterInstanceId(RegisterInstanceIdRequest) returns (RegisterInstanceIdResponse);\n}\n\nmessage RequestInstanceIdRequest {\n}\n\nmessage RegisterInstanceIdRequest {\n\tUniqueId app_instance_id = 1;\n}\n\nmessage RegisterInstanceIdResponse { }"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/command_line_tool.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage interop;\n\nimport \"interop/app_lifecycle_service.proto\";\n\napplication CommandLineTool {\n\n\tconsumes AppLifecycleService from interop.AppLifecycleManager { ResolveApp; }\n\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/context_linkage.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"google/protobuf/empty.proto\";\nimport \"interop/unique_id.proto\";\nimport \"interop/app_connection_descriptor.proto\";\nimport \"interop/app_metadata_service.proto\";\n\nmessage Context {\n\tstring id = 1;\n\tbool own = 2;\n\tstring kind = 3;\n}\n\nmessage ContextsList {\n\trepeated Context contexts = 1;\n}\n\nmessage CreateContextRequest {\n\tstring kind = 1;\n}\n\nenum ContextLoadingStatus {\n\t// intermediate state, some of apps within context already loaded\n\tIN_PROGRESS = 0;\n\t// termination state, some of apps failed to start/connect to plexus, no more apps \"in progress\"\n\tFAILED = 1;\n\t// termination state, all apps within context are loaded\n\tFINISHED = 2;\n}\n\nmessage ContextLoadingUpdate {\n\tContextLoadingStatus status = 1;\n\t// loaded apps within context at this moment of time\n\trepeated interop.AppConnectionDescriptor loaded_app_descriptors = 2;\n\t// apps registered in context, but failed to load\n\trepeated interop.AppConnectionDescriptor failed_app_descriptors = 3;\n}\n\nmessage InvocationRef {\n\tinterop.AppMetamodelInfo app_info = 1;\n\tinterop.AppConnectionDescriptor target = 2;\n}\n\nmessage InvocationsList {\n\trepeated InvocationRef invocations = 1;\n}\n\nmessage ContextToInvocations {\n\tContext context = 1;\n\tInvocationsList invocations = 2;\n}\n\nmessage ContextToInvocationsList {\n\trepeated ContextToInvocations contexts = 1;\n}\n\nmessage AppJoinedContextEvent {\n\tContext context = 1;\t\n    UniqueId app_instance_id = 2;\n}\n\nmessage RestoreContextsLinkageRequest {\n\trepeated RestoringAppInstance apps = 1;\n}\n\nmessage RestoringAppInstance {\n\tUniqueId app_instance_id = 1;\n\trepeated string app_ids = 2;\n\trepeated string context_ids = 3 [deprecated=true];\n\trepeated Context contexts = 4;\n}\n\nmessage RestoreContextsLinkageResponse {\n\tmap<string, Context> created_contexts_map = 1;\n}\n\nservice ContextLinkageService {\n\t/**\n\t* Stream, provides status of context loading, order and loading status of linked applications. Only context id required.\n\t*/\n\trpc ContextLoadedStream(Context) returns (stream ContextLoadingUpdate);\n\n\t/**\n\t* Deprecated, use CreateContext2 instead. Creates new context and associates running instance to it.\n\t*/\n\trpc CreateContext(google.protobuf.Empty) returns (Context) {\n\t\toption deprecated = true;\n\t};\n\n\t/**\n\t* Creates new context and associates running instance to it.\n\t*/\n\trpc CreateContext2(CreateContextRequest) returns (Context);\n\n\t/**\n\t* Associates running instance with provided context, useful if we want to link already running instance. Only context id required.\n\t*/\n\trpc JoinContext(Context) returns (google.protobuf.Empty);\n\n\t/**\n\t* Get list of associated contexts\n\t*/\n\trpc GetContexts(google.protobuf.Empty) returns (ContextsList);\n\n\t/**\n\t* Discover list of linked invocations for specified context. Only context id required.\n\t*/\n\trpc GetLinkedInvocations(Context) returns (InvocationsList);\n\n\t/**\n\t* Get Linked Invocations for all associated contexts\n\t*/\n\trpc GetAllLinkedInvocations(google.protobuf.Empty) returns (ContextToInvocationsList);\n\n\trpc AppJoinedContextStream(google.protobuf.Empty) returns (stream AppJoinedContextEvent);\n\n\trpc RestoreContextsLinkage(RestoreContextsLinkageRequest) returns (RestoreContextsLinkageResponse);\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/descriptor.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto2\";\n\npackage interop;\n\nmessage ApplicationOptions {\n\toptional string title = 1;\n\toptional ApplicationLaunchOnCallMode launch_on_call = 2;\n\n\textensions 1000 to max;\n}\n\nmessage ProvidedServiceOptions {\n\toptional string title = 1;\n\toptional ApplicationLaunchOnCallMode launch_on_call = 2;\n\n\textensions 1000 to max;\n}\n\nmessage ConsumedServiceOptions {\n\textensions 1000 to max;\n}\n\nmessage ProvidedMethodOptions {\n\toptional string title = 1;\n\toptional ApplicationLaunchOnCallMode launch_on_call = 2;\n\toptional uint32 timeout_ms = 3;\n\n\textensions 1000 to max;\n}\n\nmessage ConsumedMethodOptions {\n\n\textensions 1000 to max;\n}\n\nenum ApplicationLaunchOnCallMode {\n\toption allow_alias = true;\n\tIF_NOT_LAUNCHED = 0;\n\tDEFAULT = 0;\n\tALWAYS = 1;\n\tENABLED = 1;\n\tNEVER = 2;\n\tDISABLED = 2;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/invocation_descriptor.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax=\"proto3\";\n\nimport \"interop/app_connection_descriptor.proto\";\n\npackage interop;\n\nmessage InvocationDescriptor {\n\tstring service_id = 1;\n\tstring service_alias_id = 2;\n    string method_id = 3;\n\tAppConnectionDescriptor source = 4;\n\tAppConnectionDescriptor target = 5;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/native_app_launcher.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage interop;\n\nimport \"interop/app_launcher_service.proto\";\n\napplication NativeAppLauncher {\n\n\tprovides AppLauncherService to plexus.interop.AppLifecycleManager { Launch; AppLaunchedEventStream; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/options.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n\tstring message_id = 9650;\n}\n\nextend google.protobuf.ServiceOptions {\n\tstring service_id = 9650;\n}\n\nextend google.protobuf.MethodOptions {\n\tstring method_id = 9650;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/echo_client.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage interop.testing;\n\nimport \"interop/testing/echo_service.proto\";\nimport \"interop/testing/greeting_service.proto\";\nimport \"interop/app_lifecycle_service.proto\";\nimport \"interop/context_linkage.proto\";\n\napplication EchoClient {\n\t\n\tconsumes interop.testing.EchoService from interop.testing.* { Unary; ServerStreaming; ClientStreaming; DuplexStreaming; }\n\n\tconsumes interop.testing.GreetingService from interop.testing.* { Hello; } \n\n\tconsumes interop.AppLifecycleService from interop.AppLifecycleManager { GetConnections; GetConnectionsStream; }\n\t\t\n\tconsumes interop.ContextLinkageService { ContextLoadedStream; CreateContext2; JoinContext; GetContexts; GetLinkedInvocations; GetAllLinkedInvocations; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/echo_server.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage interop.testing;\n\nimport \"interop/testing/echo_service.proto\";\nimport \"interop/testing/echo_service_options.proto\";\nimport \"interop/testing/greeting_service.proto\";\n\napplication EchoServer {\n\n    consumes interop.testing.EchoService from interop.testing.* { Unary; ServerStreaming; ClientStreaming; DuplexStreaming; }\n\n\tconsumes interop.testing.GreetingService from interop.testing.* { Hello; } \n\n\tprovides interop.testing.EchoService to interop.testing.* {\n\t\toption title = \"Sample Echo Service\";\n\t\tUnary [title = \"Sample Unary Method\", (interop.testing.string_option)=\"some string\", (interop.testing.enum_option)=VALUE_TWO];\n\t\tServerStreaming [title = \"Sample Server Streaming Method\"];\n\t\tClientStreaming [title = \"Sample Client Streaming Method\"]; \n\t\tDuplexStreaming [title = \"Sample Duplex Streaming Method\"]; \n\t}\n\n\tprovides interop.testing.GreetingService to interop.testing.* { Hello; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/echo_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop.testing;\n\nservice EchoService {\n\trpc Unary (EchoRequest) returns (EchoRequest);\n\trpc ServerStreaming (EchoRequest) returns (stream EchoRequest);\n\trpc ClientStreaming (stream EchoRequest) returns (EchoRequest);\n\trpc DuplexStreaming (stream EchoRequest) returns (stream EchoRequest);\n}\n\nmessage EchoRequest {\n\tstring string_field = 1;\n\tint64 int64_field = 2;\n\tuint32 uint32_field = 3;\n\trepeated double repeated_double_field = 4;\n\tSubEnum enum_field = 5;\n\tSubMessage sub_message_field = 6;\n\trepeated SubMessage repeated_sub_message_field = 7;\n\n\tmessage SubMessage {\n\t\tbytes bytes_field = 1;\n\t\tstring string_field = 2;\n\t}\n\n\tenum SubEnum {\n\t\tVALUE_ONE = 0;\n\t\tVALUE_TWO = 1;\n\t}\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/echo_service_options.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto2\";\n\npackage interop.testing;\n\nimport \"interop/descriptor.proto\";\nimport \"interop/testing/echo_service.proto\";\n\nextend .interop.ProvidedMethodOptions {\n\toptional string string_option = 1500;\n\toptional EchoRequest.SubEnum enum_option = 1501;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/greeting_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop.testing;\n\nservice GreetingService {\n\trpc Hello (GreetingRequest) returns (GreetingResponse);\n}\n\nmessage GreetingRequest {\n\tstring name = 1;\n}\n\nmessage GreetingResponse {\n\tstring greeting = 1;\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/testing/test_app_launcher.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/app_launcher_service.proto\";\nimport \"interop/app_lifecycle_service.proto\";\nimport \"interop/app_registration_service.proto\";\nimport \"interop/context_linkage.proto\";\n\npackage interop.testing;\n\napplication TestAppLauncher {\n\n\tprovides .interop.AppLauncherService to interop.AppLifecycleManager { Launch; AppLaunchedEventStream; }\n\n\tconsumes .interop.ContextLinkageService { ContextLoadedStream; CreateContext; JoinContext; GetContexts; GetLinkedInvocations; GetAllLinkedInvocations; }\n\tconsumes .interop.AppLifecycleService from interop.AppLifecycleManager { GetLifecycleEventStream; GetInvocationEventStream; }\n\tconsumes .interop.AppRegistrationService { RequestInstanceId; RegisterInstanceId; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/main/resources/interop/unique_id.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop;\n\n// Stores UUID in little-endian format (i.e. reversed).\n// To convert to bytes on little-endian systems (most common case): concat (toBytes(hi), toBytes(lo))\n// To convert to bytes on big-endian systems need to additionally reverse \"hi\" and \"lo\" parts: concat( reverse(toBytes(hi)), reverse(toBytes(lo)) )\nmessage UniqueId {\n    fixed64 lo = 1;\n    fixed64 hi = 2;\n}"
  },
  {
    "path": "dsl/interop-lang/src/test/java/com/db/plexus/interop/dsl/tests/InteropLangInjectionProvider.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.tests;\n\nimport org.eclipse.xtext.testing.IInjectorProvider;\n\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup;\nimport com.google.inject.Injector;\n\npublic class InteropLangInjectionProvider implements IInjectorProvider {\n    @Override\n    public Injector getInjector() {\n        return new InteropLangStandaloneSetup().createInjectorAndDoEMFRegistration();\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/test/java/com/db/plexus/interop/dsl/tests/InteropLangParsingTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.tests\n\nimport com.google.inject.Inject\nimport org.eclipse.xtext.testing.InjectWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Assert\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.emf.common.util.URI\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.validation.IResourceValidator\nimport org.eclipse.xtext.validation.CheckMode\nimport org.eclipse.xtext.util.CancelIndicator\n\n@RunWith(XtextRunner)\n@InjectWith(InteropLangInjectionProvider)\nclass InteropLangParsingTest {\n\n\t@Inject\n\tResourceSet rs\n\n\t@Inject\n\tIResourceValidator validator\n\n\t@Test\n\tdef loadModel() {\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(\"com/db/plexus/interop/dsl/tests/example1.interop\").toURI().toString())\n\t\tAssert.assertEquals(0, rs.resources.length)\n\t\trs.getResource(uri, true)\n\t\tEcoreUtil2.resolveAll(rs);\n\t\tval allResources = rs.resources\n\t\tfor (r : allResources) {\n\t\t\tvalidateResource(r)\n\t\t}\n\t\tAssert.assertEquals(5, allResources.length)\t\n\t}\n\n\t@Test\n\tdef parseFilesWithPredefinedResources() {\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(\"com/db/plexus/interop/dsl/tests/example3.interop\").toURI().toString())\n\t\tAssert.assertEquals(0, rs.resources.length)\n\t\trs.getResource(uri, true)\n\t\tEcoreUtil2.resolveAll(rs);\n\t\tval allResources = rs.resources\n\t\tfor (r : allResources) {\n\t\t\tvalidateResource(r)\n\t\t}\n\t\tAssert.assertTrue(allResources.length > 0)\t\n\t}\n\n\t@Test\n\tdef provideServiceAsAlias() {\n\t\tcheckIncorrectMetadataValidation(\"provide_as_alias.interop\")\n\t}\n\n\t@Test\n\tdef provideDuplicateService() {\n\t\tcheckIncorrectMetadataValidation(\"provide_duplicate.interop\")\n\t}\n\n\t@Test\n\tdef duplicateOption() {\n\t\tcheckIncorrectMetadataValidation(\"provide_duplicate_option.interop\")\n\t}\n\n\tdef checkIncorrectMetadataValidation(String fileName) {\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(\"com/db/plexus/interop/dsl/tests/\" + fileName).toURI().toString())\n\t\tval r = rs.getResource(uri, true)\n\t\tval issues = getValidationIssues(r)\n\t\tAssert.assertTrue(\"Validation did not reveal any problems with incorrect metadata \" + fileName, issues.length > 0)\n\t}\n\n\tdef validateResource(Resource r) {\n\t\tval issues = getValidationIssues(r)\n\t\tAssert.assertEquals(0, issues.length)\n\t}\n\n\tdef getValidationIssues(Resource r) {\n\t\tSystem.out.println(\"Validating \" + r.URI)\n\t\tval issues = validator.validate(r, CheckMode.ALL, CancelIndicator.NullImpl)\n\t\tfor (issue : issues) {\n\t\t\tSystem.err.println(issue)\n\t\t}\n\t\tSystem.out.flush()\n\t\tSystem.err.flush()\n\t\treturn issues;\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/example1.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\nimport \"com/db/plexus/interop/dsl/tests/example1.proto\";\nimport \"com/db/plexus/interop/dsl/tests/subfolder/example2.proto\";\n\napplication App1 {\n\n\tconsumes Service1 from plexus.interop.*, com.db.plexus.interop.* {  Do; DoAgain; }\n\t\n\tconsumes Service1 { Do; DoAgain; } as MyAlias from plexus.interop.*, com.db.plexus.interop.*;\n\t\n\tprovides subfolder.Service2 { \n\t\tHello [title=\"Sample Hello Method\"];\n\t}\n}"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/example1.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.tests;\n\nmessage Message1 {\n}\n\nservice Service1 {\n\trpc Do (Message1) returns (Message1);\n\trpc DoAgain (Message1) returns (Message1);\n}"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/example2.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\napplication App1 {\n}\n\napplication App1 { }"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/example3.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\nimport \"interop/app_launcher_service.proto\";\n\napplication ElectronAppLauncher {\n\tprovides .interop.AppLauncherService { Launch; }\n}"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/provide_as_alias.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\nimport \"com/db/plexus/interop/dsl/tests/example1.proto\";\n\napplication App1 {\n\tprovides Service1 as ServiceAlias { Do; }\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/provide_duplicate.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\nimport \"com/db/plexus/interop/dsl/tests/example1.proto\";\n\napplication App1 {\n\tprovides Service1 { Do; }\n\tprovides Service1 { Do; }\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/provide_duplicate_option.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage com.db.plexus.interop.dsl.tests;\n\nimport \"com/db/plexus/interop/dsl/tests/example1.proto\";\n\napplication App1 {\n\tprovides Service1 {\n\t\toption title = \"Test Service\";\n\t\toption title = \"Test Service\";\n\t\tDo;\n\t}\n}\n"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/subfolder/example2.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.tests.subfolder;\n\nmessage Message2 {\n\tmessage Message2 {\n\t}\n}\n\nservice Service2 {\n\trpc Hello (Message2) returns (stream Message2.Message2);\n}"
  },
  {
    "path": "dsl/interop-lang/src/test/resources/com/db/plexus/interop/dsl/tests/wrong.interop",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.tests;\n\nmessage Message1 {\n}\n\nservice Service1 {\n\trpc Do (Message1) returns (Message1);\n}\n\nservice Service1 {\n}"
  },
  {
    "path": "dsl/interop-lang-vscode/.gitignore",
    "content": "\ninterop-lang-server/\nproto-lang-server/\nout/\nbuild/\n*.vsix\n.npmrc"
  },
  {
    "path": "dsl/interop-lang-vscode/.vscode/launch.json",
    "content": "// A launch configuration that compiles the extension and then opens it inside a new window\n{\n    \"version\": \"0.1.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Launch Extension\",\n            \"type\": \"extensionHost\",\n            \"request\": \"launch\",\n            \"runtimeExecutable\": \"${execPath}\",\n            \"args\": [\"--extensionDevelopmentPath=${workspaceRoot}\" ],\n            \"outFiles\": [\n\t\t\t\t\"${workspaceRoot}/out/src/**/*.js\"\n\t\t\t],\n            \"env\": {\n                \"PLEXUS_INTEROP_LS_PORT\": \"5555\",\n                \"PLEXUS_PROTO_LS_PORT\": \"5556\"\n            }\n        }\n    ]\n}\n"
  },
  {
    "path": "dsl/interop-lang-vscode/.vscode/tasks.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=733558\n    // for the documentation about the tasks.json format\n    \"version\": \"0.1.0\",\n    \"command\": \"npm\",\n    \"isShellCommand\": true,\n    \"args\": [\"run\", \"compile\", \"--loglevel\", \"silent\"],\n    \"showOutput\": \"silent\",\n    \"isBackground\": true,\n    \"problemMatcher\": \"$tsc-watch\"\n}"
  },
  {
    "path": "dsl/interop-lang-vscode/.vscodeignore",
    "content": "**/*.ts\n**/tsconfig.json\n.vscode\nbuild\n.gradle\n.npmrc\n"
  },
  {
    "path": "dsl/interop-lang-vscode/README.md",
    "content": "\n# plexus-interop-vscode\n\nPlexus Interop Language support for Visual Studio Code\n\n## Features\n\n* .interop files syntax highlighting\n* .interop files syntax validation\n* .proto files syntax highlighting \n* .proto files syntax validation\n* Cross references validation and code assistance\n* Imports resolution and code assistance\n\n![demo-gif](images/plexus-vscode-short.gif) \n\n## Usage\n\nOpen base directory of Plexus Interop Metadata and start editing interop and proto files."
  },
  {
    "path": "dsl/interop-lang-vscode/build.gradle",
    "content": "plugins {\n    id \"com.moowork.node\" version \"1.2.0\"\n}\n\ndef customNpmVersion = '5.7.1'\n\nnode {\n    version = '8.5.0'\n    npmVersion = customNpmVersion\n    nodeModulesDir = projectDir\n    download = true\n}\n\ndef ciBuild = System.env['BuildRunner'] != null\ndef ciPublishBuild = ciBuild && (System.env['APPVEYOR_REPO_TAG'] == \"true\" || System.env['PLEXUS_BUILD_VSCODE_PUBLISH'] == \"true\")\ndef packageVersion = System.env[\"PLEXUS_BUILD_VSCODE_PACKAGE_VERSION\"] ?: (System.env[\"APPVEYOR_REPO_TAG_NAME\"] ?: System.env[\"PackageVersion\"])\n// NPM config settings\ndef npmRegistry = System.env['NPM_REGISTRY']\ndef npmEmail = System.env['NPM_AUTH_USER']\ndef npmAuth = System.env['NPM_AUTH_TOKEN']\n\ntasks.npmSetup.dependsOn(\"genNpmrc\")\n\ntask genNpmrc() {\n    doLast {\n        def content = \"\"\"\n# Auto generated by Gradle build\n${npmRegistry != null ? \"registry=\" + npmRegistry : \"\"}\n${npmEmail != null ? \"email=\" + npmEmail : \"\"}\n${npmAuth != null ? \"_auth=\" + npmAuth : \"\"}\n        \"\"\"\n        def npmConfigFolder = \"$projectDir/.gradle/npm/npm-v$customNpmVersion/etc\"\n        file(npmConfigFolder).mkdirs()\n        // global config\n        file(\"$npmConfigFolder/npmrc\").text = content\n        // user config\n        file(\"$projectDir/.npmrc\").text = content\n    }\n}\n\ntask installServer(type: Copy) {\n\tdependsOn(':dsl:interop-lang.ide:installDist')\n    from \"../interop-lang.ide/build/install/interop-lang-server\"\n    into \"interop-lang-server\"\n}\n\ntask installProtoServer(type: Copy) {\n    dependsOn(':dsl:proto-lang.ide:installDist')\n    from \"../proto-lang.ide/build/install/proto-lang-server\"\n    into \"proto-lang-server\"\n}\n\ntask npmVersion(type: NpmTask) {\n    args = ['--version']\n}\n\ntask npmRunInstall(type: NpmTask, dependsOn: npmVersion) {\n    args = ['install']\n}\n\ntasks.npmRunInstall.dependsOn(\"genNpmrc\")\n\ntask preNpmBuild {\n    doLast {\n        println \"VSCode Package version: $packageVersion\"\n\t    println \"CI Publish: $ciPublishBuild\"\n    }\n}\n\ntask npmBuild(type: NpmTask, dependsOn: ['npmRunInstall', 'installProtoServer', 'installServer', 'preNpmBuild']) {\n    environment = [\n        'PLEXUS_BUILD_VSCODE_PACKAGE_VERSION': packageVersion\n    ]\n    args = ciPublishBuild && !packageVersion.contains(\"-\") ? ['run', 'ci-publish'] : ['run', 'build']\n}\n\nbuild.dependsOn npmBuild\n"
  },
  {
    "path": "dsl/interop-lang-vscode/interop.configuration.json",
    "content": "{\n    \"comments\": {\n        \"lineComment\": \"//\",\n        \"blockComment\": [ \"/*\", \"*/\" ]\n    },\n    \"brackets\": [\n        [\"{\", \"}\"],\n        [\"[\", \"]\"],\n        [\"(\", \")\"]\n    ],\n    \"autoClosingPairs\": [\n        [\"{\", \"}\"],\n        [\"[\", \"]\"],\n        [\"(\", \")\"],\n        [\"\\\"\", \"\\\"\"],\n        [\"'\", \"'\"]\n    ],\n    \"surroundingPairs\": [\n        [\"{\", \"}\"],\n        [\"[\", \"]\"],\n        [\"(\", \")\"],\n        [\"\\\"\", \"\\\"\"],\n        [\"'\", \"'\"]\n    ]\n}"
  },
  {
    "path": "dsl/interop-lang-vscode/package.json",
    "content": "{\n    \"name\": \"plexus-interop-vscode\",\n    \"displayName\": \"Plexus Interop\",\n    \"description\": \"Plexus Interop Language support for Visual Studio Code\",\n    \"version\": \"0.0.1\",\n    \"publisher\": \"plexus-interop\",\n    \"engines\": {\n        \"vscode\": \"^1.8.0\"\n    },\n    \"license\": \"Apache-2.0\",\n    \"homepage\": \"https://github.com/finos-plexus/plexus-interop/tree/master/dsl/interop-lang-vscode/README.md\",\n    \"repository\": {\n        \"type\": \"git\",\n        \"url\": \"https://github.com/finos-plexus/plexus-interop.git\"\n    },\n    \"categories\": [\n        \"Programming Languages\"\n    ],\n    \"keywords\": [\n        \"plexus\",\n        \"interop\"\n    ],\n    \"activationEvents\": [\n        \"onLanguage:interop\",\n        \"onLanguage:proto\"\n    ],\n    \"bugs\": {\n        \"url\": \"https://github.com/finos-plexus/plexus-interop/issues\"\n    },\n    \"main\": \"./out/src/extension\",\n    \"contributes\": {\n        \"languages\": [\n            {\n                \"id\": \"interop\",\n                \"aliases\": [\n                    \"interop\"\n                ],\n                \"extensions\": [\n                    \".interop\"\n                ],\n                \"configuration\": \"./interop.configuration.json\"\n            },\n            {\n                \"id\": \"proto\",\n                \"aliases\": [\n                    \"proto\"\n                ],\n                \"extensions\": [\n                    \".proto\"\n                ],\n                \"configuration\": \"./interop.configuration.json\"\n            }\n        ],\n        \"grammars\": [\n            {\n                \"language\": \"interop\",\n                \"scopeName\": \"text.interop\",\n                \"path\": \"./syntaxes/interop.tmLanguage\"\n            },\n            {\n                \"language\": \"proto\",\n                \"scopeName\": \"text.proto\",\n                \"path\": \"./syntaxes/proto.tmLanguage\"\n            }\n        ]\n    },\n    \"scripts\": {\n        \"vscode:prepublish\": \"tsc -p ./\",\n        \"build\": \"tsc -p ./\",\n        \"watch\": \"tsc -w -p ./\",\n        \"postinstall\": \"node ../../web/scripts/replace-lock-registry.js --backward && node ./node_modules/vscode/bin/install\",\n        \"ci-publish\": \"cross-var vsce publish $PLEXUS_BUILD_VSCODE_PACKAGE_VERSION -p $PLEXUS_BUILD_VSCODE_AUTH_TOKEN\",\n        \"preinstall\": \"node ../../web/scripts/replace-lock-registry.js\"\n    },\n    \"devDependencies\": {\n        \"typescript\": \"^2.1.5\",\n        \"vscode\": \"1.1.14\",\n        \"vsce\": \"1.40.0\",\n        \"cross-var\": \"1.1.0\",\n        \"@types/node\": \"^6.0.40\"\n    },\n    \"dependencies\": {\n        \"vscode-languageclient\": \"3.2.0\"\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang-vscode/src/extension.ts",
    "content": "/**\n * Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as net from 'net';\nimport * as path from 'path';\n\nimport { workspace, Disposable, ExtensionContext } from 'vscode';\nimport { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from 'vscode-languageclient';\n\nexport function activate(context: ExtensionContext) {\n    \n    const interopClientOptions: LanguageClientOptions = {\n        documentSelector: [\n            {scheme: 'file', language: 'interop'}\n        ]\n    };\n    \n    const interopClient = createLangClient(\n            'interop-lang-server', \n            process.env.PLEXUS_INTEROP_LS_PORT,\n            context,\n            interopClientOptions);\n    \n    context.subscriptions.push(interopClient.start());\n\n    const protoClientOptions: LanguageClientOptions = {\n        documentSelector: [\n            {scheme: 'file', language: 'proto'}\n        ]\n    };\n    \n    if (!!process.env.PROTO_LANG_DEBUG_STDIO) {\n        process.env['PROTO_LANG_SERVER_OPTS'] = '-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=9999,suspend=n,quiet=y';\n    }\n\n    const protoClient = createLangClient(\n        'proto-lang-server', \n        process.env.PLEXUS_PROTO_LS_PORT,\n        context,\n        protoClientOptions);\n\n    context.subscriptions.push(protoClient.start());\n    \n}\n\nfunction createLangClient(\n        title: string, \n        serverPort: string, \n        context: ExtensionContext, \n        clientOptions: LanguageClientOptions) {\n\n    let serverOptions;\n    if (serverPort) {\n        console.error(`Connecting to ${title} using ${serverPort} port`);\n        serverOptions = async () => {\n            const socket = net.connect({\n                port: Number.parseInt(serverPort)\n            });\n            const result: StreamInfo = {\n                writer: socket,\n                reader: socket\n            };\n            return result;\n        };\n    } else {\n        const extension = process.platform == 'win32' ? '.bat' : '';\n        const executable = title + extension;\n        const command = context.asAbsolutePath(path.join(title, 'bin', executable));\n        serverOptions = { command };\n    }   \n    \n    return new LanguageClient(title, serverOptions, clientOptions);\n}"
  },
  {
    "path": "dsl/interop-lang-vscode/syntaxes/interop.tmLanguage",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>fileTypes</key>\n\t<array>\n\t\t<string>*.interop</string>\n\t</array>\n\t<key>name</key>\n\t<string>interop</string>\n\t<key>patterns</key>\n\t<array>\n\t\t<dict>\n            <key>include</key>\n            <string>#comments</string>\n        </dict>\n        <dict>\n            <key>include</key>\n            <string>#imports</string>\n        </dict>\n        <dict>\n            <key>include</key>\n            <string>#app-name</string>\n        </dict>\n        <dict>\n            <key>include</key>\n            <string>#package</string>\n        </dict>\n        <dict>\n            <key>include</key>\n            <string>#keywords</string> \n        </dict>\n        <dict>\n            <key>include</key>\n            <string>#string</string> \n        </dict>\n\t</array>\n    <key>repository</key>\n    <dict>\n      <!-- Comments -->  \n      <key>comments</key>\n      <dict>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>name</key>\n            <string>comment.block.interop</string>\n            <key>begin</key>\n            <string>/\\*</string>\n            <key>end</key>\n            <string>\\*/</string>\n          </dict>\n          <dict>\n            <key>name</key>\n            <string>comment.line.double-slash.interop</string>\n            <key>begin</key>\n            <string>//</string>\n            <key>end</key>\n            <string>$\\n?</string>\n          </dict>\n        </array>\n      </dict>\n      <!-- Interop Keywords -->\n      <key>keywords</key>\n      <dict>\n        <key>match</key>\n        <string>\\b(application|consumes|provides)\\b</string>\n        <key>name</key>\n        <string>keyword.other.interop</string>\n      </dict>\n      <key>string</key>\n      <dict>\n        <key>begin</key>\n        <string>\"</string>\n        <key>end</key>\n        <string>\"</string>\n        <key>name</key>\n        <string>string.quoted.double.interop</string>\n      </dict>\n      <!-- Imports --> \n      <key>imports</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(import)\\s+(\"[^\"]+\")\\s*;</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.interop</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>string.unquoted.interop.package</string>\n          </dict>\n        </dict>\n      </dict>\n      <!-- App Name-->\n      <key>app-name</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(application)\\s+([\\w]+)\\s*{</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.interop</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>entity.name.class.message.interop</string>\n          </dict>\n        </dict>                        \n      </dict>\n      <!-- Package -->\n      <key>package</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(package)\\s+([\\w.]+)\\s*;</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.interop</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>string.unquoted.interop.package</string>\n          </dict>\n        </dict>\n      </dict>\n    </dict>\n\t<key>scopeName</key>\n\t<string>text.interop</string>\n</dict>\n</plist>"
  },
  {
    "path": "dsl/interop-lang-vscode/syntaxes/proto.tmLanguage",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>fileTypes</key>\n\t<array>\n\t\t<string>*.proto</string>\n\t</array>\n\t<key>name</key>\n\t<string>proto</string>\n\t<key>patterns</key>\n\t<array>\n  \t<dict>\n        <key>include</key>\n        <string>#syntax</string>\n    </dict>\n\t\t<dict>\n        <key>include</key>\n        <string>#comments</string>\n    </dict>\n    <dict>\n        <key>include</key>\n        <string>#package</string>\n    </dict>\n    <dict>\n        <key>include</key>\n        <string>#imports</string>\n    </dict>\n    <dict>\n        <key>include</key>\n        <string>#message</string>\n    </dict>\n    <dict>\n        <key>include</key>\n        <string>#enum</string>\n    </dict>\n    <dict>\n        <key>include</key>\n        <string>#service</string>\n    </dict>\n\t</array>\n    <key>repository</key>\n    <dict>\n      <!-- Comments -->  \n      <key>comments</key>\n      <dict>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>name</key>\n            <string>comment.block.proto</string>\n            <key>begin</key>\n            <string>/\\*</string>\n            <key>end</key>\n            <string>\\*/</string>\n          </dict>\n          <dict>\n            <key>name</key>\n            <string>comment.line.double-slash.proto</string>\n            <key>begin</key>\n            <string>//</string>\n            <key>end</key>\n            <string>$\\n?</string>\n          </dict>\n        </array>\n      </dict>\n      <!-- Method Keywords -->\n      <key>methodKeywords</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(stream|returns)\\s*</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n        </dict>\n      </dict>\n      <!-- Syntax -->\n      <key>syntax</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(syntax)\\s*=\\s*(\"proto[23]\")\\s*;</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>string.quoted.double.proto.syntax</string>\n          </dict>\n        </dict>\n      </dict>\n      <!-- Method -->\n      <key>method</key>\n      <dict>\n        <key>begin</key>\n        <string>(rpc)\\s+([A-Za-z][A-Za-z0-9_]*)</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>entity.name.function</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>\\}|;</string>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>include</key>\n            <string>#comments</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#methodKeywords</string>\n          </dict>\n        </array>\n      </dict>\n      <!-- Service -->\n      <key>service</key>\n      <dict>\n        <key>begin</key>\n        <string>(service)\\s+([A-Za-z][A-Za-z0-9_.]*)\\s*\\{?</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>entity.name.class.message.proto</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>\\}</string>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>include</key>\n            <string>#comments</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#method</string>\n          </dict>\n        </array>\n      </dict>\n      <!-- Imports --> \n      <key>imports</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(import)\\s+(\"[^\"]+\")\\s*;</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.interop</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>string.unquoted.interop.package</string>\n          </dict>\n        </dict>\n      </dict>\n      <!-- Package -->\n      <key>package</key>\n      <dict>\n        <key>match</key>\n        <string>\\s*(package)\\s+([\\w.]+)\\s*;</string>\n        <key>captures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>string.unquoted.proto.package</string>\n          </dict>\n        </dict>\n      </dict>\n      <!-- Map Field -->\n      <key>mapfield</key>\n      <dict>\n        <key>begin</key>\n        <string>\\s*(map)\\s*&lt;\\s*([\\w.]+)\\s*,\\s*([\\w.]+)\\s*&gt;\\s+(\\w+)\\s*=\\s*(\\d+)</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>storage.type.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>storage.type.proto</string>\n          </dict>\n          <key>3</key>\n          <dict>\n            <key>name</key>\n            <string>storage.type.proto</string>\n          </dict>\n          <key>4</key>\n          <dict>\n            <key>name</key>\n            <string>variable.other.proto</string>\n          </dict>\n          <key>5</key>\n          <dict>\n            <key>name</key>\n            <string>constant.numeric.proto</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>;</string>\n      </dict>\n      <!-- Field -->\n      <key>field</key>\n      <dict>\n        <key>begin</key>\n        <string>\\s*(optional|repeated|required)?\\s*\\b([\\w.]+)\\s+(\\w+)\\s*=\\s*(\\d+)</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>storage.modifier.proto</string>\n          </dict>\n          <key>2</key>\n          <dict>\n            <key>name</key>\n            <string>storage.type.proto</string>\n          </dict>\n          <key>3</key>\n          <dict>\n            <key>name</key>\n            <string>variable.other.proto</string>\n          </dict>\n          <key>4</key>\n          <dict>\n            <key>name</key>\n            <string>constant.numeric.proto</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>;</string>\n      </dict>\n      <!-- Enum -->\n      <key>enum</key>\n      <dict>\n        <key>begin</key>\n        <string>(enum)(\\s+)([A-Za-z][A-Za-z0-9_]*)(\\s*)(\\{)?</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>3</key>\n          <dict>\n            <key>name</key>\n            <string>entity.name.class.proto</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>\\}</string>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>include</key>\n            <string>#comments</string>\n          </dict>\n        </array>\n      </dict>\n      <!-- Message -->\n      <key>message</key>\n      <dict>\n        <key>begin</key>\n        <string>(message|extend)(\\s+)([A-Za-z][A-Za-z0-9_.]*)(\\s*)(\\{)?</string>\n        <key>beginCaptures</key>\n        <dict>\n          <key>1</key>\n          <dict>\n            <key>name</key>\n            <string>keyword.other.proto</string>\n          </dict>\n          <key>3</key>\n          <dict>\n            <key>name</key>\n            <string>entity.name.class.message.proto</string>\n          </dict>\n        </dict>\n        <key>end</key>\n        <string>\\}</string>\n        <key>patterns</key>\n        <array>\n          <dict>\n            <key>include</key>\n            <string>$self</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#enum</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#comments</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#field</string>\n          </dict>\n          <dict>\n            <key>include</key>\n            <string>#mapfield</string>\n          </dict>\n        </array>\n      </dict>\n    </dict>\n\t<key>scopeName</key>\n\t<string>text.proto</string>\n</dict>\n</plist>"
  },
  {
    "path": "dsl/interop-lang-vscode/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"target\": \"es6\",\n        \"outDir\": \"out\",\n        \"lib\": [\n            \"es6\"\n        ],\n        \"sourceMap\": true,\n        \"rootDir\": \".\"\n    },\n    \"exclude\": [\n        \"node_modules\"\n    ]\n}"
  },
  {
    "path": "dsl/interop-lang.ide/build.gradle",
    "content": "apply plugin: 'application'\n\ndependencies {\n    compile project(':dsl:interop-lang')\n    compile project(':dsl:ide-common')\n    compile \"org.eclipse.xtext:org.eclipse.xtext.ide:${xtextVersion}\"\n    compile \"org.eclipse.xtext:org.eclipse.xtext.xbase.ide:${xtextVersion}\"\n}\n\nmainClassName = 'com.db.plexus.interop.dsl.ide.server.StdIOServerLauncher'\napplicationName = 'interop-lang-server'\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/InteropLangIdeModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide\n\nimport org.eclipse.xtext.ide.editor.contentassist.IdeCrossrefProposalProvider\nimport org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider\nimport com.db.plexus.interop.dsl.ide.assist.InteropContentProposalProvider\nimport com.google.inject.Binder\nimport com.db.plexus.interop.dsl.ide.assist.InteropCrossRefProposalProvider\n\n/**\n * Use this class to register ide components.\n */\nclass InteropLangIdeModule extends AbstractInteropLangIdeModule {\n\n    def configureContentAssistProvider(Binder binder) {\n        binder.bind(typeof(IdeContentProposalProvider))\n            .to(typeof(InteropContentProposalProvider));\n    }\n\n    def configureCrossRefProposalProvider(Binder binder) {\n        binder.bind(typeof(IdeCrossrefProposalProvider)).to(typeof(InteropCrossRefProposalProvider));\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/InteropLangIdeSetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.13.0\n */\npackage com.db.plexus.interop.dsl.ide\n\nimport com.db.plexus.interop.dsl.InteropLangRuntimeModule\nimport com.db.plexus.interop.dsl.InteropLangStandaloneSetup\nimport com.google.inject.Guice\nimport org.eclipse.xtext.util.Modules2\n\n/**\n * Initialization support for running Xtext languages as language servers.\n */\nclass InteropLangIdeSetup extends InteropLangStandaloneSetup {\n\n\toverride createInjector() {\n\t\tGuice.createInjector(Modules2.mixin(new InteropLangRuntimeModule, new InteropLangIdeModule))\n\t}\n\t\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/assist/InteropContentProposalProvider.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.assist;\n\nimport com.db.plexus.interop.dsl.ConsumedService;\nimport com.db.plexus.interop.dsl.ProvidedService;\nimport com.db.plexus.interop.dsl.protobuf.Method;\nimport com.db.plexus.interop.dsl.protobuf.Service;\nimport com.db.plexus.interop.ide.assist.ImportContentProvider;\nimport com.google.common.base.Predicate;\nimport org.eclipse.emf.ecore.EObject;\nimport org.eclipse.xtext.*;\nimport org.eclipse.xtext.ide.editor.contentassist.ContentAssistContext;\nimport org.eclipse.xtext.resource.IEObjectDescription;\n\npublic class InteropContentProposalProvider extends ImportContentProvider {\n\n    protected Predicate<IEObjectDescription> getCrossrefFilter(final CrossReference reference, final ContentAssistContext context) {\n\n        return eObjectProposal -> {\n\n            final EObject contextCurrentModel = context.getCurrentModel();\n            final EObject proposed = eObjectProposal.getEObjectOrProxy();\n\n            if (proposed instanceof Method && contextCurrentModel instanceof ConsumedService) {\n                final ConsumedService consumedService = (ConsumedService) contextCurrentModel;\n                final Method method = (Method) proposed;\n                final Service methodService = EcoreUtil2.getContainerOfType(method, Service.class);\n                return consumedService.getService().equals(methodService);\n            }\n\n            if (proposed instanceof Method && contextCurrentModel instanceof ProvidedService) {\n                final ProvidedService providedService = (ProvidedService) contextCurrentModel;\n                final Method method = (Method) proposed;\n                final Service methodService = EcoreUtil2.getContainerOfType(method, Service.class);\n                return providedService.getService().equals(methodService);\n            }\n\n            return true;\n            \n        };\n    }\n\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/assist/InteropCrossRefProposalProvider.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.assist;\n\nimport com.db.plexus.interop.dsl.protobuf.impl.MethodImpl;\nimport org.eclipse.emf.ecore.EClass;\nimport org.eclipse.xtext.CrossReference;\nimport org.eclipse.xtext.ide.editor.contentassist.ContentAssistContext;\nimport org.eclipse.xtext.ide.editor.contentassist.ContentAssistEntry;\nimport org.eclipse.xtext.ide.editor.contentassist.IdeCrossrefProposalProvider;\nimport org.eclipse.xtext.resource.IEObjectDescription;\nimport org.eclipse.xtext.xbase.lib.Procedures;\n\npublic class InteropCrossRefProposalProvider extends IdeCrossrefProposalProvider {\n\n    @Override\n    protected ContentAssistEntry createProposal(IEObjectDescription candidate, CrossReference crossRef, ContentAssistContext context) {\n        final Procedures.Procedure1<ContentAssistEntry> entryInitHandler = entry -> {\n            entry.setSource(candidate);\n            EClass eClass = candidate.getEClass();\n            entry.setDescription(eClass != null ? eClass.getName() : null);\n        };\n        final boolean isMethodImpl = candidate.getEObjectOrProxy() instanceof MethodImpl;\n        final String name = isMethodImpl ? candidate.getName().getLastSegment() : getQualifiedNameConverter().toString(candidate.getName());\n        return this.getProposalCreator()\n                .createProposal(name, context, entryInitHandler);\n\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/server/InteropDebugServerLauncher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.server;\n\nimport com.google.inject.Guice;\nimport com.google.inject.Injector;\nimport org.eclipse.xtext.ide.server.LanguageServerImpl;\n\nimport java.io.IOException;\nimport java.util.concurrent.ExecutionException;\n\nimport static com.db.plexus.interop.ide.server.DebugServerLauncher.launch;\n\npublic class InteropDebugServerLauncher {\n\n    public static void main(String[] args) throws InterruptedException, IOException, ExecutionException {\n        final Injector injector = Guice.createInjector(new InteropLangServerModule());\n        final LanguageServerImpl languageServer = injector.getInstance(InteropLanguageServer.class);\n        launch(languageServer, 5555);\n    }\n}"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/server/InteropLangServerModule.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.server;\n\nimport com.google.inject.AbstractModule;\nimport org.eclipse.xtext.ide.ExecutorServiceProvider;\nimport org.eclipse.xtext.ide.server.*;\nimport org.eclipse.xtext.resource.IContainer;\nimport org.eclipse.xtext.resource.IResourceServiceProvider;\nimport org.eclipse.xtext.resource.ResourceServiceProviderServiceLoader;\nimport org.eclipse.xtext.resource.containers.ProjectDescriptionBasedContainerManager;\n\nimport java.util.concurrent.ExecutorService;\n\npublic class InteropLangServerModule extends AbstractModule {\n\n    protected void configure() {\n        this.binder().bind(ExecutorService.class).toProvider(ExecutorServiceProvider.class);\n        this.bind(LanguageServerImpl.class).to(InteropLanguageServer.class);\n        this.bind(IResourceServiceProvider.Registry.class).toProvider(ResourceServiceProviderServiceLoader.class);\n        this.bind(IWorkspaceConfigFactory.class).to(ProjectWorkspaceConfigFactory.class);\n        this.bind(IProjectDescriptionFactory.class).to(DefaultProjectDescriptionFactory.class);\n        this.bind(IContainer.Manager.class).to(ProjectDescriptionBasedContainerManager.class);\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/server/InteropLanguageServer.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.server;\n\nimport com.db.plexus.interop.dsl.GlobalLangConfigHolder;\nimport org.eclipse.emf.common.util.URI;\nimport org.eclipse.lsp4j.InitializeParams;\nimport org.eclipse.lsp4j.InitializeResult;\nimport org.eclipse.xtext.ide.server.LanguageServerImpl;\n\nimport java.util.concurrent.CompletableFuture;\n\npublic class InteropLanguageServer extends LanguageServerImpl {\n\n    @Override\n    public CompletableFuture<InitializeResult> initialize(InitializeParams params) {\n        final String rootUri = params.getRootUri();\n        if (rootUri != null) {\n            GlobalLangConfigHolder.interopLangConfig.addBaseURI(stringToUri(rootUri));\n            GlobalLangConfigHolder.protoLangConfig.addBaseURI(stringToUri(rootUri));\n        }\n        return super.initialize(params);\n    }\n\n    private URI stringToUri(String rootUri) {\n        // URI.createUri contains confusing logic to remove last segment if string doesn't have separator at the end\n        final String normalized = rootUri.endsWith(\"/\") ? rootUri : rootUri + \"/\";\n        return URI.createURI(normalized);\n    }\n}\n"
  },
  {
    "path": "dsl/interop-lang.ide/src/main/java/com/db/plexus/interop/dsl/ide/server/StdIOServerLauncher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.ide.server;\n\nimport org.eclipse.xtext.ide.server.ServerLauncher;\n\npublic class StdIOServerLauncher extends ServerLauncher {\n\n    public static void main(final String[] args) {\n        ServerLauncher.launch(StdIOServerLauncher.class.getName(), args, new InteropLangServerModule());\n    }\n\n}\n"
  },
  {
    "path": "dsl/model/META-INF/MANIFEST.MF",
    "content": "Manifest-Version: 1.0\nBundle-ManifestVersion: 2\nBundle-Name: %pluginName\nBundle-SymbolicName: model;singleton:=true\nBundle-Version: 1.0.0.qualifier\nBundle-ClassPath: .\nBundle-Vendor: %providerName\nBundle-Localization: plugin\nBundle-RequiredExecutionEnvironment: JavaSE-1.8\nExport-Package: com.db.plexus.interop.dsl,\n com.db.plexus.interop.dsl.impl,\n com.db.plexus.interop.dsl.util,\n com.db.plexus.interop.dsl.protobuf,\n com.db.plexus.interop.dsl.protobuf.impl,\n com.db.plexus.interop.dsl.protobuf.util\nRequire-Bundle: org.eclipse.core.runtime,\n org.eclipse.emf.ecore;visibility:=reexport,\n org.eclipse.xtext.xbase.lib,\n org.eclipse.emf.ecore.xcore.lib,\n model;visibility:=reexport\nBundle-ActivationPolicy: lazy\n"
  },
  {
    "path": "dsl/model/build.gradle",
    "content": "dependencies {\n\tcompile \"org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}\"\n\tcompile 'org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:1.3.0'\n\t\n\txtextLanguages 'org.eclipse.emf:org.eclipse.emf.ecore.xcore:1.3.1'\n\txtextLanguages 'org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:1.3.0'\n\txtextLanguages \"org.eclipse.emf:org.eclipse.emf.codegen:2.11.0\"\n\txtextLanguages 'org.eclipse.emf:org.eclipse.emf.codegen.ecore:2.12.0'\n\txtextLanguages 'org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:1.2.0'\n\txtextLanguages \"org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}\"\n\txtextLanguages \"org.eclipse.emf:org.eclipse.emf.mwe2.lib:2.9.1.201705291010\"\n}\n\nsourceSets {\n\tmain {\n\t\tresources {\n\t\t\texclude '**/*.xcore'\n\t\t}\n\t}\n}\n\nxtext {\n\tversion = \"${xtextVersion}\"\n\tlanguages {\n\t\tecore {\n\t\t\tsetup = 'org.eclipse.xtext.ecore.EcoreSupport'\n\t\t}\n\t\tcodegen {\n\t\t\tsetup = 'org.eclipse.emf.codegen.ecore.xtext.GenModelSupport'\n\t\t}\n\t\txcore {\n\t\t\tsetup = 'org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup'\n\t\t\tgenerator.outlet.producesJava = true\n\t\t}\n\t}\n}\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/model/build.properties",
    "content": "#\n\nbin.includes = .,\\\n               model/,\\\n               plugin.xml,\\\n               plugin.properties\njars.compile.order = .\nsource.. = build/xcore/main/\noutput.. = bin/\n"
  },
  {
    "path": "dsl/model/plugin.properties",
    "content": "\npluginName = Plexus Interop Dsl Model\nproviderName = www.db.com/plexus/interop/dsl\n\n_UI_DiagnosticRoot_diagnostic = Diagnosis of {0}\n\n_UI_RequiredFeatureMustBeSet_diagnostic = The required feature ''{0}'' of ''{1}'' must be set\n_UI_FeatureHasTooFewValues_diagnostic = The feature ''{0}'' of ''{1}'' with {2} values must have at least {3} values\n_UI_FeatureHasTooManyValues_diagnostic = The feature ''{0}'' of ''{1}'' with {2} values may have at most {3} values\n_UI_DocumentRootMustHaveOneElement_diagnostic = The feature ''{0}'' of ''{1}'' with {2} element values must have exactly 1 element value\n\n_UI_UnresolvedProxy_diagnostic = The feature ''{0}'' of ''{1}'' contains an unresolved proxy ''{2}''\n_UI_DanglingReference_diagnostic = The feature ''{0}'' of ''{1}'' contains a dangling reference ''{2}''\n\n_UI_UnpairedBidirectionalReference_diagnostic = The opposite features ''{0}'' of ''{1}'' and ''{2}'' of ''{3}'' do not refer to each other\n\n_UI_BadDataValue_diagnostic = The feature ''{0}'' of ''{1}'' contains a bad value\n\n_UI_MinInclusiveConstraint_diagnostic = The value ''{0}'' must be greater than or equal to ''{2}'' \n_UI_MinExclusiveConstraint_diagnostic = The value ''{0}'' must be greater than ''{2}'' \n_UI_MaxInclusiveConstraint_diagnostic = The value ''{0}'' must be less than or equal to ''{2}'' \n_UI_MaxExclusiveConstraint_diagnostic = The value ''{0}'' must be less than ''{2}'' \n\n_UI_MinLengthConstraint_diagnostic = The value ''{0}'' with length {1} must have at least length {2} \n_UI_MaxLengthConstraint_diagnostic = The value ''{0}'' with length {1} may have at most length {2} \n\n_UI_EnumerationConstraint_diagnostic = The value ''{0}'' must be one of '{'{1}'}'\n_UI_PatternConstraint_diagnostic = The value ''{0}'' must match one of '{'{1}'}'\n\n_UI_TotalDigitsConstraint_diagnostic = The value ''{0}'' may have at most {1} digits\n_UI_FractionDigitsConstraint_diagnostic = The value ''{0}'' may have at most {1} fraction digits\n\n_UI_ListHead_composition = ''{0}''\n_UI_ListTail_composition = {0}, ''{1}''\n\n_UI_BadDataValueType_diagnostic = The value ''{0}'' of type ''{1}'' must be of type ''{2}''\n\n_UI_DuplicateID_diagnostic = The ID ''{0}'' of ''{1}'' collides with that of ''{2}''\n\n_UI_DuplicateKey_diagnostic = The feature ''{0}'' has key {1} for ''{2}'' which collides with that of ''{3}''\n\n_UI_DuplicateMapEntry_diagnostic = The feature ''{0}'' has a map entry at index {1} with a key that collides with that of the map entry at index {2}\n\n_UI_CircularContainment_diagnostic = An object may not circularly contain itself\n\n_UI_BadXMLGregorianCalendar_diagnostic = The value ''{0}'' is not a well formed instance of the {1} XML Schema data type"
  },
  {
    "path": "dsl/model/plugin.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?eclipse version=\"3.0\"?>\n\n<!--\n-->\n\n<plugin\n      name=\"%pluginName\"\n      id=\"com.db.plexus.interop.dsl.model\"\n      version=\"1.0.0\"\n      provider-name=\"%providerName\">\n\n   <requires>\n      <import plugin=\"org.eclipse.core.runtime\"/>\n      <import plugin=\"org.eclipse.emf.ecore\" export=\"true\"/>\n      <import plugin=\"org.eclipse.xtext.xbase.lib\" export=\"true\"/>\n      <import plugin=\"org.eclipse.emf.ecore.xcore.lib\" export=\"true\"/>\n   </requires>\n\n   <runtime>\n      <library name=\".\">\n         <export name=\"*\"/>\n      </library>\n   </runtime>\n\n   <extension point=\"org.eclipse.emf.ecore.generated_package\">\n      <!-- @generated proto -->\n      <package\n            uri=\"http://www.db.com/plexus/interop/dsl/protobuf\"\n            class=\"com.db.plexus.interop.dsl.protobuf.ProtobufPackage\"\n            genModel=\"src/main/java/proto.xcore\"/>\n   </extension>\n\n   <extension point=\"org.eclipse.emf.ecore.generated_package\">\n      <!-- @generated interop -->\n      <package\n            uri=\"http://www.db.com/plexus/interop/dsl\"\n            class=\"com.db.plexus.interop.dsl.DslPackage\"\n            genModel=\"src/main/java/interop.xcore\"/>\n   </extension>\n\n</plugin>\n"
  },
  {
    "path": "dsl/model/src/main/java/interop.xcore",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n@Ecore(nsPrefix=\"interop\",nsURI=\"http://www.db.com/plexus/interop/dsl\")\n@GenModel(\n    bundleManifest=\"false\",\n    modelDirectory=\"model/build/xcore/main\", \n    complianceLevel=\"8.0\"\n)\n\npackage com.db.plexus.interop.dsl\n\nimport com.db.plexus.interop.dsl.protobuf.Service\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport com.db.plexus.interop.dsl.protobuf.Option\nimport com.db.plexus.interop.dsl.protobuf.ProtoDefinition\n\nclass Application extends ProtoDefinition {\n\tcontains ApplicationElement[] elements\t\n}\n\nclass ApplicationElement {\t\n}\n\nclass InteropOption extends Option, ApplicationElement, ConsumedServiceElement, ProvidedServiceElement {\n}\n\nclass ConsumedService extends ApplicationElement {\n\tString alias\n\trefers Service service\n\tcontains RestrictionList restrictions\t\n\tcontains ConsumedServiceElement[] elements\n}\n\ninterface ConsumedServiceElement {\t\n}\n\nclass ConsumedMethod extends ConsumedServiceElement {\n\trefers Method method\n\tcontains InteropOption[] options\t\n}\n\nclass ProvidedService extends ApplicationElement {\n\tString alias\n\trefers Service service\n\tcontains RestrictionList restrictions\n\tcontains ProvidedServiceElement[] elements\n}\n\ninterface ProvidedServiceElement {\t\t\n}\n\nclass ProvidedMethod extends ProvidedServiceElement {\n\trefers Method method\n\tcontains InteropOption[] options\n}\n\nclass RestrictionList {\n\tcontains WildcardRestriction[] elements\t\n}\n\nclass WildcardRestriction {\n\tString wildcard\t\n}"
  },
  {
    "path": "dsl/model/src/main/java/proto.xcore",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n@Ecore(nsPrefix=\"proto\",nsURI=\"http://www.db.com/plexus/interop/dsl/protobuf\")\n@GenModel(\n    bundleManifest=\"false\",\n    modelDirectory=\"model/build/xcore/main\", \n    complianceLevel=\"8.0\"\n)\n\npackage com.db.plexus.interop.dsl.protobuf\n\ninterface NamedElement {\n\tString name\t\n}\n\nclass Proto {\n\tProtoSyntax syntax\n\tcontains ProtoElement[] elements\t\n}\n\nenum ProtoSyntax {\n\tNone,\n\tProto2,\n\tProto3\n}\n\ninterface ProtoElement {\t\n}\n\nclass Package extends ProtoElement {\n\tString importedNamespace\t\n}\n\nclass Import extends ProtoElement {\n\tString importURI\n\tImportModifier modifier\n}\n\nclass Extend extends ProtoElement {\n\trefers Message message\n\tcontains ExtendElement[] elements \n}\n\ninterface ExtendElement {\t\n}\n\nenum ImportModifier {\n\tNone,\n\tPublic,\n\tWeak\n}\n\nclass Option extends ProtoElement, MessageElement, ServiceElement, MethodElement, EnumElement, FieldElement {\n\tBoolean isCustom = \"false\"\n\trefers Field descriptor\t\n\tcontains Constant value\n}\n\ninterface Constant {\n}\n\nclass StringConstant extends Constant {\n\tString value\n}\n\nclass BoolConstant extends Constant {\n\tBoolean value = \"false\"\n}\n\nclass IntConstant extends Constant {\n\tInteger value\n}\n\nclass EnumConstant extends Constant {\n\trefers EnumValue value\n}\n\nclass DecimalConstant extends Constant {\n\tDouble value\n}\n\ninterface ProtoDefinition extends ProtoElement, NamedElement {\t\n}\n\ninterface ComplexType extends NamedElement {\n}\n\nclass Message extends ComplexType, ProtoDefinition, MessageElement {\n\tcontains MessageElement[] elements\t\n}\n\ninterface MessageElement {\t\n}\n\nclass Enum extends ComplexType, ProtoDefinition, MessageElement {\t\n\tcontains EnumElement[] elements\t\n}\n\ninterface EnumElement {\t\n}\n\nclass EnumValue extends EnumElement, NamedElement {\n\tInteger value\n\tcontains Option[] options\n}\n\nclass Service extends ProtoDefinition {\t\t\n\tcontains ServiceElement[] elements\n}\n\ninterface ServiceElement {\n}\n\nclass Method extends ServiceElement {\t\n\tString name\t\n\tcontains MethodData request\n\tcontains MethodData response\n\tcontains MethodElement[] elements\n}\n\nclass MethodData {\n\trefers Message message\n\tBoolean isStream = \"false\" \t\n}\n\ninterface MethodElement {\t\n}\n\nclass Field extends MessageElement, ExtendElement {\n\tString name\t\n\tInteger number\n\tFieldLabel label\n\tcontains FieldTypeReference typeReference\t\n\tcontains FieldElement[] elements\t\n}\n\ninterface FieldElement {\t\n}\n\nclass DefaultFieldValue extends FieldElement {\n\tcontains Constant value\n}\n\nclass Group extends MessageElement, ExtendElement {\n\tString name\t\n\tInteger number\t\n\tFieldLabel label\n\tcontains MessageElement[] elements\n}\n\nenum FieldLabel {\n\tNone\n\tOptional,\n\tRequired, \t\n\tRepeated\n}\n\nclass FieldTypeReference {\t\n}\n\nenum PrimitiveType\n{\n\tDOUBLE\n\tFLOAT,\n\tINT32,\n\tINT64,\n\tUINT32,\n\tUINT64,\n\tSINT32,\n\tSINT64,\n\tFIXED32,\n\tFIXED64,\n\tSFIXED32,\n\tSFIXED64,\n\tBOOl,\n\tSTRING,\n\tBYTES\n}\n\nclass PrimitiveFieldType extends FieldTypeReference {\n\tPrimitiveType value\n}\n\nclass ComplexFieldType extends FieldTypeReference {\n\trefers ComplexType value\n}\n\nclass OneOf extends MessageElement {\n\tString name\n\tcontains Field[] fields\n}\n\nclass MapField extends MessageElement {\n\tString name\n\tPrimitiveType keyType \n\tcontains FieldTypeReference valueType\n\tInteger number\n\tcontains Option[] options\t\t\n}\n\nclass Reserved extends MessageElement {\n\tcontains ReservedFields fields\t\n}\n\ninterface ReservedFields {\t\n}\n\nclass FieldNames extends ReservedFields {\n\tString[] elements\n}\n\nclass FieldRanges extends ReservedFields {\n\tcontains FieldRange[] elements\n}\n\nclass FieldRange {\n\tInteger from\n\tInteger to\n\tBoolean toUnbounded = \"false\"\n}\n\nclass Extensions extends MessageElement {\n\tcontains FieldRanges fields\t\t\n}"
  },
  {
    "path": "dsl/proto-lang/build.gradle",
    "content": "dependencies {\n    \n\ttestCompile \"junit:junit:4.12\"\n\ttestCompile project(':dsl:model')\n\ttestCompile \"org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}\"\n\ttestCompile \"org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}\"\n    \t\n\tcompile project(':dsl:model')\n    compile \"org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}\"\n    compile \"org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}\"\n\tcompile \"org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}\"    \n}\nconfigurations {\n    mwe2 {\n        extendsFrom compile\n    }\n}\n\ndependencies {\n    mwe2 \"org.eclipse.emf:org.eclipse.emf.mwe2.launch:2.9.1.201705291010\"\n    mwe2 \"org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}\"\n    mwe2 \"org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}\"\n    mwe2 \"org.eclipse.xtext:xtext-antlr-generator:[2.1.1, 3)\"\n\n\t// added for Xcore support\n\tmwe2 'org.eclipse.emf:org.eclipse.emf.ecore.xcore:1.3.1'\n\tmwe2 'org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:1.2.0'\n}\n\ntask generateXtextLanguage(type: JavaExec) {\n    main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'\n    classpath = configurations.mwe2\n    inputs.file \"src/main/java/com/db/plexus/interop/dsl/protobuf/GenerateProtoLang.mwe2\"\n    inputs.file \"src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLang.xtext\"\n    outputs.dir \"src/main/xtext-gen\"\n    args += \"src/main/java/com/db/plexus/interop/dsl/protobuf/GenerateProtoLang.mwe2\"\n    args += \"-p\"\n    args += \"rootPath=/${projectDir}/..\"\n}\n\ngenerateXtext.dependsOn(generateXtextLanguage)\nclean.dependsOn(cleanGenerateXtextLanguage)\neclipse.classpath.plusConfigurations += [configurations.mwe2]\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/GenerateProtoLang.mwe2",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nmodule com.db.plexus.interop.dsl.protobuf.ProtoLang\n\nimport org.eclipse.xtext.xtext.generator.*\nimport org.eclipse.xtext.xtext.generator.model.project.*\n\nvar rootPath = \"..\"\n\nWorkflow {\n\n\tbean = org.eclipse.emf.mwe.utils.StandaloneSetup {\n\t\tprojectMapping = {\n\t\t\tpath = \"${rootPath}/model\"\n\t\t\tprojectName = \"com.db.plexus.interop.dsl.model\"\n\t\t}\n\t}\n\n    \n    component = XtextGenerator {\n        configuration = {\n            project = StandardProjectConfig {\n\n                baseName = \"proto-lang\"\n                rootPath = rootPath\n                mavenLayout = true\n                 \n                runtimeTest = {\n                    enabled = true\n                }\n\n                genericIde = {\n                    enabled = true\n                }\n                                \n                web = {\n                    enabled = false\n                }\n\n            }            \n            code = {\n                encoding = \"UTF-8\"\n                lineDelimiter = \"\\n\"\n                fileHeader = \"/*\\n * generated by Xtext \\${version}\\n */\"\n            }\n        }\n        language = StandardLanguage {\n            name = \"com.db.plexus.interop.dsl.protobuf.ProtoLang\"\n            fileExtensions = \"proto\"\n            \n            parserGenerator = {\n            \toptions = parser.antlr.AntlrOptions {\n\t\t\t\t\tclassSplitting = true\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}            \n\n\t    \treferencedResource = \"platform:/resource/com.db.plexus.interop.dsl.model/src/main/java/proto.xcore\"\t    \n\t    \t\n\t    \tformatter={\t    \t\t\n    \t\t\tgenerateStub = true    \t\t\t\n\t\t\t}\n            serializer = {\n                generateStub = false\n            }\n            validator = {\n            }\n            webSupport = {\n                framework = \"Ace\"\n            }\n        }\n    }\n\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLang.xtext",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngrammar com.db.plexus.interop.dsl.protobuf.ProtoLang with org.eclipse.xtext.common.Terminals\n\nimport \"http://www.eclipse.org/emf/2002/Ecore\" as ecore\nimport \"http://www.db.com/plexus/interop/dsl/protobuf\"\n\nProto: {Proto} \n\t-> 'syntax' '=' syntax=ProtoSyntax ';'+\n\telements+=ProtoElement*\n;\n\nenum ProtoSyntax:\n\tProto2 = '\"proto2\"' | Proto2 = '\\'proto2\\'' |\n\tProto3 = '\"proto3\"' | Proto3 = '\\'proto3\\''\n;\n\nPackage: \n\t -> 'package' importedNamespace=FULL_ID ';'+\n;\n\nProtoElement:\n\t(-> Package | -> Import | -> Extend | -> Option | ProtoDefinition)\n;\n\nImport: \n\t 'import' ( -> modifier=ImportModifier)? importURI=STRING ';'+\n;\n\nenum ImportModifier:\t\n\tPublic = 'public' |\n\tWeak = 'weak'\n;\n\nOption:\n\t(-> CustomOption | PredefinedOption)\n;\n\nPredefinedOption returns Option: \n\t'option' descriptor=[Field|SHORT_ID] '=' value=Constant ';'+\n;\n\nCustomOption returns Option:\n\t'option' (-> isCustom?='(') descriptor=[Field|FULL_ID] ')' '=' value=Constant ';'+\n;\n\nConstant:\n\t(-> StringConstant | -> BoolConstant | EnumConstant | IntConstant | DecimalConstant)\n;\n\nStringConstant:\n\tvalue=STRING\n;\n\nIntConstant:\n\tvalue=SIGNED_INT\n;\n\nBoolConstant:\n\tvalue=BOOL\n;\n\nDecimalConstant:\n\tvalue=DECIMAL\n;\n\nEnumConstant:\n\tvalue=[EnumValue|FULL_ID]\n;\n\nExtend:\n\t'extend' message=[Message|FULL_ID] '{' \n\t \t(elements+=ExtendElement)* \n\t'}' ';'*\n;\n\nExtendElement:\n\t(-> Group | Field) \n;\n\nProtoDefinition:\n\t(-> Message | -> Enum | -> Service)\n;\n\nEnum: \n\t'enum' name=SHORT_ID '{'\n\t\telements+=EnumElement*\n\t'}' ';'*\n;\n\nEnumElement:\n\t(-> Option | EnumValue)\n;\n\nEnumValue:\n\tname=SHORT_ID '=' value=INT ('[' options+=OptionListItem (','  options+=OptionListItem)* ']')? ';'+\n;\n\nOptionListItem returns Option: \n\t(-> CustomOptionItem | PredefinedOptionItem)\n;\n\nPredefinedOptionItem returns Option:\n\tdescriptor=[Field|SHORT_ID] -> '=' value=Constant\n;\n\nCustomOptionItem returns Option:\n\tisCustom?='(' descriptor=[Field|FULL_ID] ')' -> '=' value=Constant\n;\n\nMessage: \n\t'message' name=SHORT_ID '{'\n\t\telements+=MessageElement*\n\t'}' ';'*\n;\n\nMessageElement:\n\t-> Enum | -> Message | -> OneOf | -> MapField | -> Reserved | \n\t-> Extensions | -> Group | -> Option | Field\n;\n\nField:\n\t(-> label=FieldLabel)? typeReference=FieldTypeReference name=SHORT_ID '=' number=INT \n\t(('[' elements+=FieldElement (','  elements+=FieldElement)* ']'))? ';'+\n;\n\nFieldElement:\n\t( -> DefaultFieldValue | OptionListItem)\n;\n\nDefaultFieldValue:\n\t'default' '=' value=Constant\n;\n\nGroup:\n\t(-> label=FieldLabel)? name=SHORT_ID '=' number=INT '{'\n\t\telements+=MessageElement*\n\t'}' ';'*\n;\n\nenum FieldLabel:\n\tRequired = 'required' |\n\tOptional = 'optional' |\n\tRepeated = 'repeated'\n;\n\nFieldTypeReference:\n\t(-> PrimitiveFieldType | ComplexFieldType)\n;\n\nPrimitiveFieldType:\n\tvalue=PrimitiveType\n;\n\nComplexFieldType:\n\tvalue=[ComplexType|FULL_ID]\n;\n\nOneOf: \n\t'oneof' name=SHORT_ID '{' (fields+=OneOfField)* '}' ';'*\n;\n\nOneOfField returns Field:\n\ttypeReference=FieldTypeReference name=SHORT_ID '=' number=INT \n\t(('[' elements+=FieldElement (','  elements+=FieldElement)* ']'))? ';'+\n;\n\nMapField: \n\t'map' '<' keyType=MapKeyType ',' valueType=FieldTypeReference '>' name=SHORT_ID '=' number=INT \n\t (('[' options+=OptionListItem (','  options+=OptionListItem)* ']'))? ';'+\n;\n\nReserved: \n\t'reserved' fields=ReservedFields ';'+\n;\n\nReservedFields:\n\tFieldNames | FieldRanges\n;\n\nFieldNames: {FieldNames}\n\telements+=STRING (',' elements+=STRING)*\n;\n\nFieldRanges: {FieldRanges}\n\telements+=FieldRange (',' elements+=FieldRange)*\n;\n\nFieldRange:\n\tfrom=INT (-> 'to' (to=INT | -> toUnbounded?='max'))?\n;\n\nExtensions:\n\t'extensions' fields=FieldRanges ';'+\n;\n\nService: \n\t'service' name=SHORT_ID '{'\t\t\n\t\telements+=ServiceElement*\n\t'}' ';'*\n;\n\nServiceElement: \n\t-> Option | Method\n;\n\nMethod: \n\t'rpc' name=SHORT_ID request=MethodData 'returns' response=MethodData \n\t('{' elements+=MethodElement* '}' | ';') ';'*\n;\n\nMethodData:\n\t'(' ( -> isStream?='stream')? message=[Message|FULL_ID] ')'\n;\n\nMethodElement:\n\tOption\n;\n\nenum PrimitiveType:\n\tDOUBLE\t='double'\t|\n\tFLOAT\t='float' \t|\n\tINT32\t='int32' \t|\n\tINT64\t='int64'\t|\n\tUINT32\t='uint32' \t|\n\tUINT64\t='uint64' \t|\n\tSINT32\t='sint32' \t|\n\tSINT64\t='sint64' \t|\n\tFIXED32\t='fixed32' \t|\n\tFIXED64\t='fixed64' \t|\n\tSFIXED32='sfixed32' |\n\tSFIXED64='sfixed64' |\n\tBOOl\t='bool' \t|\n\tSTRING\t='string' \t|\n\tBYTES\t='bytes'\n;\n\nenum MapKeyType returns PrimitiveType:\n\tINT32\t='int32' \t|\n\tINT64\t='int64'\t|\n\tUINT32\t='uint32' \t|\n\tUINT64\t='uint64' \t|\n\tSINT32\t='sint32' \t|\n\tSINT64\t='sint64' \t|\n\tFIXED32\t='fixed32' \t|\n\tFIXED64\t='fixed64' \t|\n\tSFIXED32='sfixed32' |\n\tSFIXED64='sfixed64' |\n\tBOOl\t='bool' \t|\n\tSTRING\t='string'\n;\n\nBOOL returns ecore::EBoolean: \t\n\t'true' | 'false'\n;\n\nDECIMAL returns ecore::EDouble: \n\tSIGNED_INT'.'INT\n;\n\nSIGNED_INT returns ecore::EInt: \n\t'-'?INT\n;\n\nPROTO_LANG_KEYWORD:\n\t'package' | 'syntax' | 'message' | 'rpc' | 'service' | 'max' | 'oneof' | 'map' | 'extensions' | 'stream' | 'reserved' | \n\t  'required' | 'optional' | 'repeated' | 'enum' | 'extend' | 'option' | 'public' | 'weak' | 'import' | 'true' | 'false' | 'default'\n;\n\nPROTO_TYPE_KEYWORD:\n\t'double' |   'float' |   'int32' |   'int64' |   'uint32' |   'uint64' |   'sint32' |   'sint64' |   'fixed32' |   'fixed64' |   'sfixed32' | \n\t  'sfixed64' |   'bool' |   'string' |   'bytes'\n;\n\nFULL_ID:\n\t'.'? SHORT_ID ('.' SHORT_ID)*\n;\n\nSHORT_ID:\n\t PROTO_LANG_KEYWORD | PROTO_TYPE_KEYWORD | ID\t \n;\n\n@Override \nterminal ID : \n\t('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*\n;"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLangConfig.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf\n\nimport java.util.List\nimport org.eclipse.emf.common.util.URI\nimport java.util.LinkedList\nimport com.google.inject.Singleton\n\n@Singleton\nclass ProtoLangConfig {\n\t\n\tprivate List<URI> baseURIs = new LinkedList<URI>()\n\t\n\tprivate boolean strictMode = true; \n\t\n\tdef List<URI> getBaseURIs() {\n\t\tbaseURIs\n\t}\n\t\n\tdef addBaseURI(URI uri) {\n\t\tif (!baseURIs.contains(uri)) {\n\t\t\treturn baseURIs.add(uri)\t\t\n\t\t}\n\t\treturn false\n\t}\n\t\n\tdef removeBaseURI(URI uri) {\n\t\treturn baseURIs.remove(uri)\n\t}\n\t\n\tdef getStrictMode() {\n\t\treturn strictMode\n\t}\n\t\n\tdef setStrictMode(boolean value) {\n\t\tstrictMode = value\n\t}\n}"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLangImportResolver.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf\n\nimport com.google.inject.Inject\nimport com.google.inject.Singleton\nimport java.util.Collections\nimport org.eclipse.emf.common.util.URI\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport org.eclipse.xtext.resource.IResourceDescriptionsProvider\nimport java.util.ArrayList\nimport org.eclipse.emf.ecore.resource.Resource\nimport java.util.stream.Collectors\n\n@Singleton\nclass ProtoLangImportResolver {\n\n\t@Inject\n\tProtoLangConfig config\n\t\n\t@Inject\n\tprotected IResourceDescriptionsProvider resourceDescriptionsProvider\n\t\n\tdef public resolveURI(ResourceSet resourceSet, String importString) {\n\t\tif (importString === null) {\n\t\t\treturn null;\n\t\t}\n\t\tfor (resolvedUri: getResolveCandidates(importString)) {\n\t\t\tif (isValidURI(resourceSet, resolvedUri)) {\n\t\t\t\treturn resolvedUri\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdef public resolveResource(ResourceSet resourceSet, String importString) {\n\t\tval uri = resolveURI(resourceSet, importString)\n\t\tif (uri === null) {\n\t\t\treturn null\n\t\t}\n\t\treturn resourceSet.getResource(uri, true)\n\t}\n\t\n\tdef public resolveResourceDescription(ResourceSet resourceSet, String importString) {\n\t\tval resource = resolveResource(resourceSet, importString)\n\t\tif (resource === null) {\n\t\t\treturn null\n\t\t}\n\t\treturn resourceDescriptionsProvider\n\t\t\t.getResourceDescriptions(resourceSet)\n\t\t\t.getResourceDescription(resource.URI) \t\t\n\t}\n\n    def public importCandidates(Resource resource) {\n        resource.resourceSet\n            .resources\n            .stream\n            .filter([x| !x.equals(resource)])\n            .flatMap([res| config.getBaseURIs().stream().map([url| deresolve(url, res.getURI)])])\n            .filter([uri| !uri.hasAbsolutePath])\n            .collect(Collectors.toList())\n    }\n\n\tdef public URI deresolve(URI base, URI uri) {\n        val normalizedBase = URI.createURI(URI.decode(base.toString))\n        val normalizedUri = URI.createURI(URI.decode(uri.toString))\n        return normalizedUri.deresolve(normalizedBase)\n    }\n\t\n\tdef public getResolveCandidates(String importString) {\n\t\tval result = new ArrayList<URI>()\n\t\tval URI uri = URI.createURI(importString)\n\t\tfor (root : config.baseURIs) {\n\t\t\ttry {\n\t\t\t\tval resolvedUri = uri.resolve(root)\n\t\t\t\tresult.add(resolvedUri)\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tval resolvedUri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(importString).toURI().toString())\t\t\t\n\t\t\tif (!result.contains(resolvedUri)) {\n\t\t\t\tresult.add(resolvedUri)\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t}\n\t\treturn result\n\t}\n\t\n\tdef private static isValidURI(ResourceSet resourceSet, URI uri) {\n\t\tif (uri === null || uri.isEmpty()) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\ttry {\n\t\t\tif (resourceSet.getResource(uri, false) !== null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tval uriConverter = resourceSet.getURIConverter();\n\t\t\tval normalized = uriConverter.normalize(uri);\n\t\t\tif (normalized !== null) {\n\t\t\t\tif(\"platform\".equals(normalized.scheme()) && !normalized.isPlatform()) { \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn uriConverter.exists(normalized, Collections.emptyMap());\t\t\t\t\n\t\t\t}\n\t\t} catch (RuntimeException e) { // thrown by org.eclipse.emf.ecore.resource.ResourceSet#getResource(URI, boolean)\t\t\t\n\t\t}\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLangRuntimeModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf\n\nimport com.google.inject.Binder\nimport org.eclipse.xtext.formatting2.FormatterPreferenceValuesProvider\nimport org.eclipse.xtext.formatting2.FormatterPreferences\nimport org.eclipse.xtext.preferences.IPreferenceValuesProvider\nimport org.eclipse.xtext.scoping.IGlobalScopeProvider\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.scoping.IScopeProvider\nimport com.google.inject.name.Names\nimport org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangLocalScopeProvider\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangQualifiedNameProvider\nimport com.db.plexus.interop.dsl.protobuf.scoping.ProtoLangGlobalScopeProvider\n\n/**\n * Use this class to register components to be used at runtime / without the Equinox extension registry.\n */\nclass ProtoLangRuntimeModule extends AbstractProtoLangRuntimeModule {\n\t\t\n\t// workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=495851\n\tdef void configureIPreferenceValuesProvider(Binder binder) {\n\t\tbinder.bind(IPreferenceValuesProvider).annotatedWith(FormatterPreferences).to(FormatterPreferenceValuesProvider)\n\t}\n\t\t\n\toverride def Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {\n \t\treturn typeof(ProtoLangGlobalScopeProvider);\n \t}\n \t\n \toverride configureIScopeProviderDelegate(Binder binder) { \t\t\n        binder.bind(IScopeProvider).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ProtoLangLocalScopeProvider);\n    }\n \t\n \toverride Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {\n\t\treturn typeof(ProtoLangQualifiedNameProvider);\n\t} \t\n\t\n\tdef configureProtoLangConfig(Binder binder) {\t\t\n\t\tbinder.bind(typeof(ProtoLangConfig))\t\t\n\t\tbinder.bind(typeof(ProtoLangImportResolver))\t\t\n\t}\n}"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLangStandaloneSetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf\n\nimport com.google.inject.Injector\nimport org.eclipse.emf.ecore.EPackage\n\n/**\n * Initialization support for running Xtext languages without Equinox extension registry.\n */\nclass ProtoLangStandaloneSetup extends ProtoLangStandaloneSetupGenerated {\t\n\t\t\n\tstatic def doSetup() {\t\t\n\t}\t\n\n\toverride register(Injector injector) {\n\t\tif (!EPackage.Registry.INSTANCE.containsKey(ProtobufPackage.eNS_URI)) {\n\t\t\tEPackage.Registry.INSTANCE.put(ProtobufPackage.eNS_URI, ProtobufPackage.eINSTANCE);\n\t\t}\n\t\tStaticConfigHolder.protoLangConfig = injector.getInstance(typeof(ProtoLangConfig))\n\t\tsuper.register(injector)\t\t\t\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/ProtoLangUtils.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf\n\nimport org.eclipse.xtext.naming.QualifiedName\nimport org.eclipse.emf.ecore.EObject\nimport org.eclipse.xtext.resource.IResourceDescriptionsProvider\nimport com.google.inject.Inject\nimport org.eclipse.xtext.resource.IResourceDescription\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport com.google.inject.Singleton\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\n\n@Singleton\nclass ProtoLangUtils {\n\t\t\n\tpublic static final String DESCRIPTOR_RESOURCE_PATH = \"google/protobuf/descriptor.proto\"\n\tpublic static final QualifiedName DESCRIPTOR_PACKAGE_NAME = QualifiedName.create(\"\", \"google\", \"protobuf\")\n\t\n\t@Inject\n\tprotected IResourceDescriptionsProvider resourceDescriptionsProvider\n\n\t@Inject\n\tprotected ProtoLangImportResolver importResolver\n\n\t@Inject\n\tprotected IQualifiedNameProvider qualifiedNameProvider\n\n\tdef public Message getDescriptorsContainer(Option option) {\n\t\tval name = option.descriptorContainerName\n\t\tif (name === null) {\n\t\t\treturn null\n\t\t}\n\t\tval resourceSet = option.eResource.resourceSet\n\t\tval description = resourceSet.descriptorResourceDescription\n\t\tif (description == null) {\n\t\t\tval descriptorResource = importResolver.resolveResource(resourceSet, DESCRIPTOR_RESOURCE_PATH)\n\t\t\tval message = descriptorResource.allContents\n\t\t\t\t.filter(typeof(Message))\n\t\t\t\t.findFirst[m | name.equals(qualifiedNameProvider.getFullyQualifiedName(m))]\n\t\t\treturn message;\n\t\t}\n\t\treturn description.getExportedObjects(ProtobufPackage.Literals.MESSAGE, name, false).findFirst[x|true].EObjectOrProxy as Message\n\t}\n\t\n\tdef public IResourceDescription getDescriptorResourceDescription(ResourceSet resourceSet) {\n\t\treturn importResolver.resolveResourceDescription(resourceSet, DESCRIPTOR_RESOURCE_PATH)\n\t}\n\t\n\tdef private static QualifiedName getDescriptorContainerName(Option option) {\n\t\tval shortName = option.eContainer.optionDescriptorMessageName\n\t\tif (shortName === null) {\n\t\t\treturn null\n\t\t}\n\t\treturn DESCRIPTOR_PACKAGE_NAME.append(shortName)\n\t}\n\t\n\tdef private static String getOptionDescriptorMessageName(EObject container) {\n\t\treturn switch (container) {\n\t\t\tProto: \"FileOptions\"\n\t\t\tMessage: \"MessageOptions\"\n\t\t\tField: \"FieldOptions\"\n\t\t\tService: \"ServiceOptions\"\n\t\t\tMethod: \"MethodOptions\"\n\t\t\tEnum: \"EnumOptions\"\n\t\t\tEnumValue: \"EnumValueOptions\"\n\t\t\tdefault: null\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/StaticConfigHolder.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf;\n\npublic class StaticConfigHolder {\n    public static ProtoLangConfig protoLangConfig;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/formatting2/ProtoLangFormatter.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf.formatting2\n\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport org.eclipse.xtext.formatting2.AbstractFormatter2\nimport org.eclipse.xtext.formatting2.IFormattableDocument\n\nclass ProtoLangFormatter extends AbstractFormatter2 {\n\t\n\tdef dispatch void format(Proto proto, extension IFormattableDocument document) {\t\t\n\t\tfor (o : proto.eResource.allContents.toIterable()) {\n\t\t\to.allRegionsFor.keyword('{').append[setNewLines(1, 1, 2)]\t\t\t\t\t\n\t\t\to.allRegionsFor.keyword('}').append[setNewLines(2, 2, 2)]\t\t\n\t\t\to.allRegionsFor.keyword(';').prepend[noSpace].append[setNewLines(1, 1, 2)]\t\t\t\n\t\t\tval open = o.regionFor.keyword('{')\n\t\t\tval close = o.regionFor.keyword('}')\n\t\t\tinterior(open, close)[indent]\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/generator/ProtoLangGenerator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf.generator\n\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.generator.AbstractGenerator\nimport org.eclipse.xtext.generator.IFileSystemAccess2\nimport org.eclipse.xtext.generator.IGeneratorContext\n\n/**\n * Generates code from your model files on save.\n * \n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation\n */\nclass ProtoLangGenerator extends AbstractGenerator {\n\n\toverride void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {\n//\t\tfsa.generateFile('greetings.txt', 'People to greet: ' + \n//\t\t\tresource.allContents\n//\t\t\t\t.filter(Greeting)\n//\t\t\t\t.map[name]\n//\t\t\t\t.join(', '))\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/scoping/ProtoLangGlobalScopeProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.scoping\n\nimport org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider\nimport org.eclipse.emf.ecore.resource.Resource\nimport java.util.Set\nimport org.eclipse.xtext.util.IAcceptor\nimport org.eclipse.emf.common.util.URI\nimport com.db.plexus.interop.dsl.protobuf.Import\nimport com.db.plexus.interop.dsl.protobuf.ImportModifier\nimport com.google.inject.Inject\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\n\nclass ProtoLangGlobalScopeProvider extends ImportUriGlobalScopeProvider {\n\n\t@Inject\n\tProtoLangImportResolver importResolver\n\t\t\n\toverride IAcceptor<String> createURICollector(Resource resource, Set<URI> collectInto) {\n\t\tnew ImportCollector(resource, collectInto, importResolver)\n\t}\n\t\n\tstatic class ImportCollector implements IAcceptor<String> {\n\n\t\tResource resource\n\t\tSet<URI> result\n\t\tProtoLangImportResolver importResolver\n\n\t\tnew(Resource resource, Set<URI> result, ProtoLangImportResolver importResolver) {\n\t\t\tthis.resource = resource\n\t\t\tthis.result = result\n\t\t\tthis.importResolver = importResolver\n\t\t}\n\n\t\tdef void addTransitiveImports(URI uri) {\n\t\t\tif (result.contains(uri)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult.add(uri)\n\t\t\tval resource = resource.resourceSet.getResource(uri, true)\n\t\t\tif (resource.contents.length == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (import : resource.contents.get(0).eContents.filter(typeof(Import))) {\n\t\t\t\tif (import.modifier == ImportModifier.PUBLIC) {\n\t\t\t\t\tnew ImportCollector(resource, result, importResolver).accept(import.importURI)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\toverride accept(String importString) {\n\t\t\tval resolvedUri = importResolver.resolveURI(resource.resourceSet, importString) \n\t\t\tif (resolvedUri !== null) {\n\t\t\t\taddTransitiveImports(resolvedUri)\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/scoping/ProtoLangLocalScopeProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.scoping\n\nimport com.google.inject.Inject\nimport java.util.ArrayList\nimport java.util.Collections\nimport java.util.HashMap\nimport org.eclipse.emf.ecore.EObject\nimport org.eclipse.emf.ecore.EReference\nimport org.eclipse.xtext.naming.IQualifiedNameConverter\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.naming.QualifiedName\nimport org.eclipse.xtext.resource.EObjectDescription\nimport org.eclipse.xtext.resource.IEObjectDescription\nimport org.eclipse.xtext.scoping.ICaseInsensitivityHelper\nimport org.eclipse.xtext.scoping.IGlobalScopeProvider\nimport org.eclipse.xtext.scoping.IScope\nimport org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider\n\nclass ProtoLangLocalScopeProvider extends ImportedNamespaceAwareLocalScopeProvider {\n\t\n\t@Inject\n\tpublic new (\n\t\tIGlobalScopeProvider globalScopeProvider, \n\t\tIQualifiedNameProvider qualifiedNameProvider, \n\t\tIQualifiedNameConverter qualifiedNameConverter, \n\t\tICaseInsensitivityHelper caseInsensitivityHelper\n\t)\n\t{\t\n\t\tsuper(globalScopeProvider, qualifiedNameProvider, qualifiedNameConverter, caseInsensitivityHelper)\n\t}\n\t\t\n\tdef override IScope getScope(EObject context, EReference reference) {\n\t\tval contextName = qualifiedNameProvider.getFullyQualifiedName(context)\n\t\tif (contextName === null) {\n\t\t\treturn getScope(context.eContainer, reference)\n\t\t}\t\n\t\tval globalScope = getResourceScope(context.eResource, reference)\n\t\tval scope = new ProtoLangScope(globalScope, contextName, qualifiedNameProvider)\n\t\treturn scope\t\t\t\n\t}\n\t\n\tstatic class ProtoLangScope implements IScope {\n\t\t\n\t\tQualifiedName contextName\n\t\tIScope globalScope\n\t\tHashMap<String, Integer> segmentMap = new HashMap<String, Integer>\n\t\tIQualifiedNameProvider qualifiedNameProvider\n\t\t\n\t\tnew(IScope globalScope, QualifiedName contextName, IQualifiedNameProvider qualifiedNameProvider) {\n\t\t\tthis.globalScope = globalScope\n\t\t\tthis.contextName = contextName\n\t\t\tfor (var i=0; i<contextName.segmentCount; i++) {\n\t\t\t\tthis.segmentMap.put(contextName.getSegment(i), i)\t\t\t\n\t\t\t}\n\t\t\tthis.qualifiedNameProvider = qualifiedNameProvider\n\t\t}\n\t\t\n\t\toverride getAllElements() {\n\t\t\tval result = new ArrayList<IEObjectDescription>()\n\t\t\tfor (elem: this.globalScope.allElements) {\n\t\t\t\tresult.add(elem)\n\t\t\t\tval maxPrefixLength = Math.min(this.contextName.segmentCount, elem.name.segmentCount - 1)\n\t\t\t\tvar i = 0;\n\t\t\t\twhile (i < maxPrefixLength && this.contextName.getSegment(i).equals(elem.name.getSegment(i))) {\n\t\t\t\t\ti++\n\t\t\t\t\tval suffix = elem.name.skipFirst(i)\n\t\t\t\t\tif (this.segmentMap.getOrDefault(suffix.firstSegment, i) == i) {\n\t\t\t\t\t\tresult.add(EObjectDescription.create(suffix, elem.EObjectOrProxy))\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\t\n\t\toverride getElements(QualifiedName name) {\n\t\t\tval candidate = getSingleElement(name)\t\t\t\n\t\t\tif (candidate !== null) {\n\t\t\t\treturn Collections.singleton(candidate)\n\t\t\t} else {\n\t\t\t\treturn Collections.emptySet\n\t\t\t}\n\t\t}\n\t\t\n\t\toverride getElements(EObject object) {\n\t\t\tval name = this.qualifiedNameProvider.getFullyQualifiedName(object)\n\t\t\tif (name === null) {\n\t\t\t\treturn getElements(object.eContainer)\n\t\t\t}\n\t\t\treturn getElements(name)\n\t\t}\n\t\t\n\t\toverride getSingleElement(QualifiedName name) {\n\t\t\tval prefixIndex = this.segmentMap.getOrDefault(name.firstSegment, -1)\n\t\t\tif (prefixIndex == -1) {\n\t\t\t\tfor (var i = 0; i <= this.contextName.segmentCount; i++) {\n\t\t\t\t\tval newName = this.contextName.skipLast(i).append(name)\n\t\t\t\t\tval candidate = this.globalScope.getSingleElement(newName)\n\t\t\t\t\tif (candidate !== null) {\n\t\t\t\t\t\treturn EObjectDescription.create(name, candidate.EObjectOrProxy)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tval newName = this.contextName.skipLast(this.contextName.segmentCount - prefixIndex).append(name)\n\t\t\t\treturn this.globalScope.getSingleElement(newName)\n\t\t\t}\n\t\t}\n\t\t\n\t\toverride getSingleElement(EObject object) {\n\t\t\tval name = this.qualifiedNameProvider.getFullyQualifiedName(object)\n\t\t\tif (name === null) {\n\t\t\t\treturn getSingleElement(object.eContainer)\n\t\t\t}\n\t\t\treturn getSingleElement(name)\n\t\t}\t\t\n\t}\t\n}"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/scoping/ProtoLangQualifiedNameProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.scoping\n\nimport com.db.plexus.interop.dsl.protobuf.Package\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport com.google.inject.Inject\nimport java.util.LinkedList\nimport org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider\nimport org.eclipse.xtext.naming.IQualifiedNameConverter\nimport org.eclipse.xtext.naming.QualifiedName\nimport com.db.plexus.interop.dsl.protobuf.EnumValue\n\nclass ProtoLangQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {\n\t\n\t@Inject\n\tprivate IQualifiedNameConverter converter = new IQualifiedNameConverter.DefaultImpl();\n\t\t\n\tdef qualifiedName(Proto ele) {\n\t\tval packageSegments = new LinkedList<String>()\n\t\tpackageSegments.add(\"\")\n\t\tval package = ele.eContents.findFirst[t|t instanceof Package]\n\t\tif (package !== null) {\n\t\t\tpackageSegments.addAll(converter.toQualifiedName((package as Package).importedNamespace).segments)\t\t\t\n\t\t}\n\t\treturn QualifiedName.create(packageSegments);\t\t\n\t}\n\t\n\tdef qualifiedName(EnumValue ele) {\t\n\t\treturn getFullyQualifiedName(ele.eContainer.eContainer).append(ele.name)\t\n\t}\n}\n\t\t"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/scoping/ProtoLangScopeProvider.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf.scoping\n\nimport com.db.plexus.interop.dsl.protobuf.ComplexFieldType\nimport com.db.plexus.interop.dsl.protobuf.DefaultFieldValue\nimport com.db.plexus.interop.dsl.protobuf.Enum\nimport com.db.plexus.interop.dsl.protobuf.EnumConstant\nimport com.db.plexus.interop.dsl.protobuf.EnumValue\nimport com.db.plexus.interop.dsl.protobuf.Extend\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.Option\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangUtils\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.google.inject.Inject\nimport org.eclipse.emf.ecore.EObject\nimport org.eclipse.emf.ecore.EReference\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport org.eclipse.xtext.naming.QualifiedName\nimport org.eclipse.xtext.resource.IResourceDescriptionsProvider\nimport org.eclipse.xtext.scoping.IScope\nimport org.eclipse.xtext.scoping.Scopes\nimport org.eclipse.xtext.scoping.impl.SimpleScope\n\n/**\n * This class contains custom scoping description.\n * \n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping\n * on how and when to use it.\n */\nclass ProtoLangScopeProvider extends AbstractProtoLangScopeProvider {\n\n\t@Inject\n\tprotected IResourceDescriptionsProvider resourceDescriptionsProvider\n\n\t@Inject\n\tprotected ProtoLangImportResolver importResolver\n\t\n\t@Inject\n\tprotected ProtoLangUtils utils\n\t\n\t@Inject\n\tprotected IQualifiedNameProvider qualifiedNameProvider\n\t\n\toverride getScope(EObject context, EReference reference) {\n\n\t\tif (context instanceof Option && reference == ProtobufPackage.Literals.OPTION__DESCRIPTOR) {\n\t\t\tval option = context as Option\n\t\t\tval optionDescriptorContainer = utils.getDescriptorsContainer(option)\n\t\t\tif (optionDescriptorContainer !== null) {\n\t\t\t\tif (option.isCustom) {\n\t\t\t\t\tval superScope = super.getScope(context, reference).allElements\n\t\t\t\t\tval extendFields = \n\t\t\t\t\t\tsuperScope\n\t\t\t\t\t\t\t.filter[x | x.EClass.equals(ProtobufPackage.Literals.FIELD)]\n\t\t\t\t\t\t\t.filter[x | x.EObjectOrProxy.eContainer instanceof Extend]\n\t\t\t\t\t\t\t.filter[x | (x.EObjectOrProxy.eContainer as Extend).message.equals(optionDescriptorContainer)]\n\t\t\t\t\treturn new SimpleScope(extendFields)\n\t\t\t\t} else {\n\t\t\t\t\tval optionDescriptors = optionDescriptorContainer.elements.filter(typeof(Field))\n\t\t\t\t\treturn Scopes.scopeFor(optionDescriptors, [x|QualifiedName.create(x.name)], IScope.NULLSCOPE)\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tif (context instanceof EnumConstant && reference == ProtobufPackage.Literals.ENUM_CONSTANT__VALUE) {\n\t\t\tval container = context.eContainer\n\t\t\tvar descriptor = switch (container) {\n\t\t\t\tOption: container.descriptor\n\t\t\t\tDefaultFieldValue: container.eContainer as Field\n\t\t\t}\n\t\t\tif (descriptor.typeReference instanceof ComplexFieldType) {\n\t\t\t\tval typeRef = descriptor.typeReference as ComplexFieldType\n\t\t\t\tval type = typeRef.value\n\t\t\t\tif (type instanceof Enum) {\n\t\t\t\t\tval values = type.elements.filter(typeof(EnumValue))\n\t\t\t\t\treturn Scopes.scopeFor(values, [x|QualifiedName.create(x.name)], IScope.NULLSCOPE)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn super.getScope(context, reference)\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/java/com/db/plexus/interop/dsl/protobuf/validation/ProtoLangValidator.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf.validation\n\nimport org.eclipse.xtext.validation.Check\nimport com.db.plexus.interop.dsl.protobuf.Package\nimport com.db.plexus.interop.dsl.protobuf.ProtobufPackage\nimport com.google.inject.Inject\nimport org.eclipse.xtext.resource.IContainer\nimport org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider\nimport com.db.plexus.interop.dsl.protobuf.NamedElement\nimport org.eclipse.xtext.resource.IEObjectDescription\nimport org.eclipse.xtext.naming.IQualifiedNameProvider\nimport com.db.plexus.interop.dsl.protobuf.Import\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\nimport com.db.plexus.interop.dsl.protobuf.Field\nimport com.db.plexus.interop.dsl.protobuf.FieldLabel\nimport com.db.plexus.interop.dsl.protobuf.Proto\nimport com.db.plexus.interop.dsl.protobuf.ProtoSyntax\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangConfig\nimport com.db.plexus.interop.dsl.protobuf.Method\nimport com.db.plexus.interop.dsl.protobuf.EnumValue\nimport com.db.plexus.interop.dsl.protobuf.Enum\nimport org.eclipse.xtext.EcoreUtil2\n\n/**\n * This class contains custom validation rules. \n *\n * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation\n */\nclass ProtoLangValidator extends AbstractProtoLangValidator {\n\t\n\tprivate static final char DOT_CHAR = '.'\n\tprivate static final char UNDERSCORE_CHAR = '_'\n\t\n\t@Inject\n\tIContainer.Manager containermanager;\n\n\t@Inject\n\tResourceDescriptionsProvider resourceDescriptionsProvider;\n\t\t\n\t@Inject\n\tIQualifiedNameProvider qualifiedNameProvider;\n\t\n\t@Inject\n\tProtoLangImportResolver importResolver\n\t\n\t@Inject\n\tProtoLangConfig protoLangConfig\n\n\t@Check\n\tdef checkSinglePackageDeclaration(Package ele) {\t\t\n\t\tif (ele.eContainer.eContents.filter(typeof(Package)).length > 1) {\t\t\t\t\t\n\t\t\terror('Duplicated package declaration', ProtobufPackage.Literals.PACKAGE__IMPORTED_NAMESPACE)\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkFullNameIsUnique(NamedElement element) {\n\t\tval name = qualifiedNameProvider.getFullyQualifiedName(element)\n\t\tval resourceDescriptions = resourceDescriptionsProvider.getResourceDescriptions(element.eResource());\n\t\tval resourceDescription = resourceDescriptions.getResourceDescription(element.eResource().getURI());\n\t\tfor (IContainer c : containermanager.getVisibleContainers(resourceDescription, resourceDescriptions)) {\n\t\t\tfor (IEObjectDescription od : c.getExportedObjectsByType(ProtobufPackage.Literals.NAMED_ELEMENT)) {\n\t\t\t\tif (name.equals(od.getQualifiedName()) && !od.EObjectOrProxy.equals(element)) {\n\t\t\t\t\terror(\"Duplicated qualified name: \" + name + \". \" + od.EClass.name + \" with the same qualified name is already defined in \" + od.EObjectOrProxy.eResource.URI, ProtobufPackage.Literals.NAMED_ELEMENT__NAME);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkEnumValueFullNameIsUnique(NamedElement element) {\n\t\tval name = qualifiedNameProvider.getFullyQualifiedName(element)\n\t\tval resourceDescriptions = resourceDescriptionsProvider.getResourceDescriptions(element.eResource());\n\t\tval resourceDescription = resourceDescriptions.getResourceDescription(element.eResource().getURI());\n\t\tfor (IContainer c : containermanager.getVisibleContainers(resourceDescription, resourceDescriptions)) {\n\t\t\tfor (IEObjectDescription od : c.getExportedObjectsByType(ProtobufPackage.Literals.ENUM_VALUE)) {\n\t\t\t\tif (name.equals(od.getQualifiedName()) && !od.EObjectOrProxy.equals(element)) {\n\t\t\t\t\terror(\"\\\"\" + (od.EObjectOrProxy as EnumValue).name + \"\\\" must be unique within \\\"\" + od.qualifiedName.skipLast(1) + \"\\\", not just within \\\"\" + (od.EObjectOrProxy.eContainer as Enum).name + \"\\\", because enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.\", ProtobufPackage.Literals.NAMED_ELEMENT__NAME);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkImport(Import ele) {\n\t\tval path = ele.importURI\n\t\tif (importResolver.resolveURI(ele.eResource.resourceSet, path) === null) {\n\t\t\tval resolveCandidates = importResolver.getResolveCandidates(path)\n\t\t\terror('Imported resource cannot be resolved: ' + path + '. The following candidates were checked: ' + resolveCandidates, ProtobufPackage.Literals.IMPORT__IMPORT_URI);\t\t\t\n\t\t}\t\t\t\t\n\t}\n\t\n\t@Check\n\tdef checkFieldNumbers(Field field) {\n\t\tvar fields = field.eContainer.eContents.filter(typeof(Field))\n\t\tfor (otherField: fields) {\n\t\t\tif (otherField.number == field.number && !otherField.equals(field)) {\n\t\t\t\terror('The same number assigned to field \"' + otherField.name + '\"', ProtobufPackage.Literals.FIELD__NUMBER)\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkFieldLabel(Field field) {\n\t\tvar proto = EcoreUtil2.getContainerOfType(field, typeof(Proto))\n\t\tif (proto.syntax === ProtoSyntax.PROTO3) {\n\t\t\tif (field.label === FieldLabel.REQUIRED) {\n\t\t\t\terror('Required field label forbidden in plexus proto3', ProtobufPackage.Literals.FIELD__NUMBER)\n\t\t\t}\n\t\t\tif (field.label === FieldLabel.OPTIONAL) {\n\t\t\t\terror('Optional field label forbidden in plexus proto3', ProtobufPackage.Literals.FIELD__NUMBER)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Check\n\tdef checkProtoResourceName(Proto proto) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tval fileName = proto.eResource.URI.lastSegment\n\t\tvar isValid = true\t\t\n\t\tfor (var i=0; isValid && i<fileName.length; i++) {\t\t\t\n\t\t\tval c = fileName.charAt(i)\n\t\t\tisValid = (Character.isLowerCase(c) && Character.isLetter(c)) || Character.isDigit(c) || c == UNDERSCORE_CHAR || c == DOT_CHAR\n\t\t}\n\t\tif (!isValid) {\t\t\t\n\t\t\terror('Resource name \"' + fileName + '\" is not valid. Only lower-case letters, digits, underscores and dots allowed.', proto, ProtobufPackage.Literals.PROTO__ELEMENTS)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkFieldName(Field field) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tval name = field.name\n\t\tvar isValid = name.length > 0 && Character.isLetter(name.charAt(0))\n\t\tfor (var i=0; isValid && i<name.length; i++) {\t\t\t\n\t\t\tval c = name.charAt(i)\n\t\t\tisValid = (Character.isLowerCase(c) && Character.isLetter(c)) || Character.isDigit(c) || c == UNDERSCORE_CHAR\n\t\t}\n\t\tif (!isValid) {\n\t\t\tval message = 'Field name \"' + name + '\" is not valid. Only lower-case letters, digits and underscores allowed. First symbol must be lower-cased letter.'\n\t\t\terror(message, field, ProtobufPackage.Literals.FIELD__NAME)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkDefinitionName(NamedElement ele) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tif (ele instanceof EnumValue) {\n\t\t\treturn\t\t\n\t\t}\n\t\tval name = ele.name\n\t\tvar isValid = name.length > 0 && Character.isLetter(name.charAt(0)) && Character.isUpperCase(name.charAt(0))\n\t\tfor (var i=0; isValid && i<name.length; i++) {\t\t\t\n\t\t\tval c = name.charAt(i)\n\t\t\tisValid = Character.isLetter(c) || Character.isDigit(c)\n\t\t}\n\t\tif (!isValid) {\n\t\t\tval message = 'Name of ' + ele.eClass.name + ' \"' + name + '\" is not valid. Only letters and digits allowed. First symbol must be upper-cased letter.'\n\t\t\terror(message, ele, ProtobufPackage.Literals.NAMED_ELEMENT__NAME)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkEnumValueName(EnumValue ele) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tval name = ele.name\n\t\tvar isValid = true\n\t\tfor (var i=0; isValid && i<name.length; i++) {\t\t\t\n\t\t\tval c = name.charAt(i)\n\t\t\tisValid = (Character.isLetter(c) && Character.isUpperCase(name.charAt(0))) || Character.isDigit(c) || c == UNDERSCORE_CHAR\n\t\t}\n\t\tif (!isValid) {\n\t\t\tval message = 'Name of ' + ele.eClass.name + ' \"' + name + '\" is not valid. Only letters, digits and underscores allowed. All letters must be upper-cased.'\n\t\t\terror(message, ele, ProtobufPackage.Literals.NAMED_ELEMENT__NAME)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkMethodName(Method ele) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tval name = ele.name\n\t\tvar isValid = name.length > 0 && Character.isLetter(name.charAt(0)) && Character.isUpperCase(name.charAt(0))\n\t\tfor (var i=0; isValid && i<name.length; i++) {\t\t\t\n\t\t\tval c = name.charAt(i)\n\t\t\tisValid = Character.isLetter(c) || Character.isDigit(c)\n\t\t}\n\t\tif (!isValid) {\n\t\t\tval message = 'Name of method \"' + name + '\" is not valid. Only letters and digits allowed. First symbol must be upper-cased letter.'\n\t\t\terror(message, ele, ProtobufPackage.Literals.METHOD__NAME)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkPackageName(Package ^package) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\n\t\tval name = ^package.importedNamespace\n\t\tvar isValid = true\t\t\n\t\tfor (var i=0; isValid && i<name.length; i++) {\t\t\t\n\t\t\tval c = name.charAt(i)\n\t\t\tisValid = (Character.isLowerCase(c) && Character.isLetter(c)) || Character.isDigit(c) || c == UNDERSCORE_CHAR || c == DOT_CHAR\n\t\t}\n\t\tif (!isValid) {\n\t\t\tval message = 'Package name \"' + name + '\" is not valid. Only lower-case letters, digits, underscores and dots allowed.'\n\t\t\terror(message, ^package, ProtobufPackage.Literals.PACKAGE__IMPORTED_NAMESPACE)\t\t\n\t\t}\n\t}\n\t\n\t@Check\n\tdef checkProtoResourceLocation(Proto proto) {\n\t\tif (!protoLangConfig.strictMode) {\n\t\t\treturn\n\t\t}\t\t\t\t\n\t\tval resource = proto.eResource\n\t\tval name = this.qualifiedNameProvider.getFullyQualifiedName(proto)\t\t\n\t\tval segments = name.skipFirst(1).segments\t\t\n\t\tval importPath = if (segments.length > 0) segments.join(\"/\") + \"/\" + resource.URI.lastSegment else resource.URI.lastSegment\n\t\tval resolvedUri = this.importResolver.resolveURI(resource.resourceSet, importPath)\t\n\t\tif (resolvedUri === null) {\n\t\t\tval candidates = this.importResolver.getResolveCandidates(importPath)\n\t\t\tval message = 'Resource folder do not correspond to its package name \"' + name.skipFirst(1) + '\". Valid locations for the resource: ' + candidates\n\t\t\tvar package = proto.elements.filter(typeof(Package)).findFirst[x|true]\t\t\t\t\t\n\t\t\tif (package === null) {\n\t\t\t\terror(message, proto, ProtobufPackage.Literals.PROTO__ELEMENTS)\n\t\t\t} else {\n\t\t\t\terror(message, package, ProtobufPackage.Literals.PACKAGE__IMPORTED_NAMESPACE)\n\t\t\t}\n\t\t}\n\t}\t\t\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/any.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"github.com/golang/protobuf/ptypes/any\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"AnyProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// `Any` contains an arbitrary serialized protocol buffer message along with a\n// URL that describes the type of the serialized message.\n//\n// Protobuf library provides support to pack/unpack Any values in the form\n// of utility functions or additional generated methods of the Any type.\n//\n// Example 1: Pack and unpack a message in C++.\n//\n//     Foo foo = ...;\n//     Any any;\n//     any.PackFrom(foo);\n//     ...\n//     if (any.UnpackTo(&foo)) {\n//       ...\n//     }\n//\n// Example 2: Pack and unpack a message in Java.\n//\n//     Foo foo = ...;\n//     Any any = Any.pack(foo);\n//     ...\n//     if (any.is(Foo.class)) {\n//       foo = any.unpack(Foo.class);\n//     }\n//\n//  Example 3: Pack and unpack a message in Python.\n//\n//     foo = Foo(...)\n//     any = Any()\n//     any.Pack(foo)\n//     ...\n//     if any.Is(Foo.DESCRIPTOR):\n//       any.Unpack(foo)\n//       ...\n//\n//  Example 4: Pack and unpack a message in Go\n//\n//      foo := &pb.Foo{...}\n//      any, err := ptypes.MarshalAny(foo)\n//      ...\n//      foo := &pb.Foo{}\n//      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n//        ...\n//      }\n//\n// The pack methods provided by protobuf library will by default use\n// 'type.googleapis.com/full.type.name' as the type URL and the unpack\n// methods only use the fully qualified type name after the last '/'\n// in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n// name \"y.z\".\n//\n//\n// JSON\n// ====\n// The JSON representation of an `Any` value uses the regular\n// representation of the deserialized, embedded message, with an\n// additional field `@type` which contains the type URL. Example:\n//\n//     package google.profile;\n//     message Person {\n//       string first_name = 1;\n//       string last_name = 2;\n//     }\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.profile.Person\",\n//       \"firstName\": <string>,\n//       \"lastName\": <string>\n//     }\n//\n// If the embedded message type is well-known and has a custom JSON\n// representation, that representation will be embedded adding a field\n// `value` which holds the custom JSON in addition to the `@type`\n// field. Example (for message [google.protobuf.Duration][]):\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n//       \"value\": \"1.212s\"\n//     }\n//\nmessage Any {\n  // A URL/resource name whose content describes the type of the\n  // serialized protocol buffer message.\n  //\n  // For URLs which use the scheme `http`, `https`, or no scheme, the\n  // following restrictions and interpretations apply:\n  //\n  // * If no scheme is provided, `https` is assumed.\n  // * The last segment of the URL's path must represent the fully\n  //   qualified name of the type (as in `path/google.protobuf.Duration`).\n  //   The name should be in a canonical form (e.g., leading \".\" is\n  //   not accepted).\n  // * An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  //   value in binary format, or produce an error.\n  // * Applications are allowed to cache lookup results based on the\n  //   URL, or have them precompiled into a binary to avoid any\n  //   lookup. Therefore, binary compatibility needs to be preserved\n  //   on changes to types. (Use versioned type names to manage\n  //   breaking changes.)\n  //\n  // Schemes other than `http`, `https` (or the empty scheme) might be\n  // used with implementation specific semantics.\n  //\n  string type_url = 1;\n\n  // Must be a valid serialized protocol buffer of the above specified type.\n  bytes value = 2;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/api.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/source_context.proto\";\nimport \"google/protobuf/type.proto\";\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"ApiProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/api;api\";\n\n// Api is a light-weight descriptor for an API Interface.\n//\n// Interfaces are also described as \"protocol buffer services\" in some contexts,\n// such as by the \"service\" keyword in a .proto file, but they are different\n// from API Services, which represent a concrete implementation of an interface\n// as opposed to simply a description of methods and bindings. They are also\n// sometimes simply referred to as \"APIs\" in other contexts, such as the name of\n// this message itself. See https://cloud.google.com/apis/design/glossary for\n// detailed terminology.\nmessage Api {\n\n  // The fully qualified name of this interface, including package name\n  // followed by the interface's simple name.\n  string name = 1;\n\n  // The methods of this interface, in unspecified order.\n  repeated Method methods = 2;\n\n  // Any metadata attached to the interface.\n  repeated Option options = 3;\n\n  // A version string for this interface. If specified, must have the form\n  // `major-version.minor-version`, as in `1.10`. If the minor version is\n  // omitted, it defaults to zero. If the entire version field is empty, the\n  // major version is derived from the package name, as outlined below. If the\n  // field is not empty, the version in the package name will be verified to be\n  // consistent with what is provided here.\n  //\n  // The versioning schema uses [semantic\n  // versioning](http://semver.org) where the major version number\n  // indicates a breaking change and the minor version an additive,\n  // non-breaking change. Both version numbers are signals to users\n  // what to expect from different versions, and should be carefully\n  // chosen based on the product plan.\n  //\n  // The major version is also reflected in the package name of the\n  // interface, which must end in `v<major-version>`, as in\n  // `google.feature.v1`. For major versions 0 and 1, the suffix can\n  // be omitted. Zero major versions must only be used for\n  // experimental, non-GA interfaces.\n  //\n  //\n  string version = 4;\n\n  // Source context for the protocol buffer service represented by this\n  // message.\n  SourceContext source_context = 5;\n\n  // Included interfaces. See [Mixin][].\n  repeated Mixin mixins = 6;\n\n  // The source syntax of the service.\n  Syntax syntax = 7;\n}\n\n// Method represents a method of an API interface.\nmessage Method {\n\n  // The simple name of this method.\n  string name = 1;\n\n  // A URL of the input message type.\n  string request_type_url = 2;\n\n  // If true, the request is streamed.\n  bool request_streaming = 3;\n\n  // The URL of the output message type.\n  string response_type_url = 4;\n\n  // If true, the response is streamed.\n  bool response_streaming = 5;\n\n  // Any metadata attached to the method.\n  repeated Option options = 6;\n\n  // The source syntax of this method.\n  Syntax syntax = 7;\n}\n\n// Declares an API Interface to be included in this interface. The including\n// interface must redeclare all the methods from the included interface, but\n// documentation and options are inherited as follows:\n//\n// - If after comment and whitespace stripping, the documentation\n//   string of the redeclared method is empty, it will be inherited\n//   from the original method.\n//\n// - Each annotation belonging to the service config (http,\n//   visibility) which is not set in the redeclared method will be\n//   inherited.\n//\n// - If an http annotation is inherited, the path pattern will be\n//   modified as follows. Any version prefix will be replaced by the\n//   version of the including interface plus the [root][] path if\n//   specified.\n//\n// Example of a simple mixin:\n//\n//     package google.acl.v1;\n//     service AccessControl {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v1/{resource=**}:getAcl\";\n//       }\n//     }\n//\n//     package google.storage.v2;\n//     service Storage {\n//       rpc GetAcl(GetAclRequest) returns (Acl);\n//\n//       // Get a data record.\n//       rpc GetData(GetDataRequest) returns (Data) {\n//         option (google.api.http).get = \"/v2/{resource=**}\";\n//       }\n//     }\n//\n// Example of a mixin configuration:\n//\n//     apis:\n//     - name: google.storage.v2.Storage\n//       mixins:\n//       - name: google.acl.v1.AccessControl\n//\n// The mixin construct implies that all methods in `AccessControl` are\n// also declared with same name and request/response types in\n// `Storage`. A documentation generator or annotation processor will\n// see the effective `Storage.GetAcl` method after inherting\n// documentation and annotations as follows:\n//\n//     service Storage {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v2/{resource=**}:getAcl\";\n//       }\n//       ...\n//     }\n//\n// Note how the version in the path pattern changed from `v1` to `v2`.\n//\n// If the `root` field in the mixin is specified, it should be a\n// relative path under which inherited HTTP paths are placed. Example:\n//\n//     apis:\n//     - name: google.storage.v2.Storage\n//       mixins:\n//       - name: google.acl.v1.AccessControl\n//         root: acls\n//\n// This implies the following inherited HTTP annotation:\n//\n//     service Storage {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\";\n//       }\n//       ...\n//     }\nmessage Mixin {\n  // The fully qualified name of the interface which is included.\n  string name = 1;\n\n  // If non-empty specifies a path under which inherited HTTP paths\n  // are rooted.\n  string root = 2;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/descriptor.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// The messages in this file describe the definitions found in .proto files.\n// A valid .proto file can be translated directly to a FileDescriptorProto\n// without any other information (e.g. without reading its imports).\n\n\nsyntax = \"proto2\";\n\npackage google.protobuf;\noption go_package = \"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DescriptorProtos\";\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption objc_class_prefix = \"GPB\";\n\n// descriptor.proto must be optimized for speed because reflection-based\n// algorithms don't work during bootstrapping.\noption optimize_for = SPEED;\n\n// The protocol compiler can output a FileDescriptorSet containing the .proto\n// files it parses.\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n}\n\n// Describes a complete .proto file.\nmessage FileDescriptorProto {\n  optional string name = 1;       // file name, relative to root of source tree\n  optional string package = 2;    // e.g. \"foo\", \"foo.bar\", etc.\n\n  // Names of files imported by this file.\n  repeated string dependency = 3;\n  // Indexes of the public imported files in the dependency list above.\n  repeated int32 public_dependency = 10;\n  // Indexes of the weak imported files in the dependency list.\n  // For Google-internal migration only. Do not use.\n  repeated int32 weak_dependency = 11;\n\n  // All top-level definitions in this file.\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n\n  optional FileOptions options = 8;\n\n  // This field contains optional information about the original source code.\n  // You may safely remove this entire field without harming runtime\n  // functionality of the descriptors -- the information is needed only by\n  // development tools.\n  optional SourceCodeInfo source_code_info = 9;\n\n  // The syntax of the proto file.\n  // The supported values are \"proto2\" and \"proto3\".\n  optional string syntax = 12;\n}\n\n// Describes a message type.\nmessage DescriptorProto {\n  optional string name = 1;\n\n  repeated FieldDescriptorProto field = 2;\n  repeated FieldDescriptorProto extension = 6;\n\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n\n    optional ExtensionRangeOptions options = 3;\n  }\n  repeated ExtensionRange extension_range = 5;\n\n  repeated OneofDescriptorProto oneof_decl = 8;\n\n  optional MessageOptions options = 7;\n\n  // Range of reserved tag numbers. Reserved tag numbers may not be used by\n  // fields or extension ranges in the same message. Reserved ranges may\n  // not overlap.\n  message ReservedRange {\n    optional int32 start = 1; // Inclusive.\n    optional int32 end = 2;   // Exclusive.\n  }\n  repeated ReservedRange reserved_range = 9;\n  // Reserved field names, which may not be used by fields in the same message.\n  // A given name may only be reserved once.\n  repeated string reserved_name = 10;\n}\n\nmessage ExtensionRangeOptions {\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n// Describes a field within a message.\nmessage FieldDescriptorProto {\n  enum Type {\n    // 0 is reserved for errors.\n    // Order is weird for historical reasons.\n    TYPE_DOUBLE         = 1;\n    TYPE_FLOAT          = 2;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\n    // negative values are likely.\n    TYPE_INT64          = 3;\n    TYPE_UINT64         = 4;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\n    // negative values are likely.\n    TYPE_INT32          = 5;\n    TYPE_FIXED64        = 6;\n    TYPE_FIXED32        = 7;\n    TYPE_BOOL           = 8;\n    TYPE_STRING         = 9;\n    // Tag-delimited aggregate.\n    // Group type is deprecated and not supported in proto3. However, Proto3\n    // implementations should still be able to parse the group wire format and\n    // treat group fields as unknown fields.\n    TYPE_GROUP          = 10;\n    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\n\n    // New in version 2.\n    TYPE_BYTES          = 12;\n    TYPE_UINT32         = 13;\n    TYPE_ENUM           = 14;\n    TYPE_SFIXED32       = 15;\n    TYPE_SFIXED64       = 16;\n    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\n    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\n  };\n\n  enum Label {\n    // 0 is reserved for errors\n    LABEL_OPTIONAL      = 1;\n    LABEL_REQUIRED      = 2;\n    LABEL_REPEATED      = 3;\n  };\n\n  optional string name = 1;\n  optional int32 number = 3;\n  optional Label label = 4;\n\n  // If type_name is set, this need not be set.  If both this and type_name\n  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.\n  optional Type type = 5;\n\n  // For message and enum types, this is the name of the type.  If the name\n  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\n  // rules are used to find the type (i.e. first the nested types within this\n  // message are searched, then within the parent, on up to the root\n  // namespace).\n  optional string type_name = 6;\n\n  // For extensions, this is the name of the type being extended.  It is\n  // resolved in the same manner as type_name.\n  optional string extendee = 2;\n\n  // For numeric types, contains the original text representation of the value.\n  // For booleans, \"true\" or \"false\".\n  // For strings, contains the default text contents (not escaped in any way).\n  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\n  // TODO(kenton):  Base-64 encode?\n  optional string default_value = 7;\n\n  // If set, gives the index of a oneof in the containing type's oneof_decl\n  // list.  This field is a member of that oneof.\n  optional int32 oneof_index = 9;\n\n  // JSON name of this field. The value is set by protocol compiler. If the\n  // user has set a \"json_name\" option on this field, that option's value\n  // will be used. Otherwise, it's deduced from the field's name by converting\n  // it to camelCase.\n  optional string json_name = 10;\n\n  optional FieldOptions options = 8;\n}\n\n// Describes a oneof.\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\n\n// Describes an enum type.\nmessage EnumDescriptorProto {\n  optional string name = 1;\n\n  repeated EnumValueDescriptorProto value = 2;\n\n  optional EnumOptions options = 3;\n}\n\n// Describes a value within an enum.\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n\n  optional EnumValueOptions options = 3;\n}\n\n// Describes a service.\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n\n  optional ServiceOptions options = 3;\n}\n\n// Describes a method of a service.\nmessage MethodDescriptorProto {\n  optional string name = 1;\n\n  // Input and output type names.  These are resolved in the same way as\n  // FieldDescriptorProto.type_name, but must refer to a message type.\n  optional string input_type = 2;\n  optional string output_type = 3;\n\n  optional MethodOptions options = 4;\n\n  // Identifies if client streams multiple client messages\n  optional bool client_streaming = 5 [default=false];\n  // Identifies if server streams multiple server messages\n  optional bool server_streaming = 6 [default=false];\n}\n\n\n// ===================================================================\n// Options\n\n// Each of the definitions above may have \"options\" attached.  These are\n// just annotations which may cause code to be generated slightly differently\n// or may contain hints for code that manipulates protocol messages.\n//\n// Clients may define custom options as extensions of the *Options messages.\n// These extensions may not yet be known at parsing time, so the parser cannot\n// store the values in them.  Instead it stores them in a field in the *Options\n// message called uninterpreted_option. This field must have the same name\n// across all *Options messages. We then use this field to populate the\n// extensions when we build a descriptor, at which point all protos have been\n// parsed and so all extensions are known.\n//\n// Extension numbers for custom options may be chosen as follows:\n// * For options which will only be used within a single application or\n//   organization, or for experimental options, use field numbers 50000\n//   through 99999.  It is up to you to ensure that you do not use the\n//   same number for multiple options.\n// * For options which will be published and used publicly by multiple\n//   independent entities, e-mail protobuf-global-extension-registry@google.com\n//   to reserve extension numbers. Simply provide your project name (e.g.\n//   Objective-C plugin) and your project website (if available) -- there's no\n//   need to explain how you intend to use them. Usually you only need one\n//   extension number. You can declare multiple options with only one extension\n//   number by putting them in a sub-message. See the Custom Options section of\n//   the docs for examples:\n//   https://developers.google.com/protocol-buffers/docs/proto#options\n//   If this turns out to be popular, a web service will be set up\n//   to automatically assign option numbers.\n\n\nmessage FileOptions {\n\n  // Sets the Java package where classes generated from this .proto will be\n  // placed.  By default, the proto package is used, but this is often\n  // inappropriate because proto packages do not normally start with backwards\n  // domain names.\n  optional string java_package = 1;\n\n\n  // If set, all the classes from the .proto file are wrapped in a single\n  // outer class with the given name.  This applies to both Proto1\n  // (equivalent to the old \"--one_java_file\" option) and Proto2 (where\n  // a .proto always translates to a single class, but you may want to\n  // explicitly choose the class name).\n  optional string java_outer_classname = 8;\n\n  // If set true, then the Java code generator will generate a separate .java\n  // file for each top-level message, enum, and service defined in the .proto\n  // file.  Thus, these types will *not* be nested inside the outer class\n  // named by java_outer_classname.  However, the outer class will still be\n  // generated to contain the file's getDescriptor() method as well as any\n  // top-level extensions defined in the file.\n  optional bool java_multiple_files = 10 [default=false];\n\n  // This option does nothing.\n  optional bool java_generate_equals_and_hash = 20 [deprecated=true];\n\n  // If set true, then the Java2 code generator will generate code that\n  // throws an exception whenever an attempt is made to assign a non-UTF-8\n  // byte sequence to a string field.\n  // Message reflection will do the same.\n  // However, an extension field still accepts non-UTF-8 byte sequences.\n  // This option has no effect on when used with the lite runtime.\n  optional bool java_string_check_utf8 = 27 [default=false];\n\n\n  // Generated classes can be optimized for speed or code size.\n  enum OptimizeMode {\n    SPEED = 1;        // Generate complete code for parsing, serialization,\n                      // etc.\n    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\n    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\n  }\n  optional OptimizeMode optimize_for = 9 [default=SPEED];\n\n  // Sets the Go package where structs generated from this .proto will be\n  // placed. If omitted, the Go package will be derived from the following:\n  //   - The basename of the package import path, if provided.\n  //   - Otherwise, the package statement in the .proto file, if present.\n  //   - Otherwise, the basename of the .proto file, without extension.\n  optional string go_package = 11;\n\n\n\n  // Should generic services be generated in each language?  \"Generic\" services\n  // are not specific to any particular RPC system.  They are generated by the\n  // main code generators in each language (without additional plugins).\n  // Generic services were the only kind of service generation supported by\n  // early versions of google.protobuf.\n  //\n  // Generic services are now considered deprecated in favor of using plugins\n  // that generate code specific to your particular RPC system.  Therefore,\n  // these default to false.  Old code which depends on generic services should\n  // explicitly set them to true.\n  optional bool cc_generic_services = 16 [default=false];\n  optional bool java_generic_services = 17 [default=false];\n  optional bool py_generic_services = 18 [default=false];\n  optional bool php_generic_services = 19 [default=false];\n\n  // Is this file deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for everything in the file, or it will be completely ignored; in the very\n  // least, this is a formalization for deprecating files.\n  optional bool deprecated = 23 [default=false];\n\n  // Enables the use of arenas for the proto messages in this file. This applies\n  // only to generated classes for C++.\n  optional bool cc_enable_arenas = 31 [default=false];\n\n\n  // Sets the objective c class prefix which is prepended to all objective c\n  // generated classes from this .proto. There is no default.\n  optional string objc_class_prefix = 36;\n\n  // Namespace for generated classes; defaults to the package.\n  optional string csharp_namespace = 37;\n\n  // By default Swift generators will take the proto package and CamelCase it\n  // replacing '.' with underscore and use that to prefix the types/symbols\n  // defined. When this options is provided, they will use this value instead\n  // to prefix the types/symbols defined.\n  optional string swift_prefix = 39;\n\n  // Sets the php class prefix which is prepended to all php generated classes\n  // from this .proto. Default is empty.\n  optional string php_class_prefix = 40;\n\n  // Use this option to change the namespace of php generated classes. Default\n  // is empty. When this option is empty, the package name will be used for\n  // determining the namespace.\n  optional string php_namespace = 41;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n\n  reserved 38;\n}\n\nmessage MessageOptions {\n  // Set true to use the old proto1 MessageSet wire format for extensions.\n  // This is provided for backwards-compatibility with the MessageSet wire\n  // format.  You should not use this for any other reason:  It's less\n  // efficient, has fewer features, and is more complicated.\n  //\n  // The message must be defined exactly as follows:\n  //   message Foo {\n  //     option message_set_wire_format = true;\n  //     extensions 4 to max;\n  //   }\n  // Note that the message cannot have any defined fields; MessageSets only\n  // have extensions.\n  //\n  // All extensions of your type must be singular messages; e.g. they cannot\n  // be int32s, enums, or repeated messages.\n  //\n  // Because this is an option, the above two restrictions are not enforced by\n  // the protocol compiler.\n  optional bool message_set_wire_format = 1 [default=false];\n\n  // Disables the generation of the standard \"descriptor()\" accessor, which can\n  // conflict with a field of the same name.  This is meant to make migration\n  // from proto1 easier; new code should avoid fields named \"descriptor\".\n  optional bool no_standard_descriptor_accessor = 2 [default=false];\n\n  // Is this message deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the message, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating messages.\n  optional bool deprecated = 3 [default=false];\n\n  // Whether the message is an automatically generated map entry type for the\n  // maps field.\n  //\n  // For maps fields:\n  //     map<KeyType, ValueType> map_field = 1;\n  // The parsed descriptor looks like:\n  //     message MapFieldEntry {\n  //         option map_entry = true;\n  //         optional KeyType key = 1;\n  //         optional ValueType value = 2;\n  //     }\n  //     repeated MapFieldEntry map_field = 1;\n  //\n  // Implementations may choose not to generate the map_entry=true message, but\n  // use a native map in the target language to hold the keys and values.\n  // The reflection APIs in such implementions still need to work as\n  // if the field is a repeated message field.\n  //\n  // NOTE: Do not set the option in .proto files. Always use the maps syntax\n  // instead. The option should only be implicitly set by the proto compiler\n  // parser.\n  optional bool map_entry = 7;\n\n  reserved 8;  // javalite_serializable\n  reserved 9;  // javanano_as_lite\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage FieldOptions {\n  // The ctype option instructs the C++ code generator to use a different\n  // representation of the field than it normally would.  See the specific\n  // options below.  This option is not yet implemented in the open source\n  // release -- sorry, we'll try to include it in a future version!\n  optional CType ctype = 1 [default = STRING];\n  enum CType {\n    // Default mode.\n    STRING = 0;\n\n    CORD = 1;\n\n    STRING_PIECE = 2;\n  }\n  // The packed option can be enabled for repeated primitive fields to enable\n  // a more efficient representation on the wire. Rather than repeatedly\n  // writing the tag and type for each element, the entire array is encoded as\n  // a single length-delimited blob. In proto3, only explicit setting it to\n  // false will avoid using packed encoding.\n  optional bool packed = 2;\n\n  // The jstype option determines the JavaScript type used for values of the\n  // field.  The option is permitted only for 64 bit integral and fixed types\n  // (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING\n  // is represented as JavaScript string, which avoids loss of precision that\n  // can happen when a large value is converted to a floating point JavaScript.\n  // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to\n  // use the JavaScript \"number\" type.  The behavior of the default option\n  // JS_NORMAL is implementation dependent.\n  //\n  // This option is an enum to permit additional types to be added, e.g.\n  // goog.math.Integer.\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  enum JSType {\n    // Use the default type.\n    JS_NORMAL = 0;\n\n    // Use JavaScript strings.\n    JS_STRING = 1;\n\n    // Use JavaScript numbers.\n    JS_NUMBER = 2;\n  }\n\n  // Should this field be parsed lazily?  Lazy applies only to message-type\n  // fields.  It means that when the outer message is initially parsed, the\n  // inner message's contents will not be parsed but instead stored in encoded\n  // form.  The inner message will actually be parsed when it is first accessed.\n  //\n  // This is only a hint.  Implementations are free to choose whether to use\n  // eager or lazy parsing regardless of the value of this option.  However,\n  // setting this option true suggests that the protocol author believes that\n  // using lazy parsing on this field is worth the additional bookkeeping\n  // overhead typically needed to implement it.\n  //\n  // This option does not affect the public interface of any generated code;\n  // all method signatures remain the same.  Furthermore, thread-safety of the\n  // interface is not affected by this option; const methods remain safe to\n  // call from multiple threads concurrently, while non-const methods continue\n  // to require exclusive access.\n  //\n  //\n  // Note that implementations may choose not to check required fields within\n  // a lazy sub-message.  That is, calling IsInitialized() on the outer message\n  // may return true even if the inner message has missing required fields.\n  // This is necessary because otherwise the inner message would have to be\n  // parsed in order to perform the check, defeating the purpose of lazy\n  // parsing.  An implementation which chooses not to check required fields\n  // must be consistent about it.  That is, for any particular sub-message, the\n  // implementation must either *always* check its required fields, or *never*\n  // check its required fields, regardless of whether or not the message has\n  // been parsed.\n  optional bool lazy = 5 [default=false];\n\n  // Is this field deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for accessors, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating fields.\n  optional bool deprecated = 3 [default=false];\n\n  // For Google-internal migration only. Do not use.\n  optional bool weak = 10 [default=false];\n\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n\n  reserved 4;  // removed jtype\n}\n\nmessage OneofOptions {\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumOptions {\n\n  // Set this option to true to allow mapping different tag names to the same\n  // value.\n  optional bool allow_alias = 2;\n\n  // Is this enum deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating enums.\n  optional bool deprecated = 3 [default=false];\n\n  reserved 5;  // javanano_as_lite\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumValueOptions {\n  // Is this enum value deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum value, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating enum values.\n  optional bool deprecated = 1 [default=false];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage ServiceOptions {\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this service deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the service, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating services.\n  optional bool deprecated = 33 [default=false];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage MethodOptions {\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this method deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the method, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating methods.\n  optional bool deprecated = 33 [default=false];\n\n  // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,\n  // or neither? HTTP based RPC implementation may choose GET verb for safe\n  // methods, and PUT verb for idempotent methods instead of the default POST.\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS     = 1; // implies idempotent\n    IDEMPOTENT          = 2; // idempotent, but may have side effects\n  }\n  optional IdempotencyLevel idempotency_level =\n      34 [default=IDEMPOTENCY_UNKNOWN];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n\n// A message representing a option the parser does not recognize. This only\n// appears in options protos created by the compiler::Parser class.\n// DescriptorPool resolves these when building Descriptor objects. Therefore,\n// options protos in descriptor objects (e.g. returned by Descriptor::options(),\n// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\n// in them.\nmessage UninterpretedOption {\n  // The name of the uninterpreted option.  Each string represents a segment in\n  // a dot-separated name.  is_extension is true iff a segment represents an\n  // extension (denoted with parentheses in options specs in .proto files).\n  // E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"qux\", false] } represents\n  // \"foo.(bar.baz).qux\".\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n  repeated NamePart name = 2;\n\n  // The value of the uninterpreted option, in whatever type the tokenizer\n  // identified it as during parsing. Exactly one of these should be set.\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n}\n\n// ===================================================================\n// Optional source code info\n\n// Encapsulates information about the original source file from which a\n// FileDescriptorProto was generated.\nmessage SourceCodeInfo {\n  // A Location identifies a piece of source code in a .proto file which\n  // corresponds to a particular definition.  This information is intended\n  // to be useful to IDEs, code indexers, documentation generators, and similar\n  // tools.\n  //\n  // For example, say we have a file like:\n  //   message Foo {\n  //     optional string foo = 1;\n  //   }\n  // Let's look at just the field definition:\n  //   optional string foo = 1;\n  //   ^       ^^     ^^  ^  ^^^\n  //   a       bc     de  f  ghi\n  // We have the following locations:\n  //   span   path               represents\n  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\n  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\n  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\n  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\n  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\n  //\n  // Notes:\n  // - A location may refer to a repeated field itself (i.e. not to any\n  //   particular index within it).  This is used whenever a set of elements are\n  //   logically enclosed in a single code segment.  For example, an entire\n  //   extend block (possibly containing multiple extension definitions) will\n  //   have an outer location whose path refers to the \"extensions\" repeated\n  //   field without an index.\n  // - Multiple locations may have the same path.  This happens when a single\n  //   logical declaration is spread out across multiple places.  The most\n  //   obvious example is the \"extend\" block again -- there may be multiple\n  //   extend blocks in the same scope, each of which will have the same path.\n  // - A location's span is not always a subset of its parent's span.  For\n  //   example, the \"extendee\" of an extension declaration appears at the\n  //   beginning of the \"extend\" block and is shared by all extensions within\n  //   the block.\n  // - Just because a location's span is a subset of some other location's span\n  //   does not mean that it is a descendent.  For example, a \"group\" defines\n  //   both a type and a field in a single declaration.  Thus, the locations\n  //   corresponding to the type and field and their components will overlap.\n  // - Code which tries to interpret locations should probably be designed to\n  //   ignore those that it doesn't understand, as more types of locations could\n  //   be recorded in the future.\n  repeated Location location = 1;\n  message Location {\n    // Identifies which part of the FileDescriptorProto was defined at this\n    // location.\n    //\n    // Each element is a field number or an index.  They form a path from\n    // the root FileDescriptorProto to the place where the definition.  For\n    // example, this path:\n    //   [ 4, 3, 2, 7, 1 ]\n    // refers to:\n    //   file.message_type(3)  // 4, 3\n    //       .field(7)         // 2, 7\n    //       .name()           // 1\n    // This is because FileDescriptorProto.message_type has field number 4:\n    //   repeated DescriptorProto message_type = 4;\n    // and DescriptorProto.field has field number 2:\n    //   repeated FieldDescriptorProto field = 2;\n    // and FieldDescriptorProto.name has field number 1:\n    //   optional string name = 1;\n    //\n    // Thus, the above path gives the location of a field name.  If we removed\n    // the last element:\n    //   [ 4, 3, 2, 7 ]\n    // this path refers to the whole field declaration (from the beginning\n    // of the label to the terminating semicolon).\n    repeated int32 path = 1 [packed=true];\n\n    // Always has exactly three or four elements: start line, start column,\n    // end line (optional, otherwise assumed same as start line), end column.\n    // These are packed into a single field for efficiency.  Note that line\n    // and column numbers are zero-based -- typically you will want to add\n    // 1 to each before displaying to a user.\n    repeated int32 span = 2 [packed=true];\n\n    // If this SourceCodeInfo represents a complete declaration, these are any\n    // comments appearing before and after the declaration which appear to be\n    // attached to the declaration.\n    //\n    // A series of line comments appearing on consecutive lines, with no other\n    // tokens appearing on those lines, will be treated as a single comment.\n    //\n    // leading_detached_comments will keep paragraphs of comments that appear\n    // before (but not connected to) the current element. Each paragraph,\n    // separated by empty lines, will be one comment element in the repeated\n    // field.\n    //\n    // Only the comment content is provided; comment markers (e.g. //) are\n    // stripped out.  For block comments, leading whitespace and an asterisk\n    // will be stripped from the beginning of each line other than the first.\n    // Newlines are included in the output.\n    //\n    // Examples:\n    //\n    //   optional int32 foo = 1;  // Comment attached to foo.\n    //   // Comment attached to bar.\n    //   optional int32 bar = 2;\n    //\n    //   optional string baz = 3;\n    //   // Comment attached to baz.\n    //   // Another line attached to baz.\n    //\n    //   // Comment attached to qux.\n    //   //\n    //   // Another line attached to qux.\n    //   optional double qux = 4;\n    //\n    //   // Detached comment for corge. This is not leading or trailing comments\n    //   // to qux or corge because there are blank lines separating it from\n    //   // both.\n    //\n    //   // Detached comment for corge paragraph 2.\n    //\n    //   optional string corge = 5;\n    //   /* Block comment attached\n    //    * to corge.  Leading asterisks\n    //    * will be removed. */\n    //   /* Block comment attached to\n    //    * grault. */\n    //   optional int32 grault = 6;\n    //\n    //   // ignored detached comments.\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n}\n\n// Describes the relationship between generated code and its original source\n// file. A GeneratedCodeInfo message is associated with only one generated\n// source file, but may contain references to different source .proto files.\nmessage GeneratedCodeInfo {\n  // An Annotation connects some span of text in generated code to an element\n  // of its generating .proto file.\n  repeated Annotation annotation = 1;\n  message Annotation {\n    // Identifies the element in the original source .proto file. This field\n    // is formatted the same as SourceCodeInfo.Location.path.\n    repeated int32 path = 1 [packed=true];\n\n    // Identifies the filesystem path to the original source .proto.\n    optional string source_file = 2;\n\n    // Identifies the starting offset in bytes in the generated code\n    // that relates to the identified object.\n    optional int32 begin = 3;\n\n    // Identifies the ending offset in bytes in the generated code that\n    // relates to the identified offset. The end offset should be one past\n    // the last relevant byte (so the length of the text = end - begin).\n    optional int32 end = 4;\n  }\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/duration.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/duration\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DurationProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// A Duration represents a signed, fixed-length span of time represented\n// as a count of seconds and fractions of seconds at nanosecond\n// resolution. It is independent of any calendar and concepts like \"day\"\n// or \"month\". It is related to Timestamp in that the difference between\n// two Timestamp values is a Duration and it can be added or subtracted\n// from a Timestamp. Range is approximately +-10,000 years.\n//\n// # Examples\n//\n// Example 1: Compute Duration from two Timestamps in pseudo code.\n//\n//     Timestamp start = ...;\n//     Timestamp end = ...;\n//     Duration duration = ...;\n//\n//     duration.seconds = end.seconds - start.seconds;\n//     duration.nanos = end.nanos - start.nanos;\n//\n//     if (duration.seconds < 0 && duration.nanos > 0) {\n//       duration.seconds += 1;\n//       duration.nanos -= 1000000000;\n//     } else if (durations.seconds > 0 && duration.nanos < 0) {\n//       duration.seconds -= 1;\n//       duration.nanos += 1000000000;\n//     }\n//\n// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.\n//\n//     Timestamp start = ...;\n//     Duration duration = ...;\n//     Timestamp end = ...;\n//\n//     end.seconds = start.seconds + duration.seconds;\n//     end.nanos = start.nanos + duration.nanos;\n//\n//     if (end.nanos < 0) {\n//       end.seconds -= 1;\n//       end.nanos += 1000000000;\n//     } else if (end.nanos >= 1000000000) {\n//       end.seconds += 1;\n//       end.nanos -= 1000000000;\n//     }\n//\n// Example 3: Compute Duration from datetime.timedelta in Python.\n//\n//     td = datetime.timedelta(days=3, minutes=10)\n//     duration = Duration()\n//     duration.FromTimedelta(td)\n//\n// # JSON Mapping\n//\n// In JSON format, the Duration type is encoded as a string rather than an\n// object, where the string ends in the suffix \"s\" (indicating seconds) and\n// is preceded by the number of seconds, with nanoseconds expressed as\n// fractional seconds. For example, 3 seconds with 0 nanoseconds should be\n// encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should\n// be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1\n// microsecond should be expressed in JSON format as \"3.000001s\".\n//\n//\nmessage Duration {\n\n  // Signed seconds of the span of time. Must be from -315,576,000,000\n  // to +315,576,000,000 inclusive. Note: these bounds are computed from:\n  // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years\n  int64 seconds = 1;\n\n  // Signed fractions of a second at nanosecond resolution of the span\n  // of time. Durations less than one second are represented with a 0\n  // `seconds` field and a positive or negative `nanos` field. For durations\n  // of one second or more, a non-zero value for the `nanos` field must be\n  // of the same sign as the `seconds` field. Must be from -999,999,999\n  // to +999,999,999 inclusive.\n  int32 nanos = 2;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/empty.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"github.com/golang/protobuf/ptypes/empty\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"EmptyProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption cc_enable_arenas = true;\n\n// A generic empty message that you can re-use to avoid defining duplicated\n// empty messages in your APIs. A typical example is to use it as the request\n// or the response type of an API method. For instance:\n//\n//     service Foo {\n//       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n//     }\n//\n// The JSON representation for `Empty` is empty JSON object `{}`.\nmessage Empty {}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/field_mask.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"FieldMaskProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/field_mask;field_mask\";\n\n// `FieldMask` represents a set of symbolic field paths, for example:\n//\n//     paths: \"f.a\"\n//     paths: \"f.b.d\"\n//\n// Here `f` represents a field in some root message, `a` and `b`\n// fields in the message found in `f`, and `d` a field found in the\n// message in `f.b`.\n//\n// Field masks are used to specify a subset of fields that should be\n// returned by a get operation or modified by an update operation.\n// Field masks also have a custom JSON encoding (see below).\n//\n// # Field Masks in Projections\n//\n// When used in the context of a projection, a response message or\n// sub-message is filtered by the API to only contain those fields as\n// specified in the mask. For example, if the mask in the previous\n// example is applied to a response message as follows:\n//\n//     f {\n//       a : 22\n//       b {\n//         d : 1\n//         x : 2\n//       }\n//       y : 13\n//     }\n//     z: 8\n//\n// The result will not contain specific values for fields x,y and z\n// (their value will be set to the default, and omitted in proto text\n// output):\n//\n//\n//     f {\n//       a : 22\n//       b {\n//         d : 1\n//       }\n//     }\n//\n// A repeated field is not allowed except at the last position of a\n// paths string.\n//\n// If a FieldMask object is not present in a get operation, the\n// operation applies to all fields (as if a FieldMask of all fields\n// had been specified).\n//\n// Note that a field mask does not necessarily apply to the\n// top-level response message. In case of a REST get operation, the\n// field mask applies directly to the response, but in case of a REST\n// list operation, the mask instead applies to each individual message\n// in the returned resource list. In case of a REST custom method,\n// other definitions may be used. Where the mask applies will be\n// clearly documented together with its declaration in the API.  In\n// any case, the effect on the returned resource/resources is required\n// behavior for APIs.\n//\n// # Field Masks in Update Operations\n//\n// A field mask in update operations specifies which fields of the\n// targeted resource are going to be updated. The API is required\n// to only change the values of the fields as specified in the mask\n// and leave the others untouched. If a resource is passed in to\n// describe the updated values, the API ignores the values of all\n// fields not covered by the mask.\n//\n// If a repeated field is specified for an update operation, the existing\n// repeated values in the target resource will be overwritten by the new values.\n// Note that a repeated field is only allowed in the last position of a `paths`\n// string.\n//\n// If a sub-message is specified in the last position of the field mask for an\n// update operation, then the existing sub-message in the target resource is\n// overwritten. Given the target message:\n//\n//     f {\n//       b {\n//         d : 1\n//         x : 2\n//       }\n//       c : 1\n//     }\n//\n// And an update message:\n//\n//     f {\n//       b {\n//         d : 10\n//       }\n//     }\n//\n// then if the field mask is:\n//\n//  paths: \"f.b\"\n//\n// then the result will be:\n//\n//     f {\n//       b {\n//         d : 10\n//       }\n//       c : 1\n//     }\n//\n// However, if the update mask was:\n//\n//  paths: \"f.b.d\"\n//\n// then the result would be:\n//\n//     f {\n//       b {\n//         d : 10\n//         x : 2\n//       }\n//       c : 1\n//     }\n//\n// In order to reset a field's value to the default, the field must\n// be in the mask and set to the default value in the provided resource.\n// Hence, in order to reset all fields of a resource, provide a default\n// instance of the resource and set all fields in the mask, or do\n// not provide a mask as described below.\n//\n// If a field mask is not present on update, the operation applies to\n// all fields (as if a field mask of all fields has been specified).\n// Note that in the presence of schema evolution, this may mean that\n// fields the client does not know and has therefore not filled into\n// the request will be reset to their default. If this is unwanted\n// behavior, a specific service may require a client to always specify\n// a field mask, producing an error if not.\n//\n// As with get operations, the location of the resource which\n// describes the updated values in the request message depends on the\n// operation kind. In any case, the effect of the field mask is\n// required to be honored by the API.\n//\n// ## Considerations for HTTP REST\n//\n// The HTTP kind of an update operation which uses a field mask must\n// be set to PATCH instead of PUT in order to satisfy HTTP semantics\n// (PUT must only be used for full updates).\n//\n// # JSON Encoding of Field Masks\n//\n// In JSON, a field mask is encoded as a single string where paths are\n// separated by a comma. Fields name in each path are converted\n// to/from lower-camel naming conventions.\n//\n// As an example, consider the following message declarations:\n//\n//     message Profile {\n//       User user = 1;\n//       Photo photo = 2;\n//     }\n//     message User {\n//       string display_name = 1;\n//       string address = 2;\n//     }\n//\n// In proto a field mask for `Profile` may look as such:\n//\n//     mask {\n//       paths: \"user.display_name\"\n//       paths: \"photo\"\n//     }\n//\n// In JSON, the same mask is represented as below:\n//\n//     {\n//       mask: \"user.displayName,photo\"\n//     }\n//\n// # Field Masks and Oneof Fields\n//\n// Field masks treat fields in oneofs just as regular fields. Consider the\n// following message:\n//\n//     message SampleMessage {\n//       oneof test_oneof {\n//         string name = 4;\n//         SubMessage sub_message = 9;\n//       }\n//     }\n//\n// The field mask can be:\n//\n//     mask {\n//       paths: \"name\"\n//     }\n//\n// Or:\n//\n//     mask {\n//       paths: \"sub_message\"\n//     }\n//\n// Note that oneof type names (\"test_oneof\" in this case) cannot be used in\n// paths.\nmessage FieldMask {\n  // The set of field mask paths.\n  repeated string paths = 1;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/source_context.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"SourceContextProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/source_context;source_context\";\n\n// `SourceContext` represents information about the source of a\n// protobuf element, like the file in which it is defined.\nmessage SourceContext {\n  // The path-qualified name of the .proto file that contained the associated\n  // protobuf element.  For example: `\"google/protobuf/source_context.proto\"`.\n  string file_name = 1;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/struct.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/struct;structpb\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"StructProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n\n// `Struct` represents a structured data value, consisting of fields\n// which map to dynamically typed values. In some languages, `Struct`\n// might be supported by a native representation. For example, in\n// scripting languages like JS a struct is represented as an\n// object. The details of that representation are described together\n// with the proto support for the language.\n//\n// The JSON representation for `Struct` is JSON object.\nmessage Struct {\n  // Unordered map of dynamically typed values.\n  map<string, Value> fields = 1;\n}\n\n// `Value` represents a dynamically typed value which can be either\n// null, a number, a string, a boolean, a recursive struct value, or a\n// list of values. A producer of value is expected to set one of that\n// variants, absence of any variant indicates an error.\n//\n// The JSON representation for `Value` is JSON value.\nmessage Value {\n  // The kind of value.\n  oneof kind {\n    // Represents a null value.\n    NullValue null_value = 1;\n    // Represents a double value.\n    double number_value = 2;\n    // Represents a string value.\n    string string_value = 3;\n    // Represents a boolean value.\n    bool bool_value = 4;\n    // Represents a structured value.\n    Struct struct_value = 5;\n    // Represents a repeated `Value`.\n    ListValue list_value = 6;\n  }\n}\n\n// `NullValue` is a singleton enumeration to represent the null value for the\n// `Value` type union.\n//\n//  The JSON representation for `NullValue` is JSON `null`.\nenum NullValue {\n  // Null value.\n  NULL_VALUE = 0;\n}\n\n// `ListValue` is a wrapper around a repeated field of values.\n//\n// The JSON representation for `ListValue` is JSON array.\nmessage ListValue {\n  // Repeated field of dynamically typed values.\n  repeated Value values = 1;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/timestamp.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/timestamp\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"TimestampProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// A Timestamp represents a point in time independent of any time zone\n// or calendar, represented as seconds and fractions of seconds at\n// nanosecond resolution in UTC Epoch time. It is encoded using the\n// Proleptic Gregorian Calendar which extends the Gregorian calendar\n// backwards to year one. It is encoded assuming all minutes are 60\n// seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n// table is needed for interpretation. Range is from\n// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.\n// By restricting to that range, we ensure that we can convert to\n// and from  RFC 3339 date strings.\n// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).\n//\n// # Examples\n//\n// Example 1: Compute Timestamp from POSIX `time()`.\n//\n//     Timestamp timestamp;\n//     timestamp.set_seconds(time(NULL));\n//     timestamp.set_nanos(0);\n//\n// Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n//\n//     struct timeval tv;\n//     gettimeofday(&tv, NULL);\n//\n//     Timestamp timestamp;\n//     timestamp.set_seconds(tv.tv_sec);\n//     timestamp.set_nanos(tv.tv_usec * 1000);\n//\n// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n//\n//     FILETIME ft;\n//     GetSystemTimeAsFileTime(&ft);\n//     UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n//\n//     // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n//     // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n//     Timestamp timestamp;\n//     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n//     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n//\n// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n//\n//     long millis = System.currentTimeMillis();\n//\n//     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n//         .setNanos((int) ((millis % 1000) * 1000000)).build();\n//\n//\n// Example 5: Compute Timestamp from current time in Python.\n//\n//     timestamp = Timestamp()\n//     timestamp.GetCurrentTime()\n//\n// # JSON Mapping\n//\n// In JSON format, the Timestamp type is encoded as a string in the\n// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n// format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n// where {year} is always expressed using four digits while {month}, {day},\n// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n// are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n// is required, though only UTC (as indicated by \"Z\") is presently supported.\n//\n// For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n// 01:30 UTC on January 15, 2017.\n//\n// In JavaScript, one can convert a Date object to this format using the\n// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]\n// method. In Python, a standard `datetime.datetime` object can be converted\n// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)\n// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one\n// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](\n// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime())\n// to obtain a formatter capable of generating timestamps in this format.\n//\n//\nmessage Timestamp {\n\n  // Represents seconds of UTC time since Unix epoch\n  // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n  // 9999-12-31T23:59:59Z inclusive.\n  int64 seconds = 1;\n\n  // Non-negative fractions of a second at nanosecond resolution. Negative\n  // second values with fractions must still have non-negative nanos values\n  // that count forward in time. Must be from 0 to 999,999,999\n  // inclusive.\n  int32 nanos = 2;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/type.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/source_context.proto\";\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"TypeProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/ptype;ptype\";\n\n// A protocol buffer message type.\nmessage Type {\n  // The fully qualified message name.\n  string name = 1;\n  // The list of fields.\n  repeated Field fields = 2;\n  // The list of types appearing in `oneof` definitions in this type.\n  repeated string oneofs = 3;\n  // The protocol buffer options.\n  repeated Option options = 4;\n  // The source context.\n  SourceContext source_context = 5;\n  // The source syntax.\n  Syntax syntax = 6;\n}\n\n// A single field of a message type.\nmessage Field {\n  // Basic field types.\n  enum Kind {\n    // Field type unknown.\n    TYPE_UNKNOWN        = 0;\n    // Field type double.\n    TYPE_DOUBLE         = 1;\n    // Field type float.\n    TYPE_FLOAT          = 2;\n    // Field type int64.\n    TYPE_INT64          = 3;\n    // Field type uint64.\n    TYPE_UINT64         = 4;\n    // Field type int32.\n    TYPE_INT32          = 5;\n    // Field type fixed64.\n    TYPE_FIXED64        = 6;\n    // Field type fixed32.\n    TYPE_FIXED32        = 7;\n    // Field type bool.\n    TYPE_BOOL           = 8;\n    // Field type string.\n    TYPE_STRING         = 9;\n    // Field type group. Proto2 syntax only, and deprecated.\n    TYPE_GROUP          = 10;\n    // Field type message.\n    TYPE_MESSAGE        = 11;\n    // Field type bytes.\n    TYPE_BYTES          = 12;\n    // Field type uint32.\n    TYPE_UINT32         = 13;\n    // Field type enum.\n    TYPE_ENUM           = 14;\n    // Field type sfixed32.\n    TYPE_SFIXED32       = 15;\n    // Field type sfixed64.\n    TYPE_SFIXED64       = 16;\n    // Field type sint32.\n    TYPE_SINT32         = 17;\n    // Field type sint64.\n    TYPE_SINT64         = 18;\n  };\n\n  // Whether a field is optional, required, or repeated.\n  enum Cardinality {\n    // For fields with unknown cardinality.\n    CARDINALITY_UNKNOWN = 0;\n    // For optional fields.\n    CARDINALITY_OPTIONAL = 1;\n    // For required fields. Proto2 syntax only.\n    CARDINALITY_REQUIRED = 2;\n    // For repeated fields.\n    CARDINALITY_REPEATED = 3;\n  };\n\n  // The field type.\n  Kind kind = 1;\n  // The field cardinality.\n  Cardinality cardinality = 2;\n  // The field number.\n  int32 number = 3;\n  // The field name.\n  string name = 4;\n  // The field type URL, without the scheme, for message or enumeration\n  // types. Example: `\"type.googleapis.com/google.protobuf.Timestamp\"`.\n  string type_url = 6;\n  // The index of the field type in `Type.oneofs`, for message or enumeration\n  // types. The first type has index 1; zero means the type is not in the list.\n  int32 oneof_index = 7;\n  // Whether to use alternative packed wire representation.\n  bool packed = 8;\n  // The protocol buffer options.\n  repeated Option options = 9;\n  // The field JSON name.\n  string json_name = 10;\n  // The string value of the default value of this field. Proto2 syntax only.\n  string default_value = 11;\n}\n\n// Enum type definition.\nmessage Enum {\n  // Enum type name.\n  string name = 1;\n  // Enum value definitions.\n  repeated EnumValue enumvalue = 2;\n  // Protocol buffer options.\n  repeated Option options = 3;\n  // The source context.\n  SourceContext source_context = 4;\n  // The source syntax.\n  Syntax syntax = 5;\n}\n\n// Enum value definition.\nmessage EnumValue {\n  // Enum value name.\n  string name = 1;\n  // Enum value number.\n  int32 number = 2;\n  // Protocol buffer options.\n  repeated Option options = 3;\n}\n\n// A protocol buffer option, which can be attached to a message, field,\n// enumeration, etc.\nmessage Option {\n  // The option's name. For protobuf built-in options (options defined in\n  // descriptor.proto), this is the short name. For example, `\"map_entry\"`.\n  // For custom options, it should be the fully-qualified name. For example,\n  // `\"google.api.http\"`.\n  string name = 1;\n  // The option's value packed in an Any message. If the value is a primitive,\n  // the corresponding wrapper type defined in google/protobuf/wrappers.proto\n  // should be used. If the value is an enum, it should be stored as an int32\n  // value using the google.protobuf.Int32Value type.\n  Any value = 2;\n}\n\n// The syntax in which a protocol buffer element is defined.\nenum Syntax {\n  // Syntax `proto2`.\n  SYNTAX_PROTO2 = 0;\n  // Syntax `proto3`.\n  SYNTAX_PROTO3 = 1;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/main/resources/google/protobuf/wrappers.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Wrappers for primitive (non-message) types. These types are useful\n// for embedding primitives in the `google.protobuf.Any` type and for places\n// where we need to distinguish between the absence of a primitive\n// typed field and its default value.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/wrappers\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"WrappersProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// Wrapper message for `double`.\n//\n// The JSON representation for `DoubleValue` is JSON number.\nmessage DoubleValue {\n  // The double value.\n  double value = 1;\n}\n\n// Wrapper message for `float`.\n//\n// The JSON representation for `FloatValue` is JSON number.\nmessage FloatValue {\n  // The float value.\n  float value = 1;\n}\n\n// Wrapper message for `int64`.\n//\n// The JSON representation for `Int64Value` is JSON string.\nmessage Int64Value {\n  // The int64 value.\n  int64 value = 1;\n}\n\n// Wrapper message for `uint64`.\n//\n// The JSON representation for `UInt64Value` is JSON string.\nmessage UInt64Value {\n  // The uint64 value.\n  uint64 value = 1;\n}\n\n// Wrapper message for `int32`.\n//\n// The JSON representation for `Int32Value` is JSON number.\nmessage Int32Value {\n  // The int32 value.\n  int32 value = 1;\n}\n\n// Wrapper message for `uint32`.\n//\n// The JSON representation for `UInt32Value` is JSON number.\nmessage UInt32Value {\n  // The uint32 value.\n  uint32 value = 1;\n}\n\n// Wrapper message for `bool`.\n//\n// The JSON representation for `BoolValue` is JSON `true` and `false`.\nmessage BoolValue {\n  // The bool value.\n  bool value = 1;\n}\n\n// Wrapper message for `string`.\n//\n// The JSON representation for `StringValue` is JSON string.\nmessage StringValue {\n  // The string value.\n  string value = 1;\n}\n\n// Wrapper message for `bytes`.\n//\n// The JSON representation for `BytesValue` is JSON string.\nmessage BytesValue {\n  // The bytes value.\n  bytes value = 1;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/test/java/com/db/plexus/interop/dsl/protobuf/tests/ProtoLangImportResolverTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.tests\n\nimport org.junit.runner.RunWith\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.eclipse.xtext.testing.InjectWith\nimport com.google.inject.Inject\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangImportResolver\nimport org.junit.Test\nimport org.eclipse.emf.common.util.URI\nimport org.junit.Assert\n\n@RunWith(XtextRunner)\n@InjectWith(ProtoLangInjectorProvider)\nclass ProtoLangImportResolverTest {\n\n    @Inject\n    ProtoLangImportResolver importResolver;\n\n    @Test\n    def testEncodeURIDeresolve() {\n        val base = URI.createURI(\"file:///c:/projects/\")\n        val uri = URI.createURI(\"file:///c%3A/projects/path/file.interop\")\n        Assert.assertEquals(\"path/file.interop\", importResolver.deresolve(base, uri).toFileString.replace(\"\\\\\", \"/\"))\n    }\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/java/com/db/plexus/interop/dsl/protobuf/tests/ProtoLangParsingTest.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * generated by Xtext 2.12.0\n */\npackage com.db.plexus.interop.dsl.protobuf.tests\n\nimport com.google.inject.Inject\nimport org.eclipse.xtext.testing.XtextRunner\nimport org.junit.Assert\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.eclipse.emf.ecore.resource.ResourceSet\nimport org.eclipse.emf.common.util.URI\nimport org.eclipse.xtext.validation.IResourceValidator\nimport org.eclipse.xtext.util.CancelIndicator\nimport org.eclipse.xtext.validation.CheckMode\nimport org.eclipse.emf.ecore.resource.Resource\nimport org.eclipse.xtext.EcoreUtil2\nimport org.eclipse.xtext.resource.XtextResource\nimport org.eclipse.xtext.validation.Issue\nimport java.util.List\nimport java.util.LinkedList\nimport org.eclipse.xtext.testing.InjectWith\n\n@RunWith(XtextRunner)\n@InjectWith(ProtoLangInjectorProvider)\nclass ProtoLangParsingTest {\n\t\n\t@Inject\n\tResourceSet rs\t\n\n\t@Test\n\tdef void loadFile() {\n\t\tloadAndValidateResource(\"com/db/plexus/interop/dsl/protobuf/tests/example1.proto\", 4)\t\t\t\t\t\t\t\t\t\n\t}\n\t\t\n\t@Test\n\tdef void loadOptionsProto() {\t\t\n\t\tloadAndValidateResource(\"com/db/plexus/interop/dsl/protobuf/tests/option_usage.proto\", 4)\t\t\t\t\t\t\t\t\t\n\t}\n\t\n\t@Test\n\tdef void loadDescriptorProto() {\n\t\tloadAndValidateResource(\"google/protobuf/descriptor.proto\", 1)\t\t\n\t}\n\t\n\t@Test\n\tdef void loadApiProto() {\n\t\tloadAndValidateResource(\"google/protobuf/api.proto\", 5)\t\t\n\t}\n\t\n\t@Test\n\tdef void loadScopingProto() {\n\t\tloadAndValidateResource(\"com/db/plexus/interop/dsl/protobuf/tests/scoping/test1.proto\", 3)\n\t}\n\t\n\t@Test\n\tdef void loadEnumValuesNamingProto() {\n\t\tval resourceUri = \"com/db/plexus/interop/dsl/protobuf/tests/enum_values_naming.proto\"\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(resourceUri).toURI().toString())\n\t\tSystem.out.println(\"Parsing \" + uri)\n\t\tAssert.assertEquals(0, rs.resources.length)\n\t\trs.getResource(uri, true)\n\t\tEcoreUtil2.resolveAll(rs);\n\t\tval allResources = rs.resources\n\t\tval issues = new LinkedList<Issue>()\t\t\n\t\tfor (r : allResources) {\n\t\t\tvalidateResource(r, issues)\n\t\t}\n\t\tAssert.assertEquals(8, issues.length)\n\t\tSystem.out.println(issues.length + \" expected issues found: \")\n\t\tfor (issue : issues) {\n\t\t\tSystem.out.println(issue);\n\t\t}\t\t\t\n\t}\n\t\n\tdef loadAndValidateResource(String resourceUri, int expectedResourceCount) {\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(resourceUri).toURI().toString())\n\t\tSystem.out.println(\"Parsing \" + uri)\n\t\tAssert.assertEquals(0, rs.resources.length)\n\t\tval resource = rs.getResource(uri, true)\n\t\tEcoreUtil2.resolveAll(rs);\n\t\tval allResources = rs.resources\n\t\tval issues = new LinkedList<Issue>()\t\t\n\t\tfor (r : allResources) {\n\t\t\tvalidateResource(r, issues)\n\t\t}\n\t\tfor (issue : issues) {\n\t\t\tSystem.err.println(issue);\n\t\t}\n\t\tAssert.assertEquals(0, issues.length)\n\t\tAssert.assertEquals(expectedResourceCount, allResources.length)\n\t\treturn resource\n\t}\n\t\n\tdef validateResource(Resource r, List<Issue> issues) {\n\t\tval validator = (r as XtextResource).getResourceServiceProvider().get(typeof(IResourceValidator));\n\t\tSystem.out.println(\"Validating \" + r.URI)\n\t\tissues.addAll(validator.validate(r, CheckMode.ALL, CancelIndicator.NullImpl))\t\t\t\t\t\t\t\t\n\t}\t\n\n\t@Test\n\tdef void validateProto3FieldLabel() {\n\t\tval resourceUri = \"com/db/plexus/interop/dsl/protobuf/tests/field_label.proto\"\n\t\tval uri = URI.createURI(ClassLoader.getSystemClassLoader().getResource(resourceUri).toURI().toString())\n\t\tSystem.out.println(\"Parsing \" + uri)\n\t\tAssert.assertEquals(0, rs.resources.length)\n\t\trs.getResource(uri, true)\n\t\tEcoreUtil2.resolveAll(rs);\n\t\tval allResources = rs.resources\n\t\tval issues = new LinkedList<Issue>()\n\t\tfor (r : allResources) {\n\t\t\tvalidateResource(r, issues)\n\t\t}\n\t\tAssert.assertEquals(2, issues.length)\n\t\tSystem.out.println(issues.length + \" expected issues found: \")\n\t\tfor (issue : issues) {\n\t\t\tSystem.out.println(issue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/enum_values_naming.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nenum Enum1 {\n\tVALUE_0 = 0;\n\tVALUE_1 = 1;\n}\n\nenum Enum2 {\n\tVALUE_0 = 0;\n\tVALUE_1 = 1;\n\tVALUE_2 = 2;\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/example1.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"com/db/plexus/interop/dsl/protobuf/tests/example2.proto\";\n\noption csharp_namespace=\"Plexus.Interop.Generated\";\noption (int_option)=1;\n\nextend google.protobuf.FileOptions {\n\tuint32 int_option = 9000;\n}\n\nextend google.protobuf.MessageOptions {\n\tstring message_opt = 9000;\n}\n\nextend google.protobuf.FieldOptions {\n\tstring string_option = 9000;\n\tEnum2 enum_option = 9100;\n}\n\nextend google.protobuf.ServiceOptions {\n\tstring service_id = 9000;\n}\n\nextend google.protobuf.MethodOptions {\n\tstring method_id = 9000;\n}\n\nenum Enum2 {\n\tVALUE_1 = 1;\n\tVALUE_2 = 2;\n\tVALUE_3 = 3;\n}\n\nmessage Message1 {\n\tstring string_field_1 = 1;\n\tsint32 sint32_field_1 = 2;\n\n\tmap<sint32, .com.db.plexus.interop.dsl.protobuf.tests.Message2> map_field_1 = 99;\n\n\t.com.db.plexus.interop.dsl.protobuf.tests.Enum1 enum_field_1 = 3;\n\tMessage2 message_field_1 = 10;\n\tMessage2.SubEnum1 external_sun_enum_1 = 11;\n\tMessage3 external_file_message = 13;\n\n\treserved 'reserve3', 'reserve4';\n\n\toneof oneOfField {\n\t\t.com.db.plexus.interop.dsl.protobuf.tests.Message2 oneof_case_1 = 16;\n\t\tMessage3 oneof_case_2 = 17;\n\t}\n\n\treserved 'reserve1', 'reserve2';\n\n\treserved 100 to 999, 10000;\n\n\tsubfolder.Message4 msg4_field = 5;\n}\n\nenum Enum1 {\n}\n\nmessage Message2 {\n\tenum SubEnum1 {\n\t}\n\n\tmessage SubMessage1 {\n\t\tmessage SubMessage1 {\n\t\t}\n\t}\n\n\tmessage SubMessage2 {\n\t\tSubMessage1.SubMessage1 sub_sub_field_1 = 1 [(tests.string_option)=\"aaa\", (.com.db.plexus.interop.dsl.protobuf.tests.enum_option) = VALUE_2];\n\t\tSubMessage1 sub_field_1 = 2;\n\t}\n\n\toption (message_opt) = \"aaa\";\n\n\tSubMessage1 sub_message_field_1 = 1;\n}\n\nservice Service1 {        \n\trpc ServerStream (Message1) returns (stream Message2);\n\trpc DuplexStream (stream Message2) returns (stream tests.Message2) { option (protobuf.tests.method_id)=\"xxx\"; }\n\toption (service_id) = \"Service1\";\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/example2.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nimport public \"com/db/plexus/interop/dsl/protobuf/tests/subfolder/example3.proto\";\n\nmessage Message3 {\n\tstring int_field = 1;\n\n\tmap<string, Message3> map_field_1 = 99;\n}\n\nenum Enum3 {\n\n}\n\nservice TestService {\n\trpc Test (subfolder.Message4) returns (subfolder.Message4);\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/field_label.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nmessage InvalidMessage {\n\trequired string required_field = 1;\n\toptional string optional_field = 2;\n}\n"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/option_declare.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n\tstring message_string = 9650;\n\tuint32 message_int = 9700; \n}\n\nextend google.protobuf.ServiceOptions {\n\tstring service_string = 9650;\n\tuint32 service_int = 9700;\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/option_usage.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests;\n\nimport \"google/protobuf/empty.proto\";\nimport \"com/db/plexus/interop/dsl/protobuf/tests/option_declare.proto\";\n\nmessage UniqueId {\n    option (tests.message_string) = \"interop.UniqueId\";\n    option (message_int) = 10;\n    option deprecated = true;\n\n    fixed64 lo = 1;\n    fixed64 hi = 2;\n}\n\nservice UniqueIdService {\n\toption (service_string) = \"interop.GetUniqueId\";\n\toption (.com.db.plexus.interop.dsl.protobuf.tests.service_int) = 10;\n\t\n\trpc GetUniqueId (google.protobuf.Empty) returns (UniqueId);\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/scoping/scoping/test3.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax=\"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests.scoping.scoping;\n\nmessage Message3 {\n  string field = 1;\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/scoping/test1.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax=\"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests.scoping;\n\nimport \"com/db/plexus/interop/dsl/protobuf/tests/scoping/test2.proto\";\nimport \"com/db/plexus/interop/dsl/protobuf/tests/scoping/scoping/test3.proto\";\n\nmessage Message1 {\n  Message2 field2 = 2;\n  scoping.Message3 field = 1;\n}\n\nmessage Message2 {\n\tbool field = 2;\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/scoping/test2.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax=\"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests.scoping;\n\nmessage Message3 {\n  string field = 1;\n}"
  },
  {
    "path": "dsl/proto-lang/src/test/resources/com/db/plexus/interop/dsl/protobuf/tests/subfolder/example3.proto",
    "content": "//\n// Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage com.db.plexus.interop.dsl.protobuf.tests.subfolder;\n\nmessage Message4 {\n}"
  },
  {
    "path": "dsl/proto-lang.ide/build.gradle",
    "content": "apply plugin: 'application'\n\ndependencies {\n    compile project(':dsl:proto-lang')\n    compile project(':dsl:ide-common')\n    compile \"org.eclipse.xtext:org.eclipse.xtext.ide:${xtextVersion}\"\n    compile \"org.eclipse.xtext:org.eclipse.xtext.xbase.ide:${xtextVersion}\"\n}\n\nmainClassName = 'com.db.plexus.interop.dsl.protobuf.server.StdIOServerLauncher'\napplicationName = 'proto-lang-server'\n\n// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976\nconfigurations.all {\n    resolutionStrategy {\n        eachDependency { DependencyResolveDetails details ->\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {\n                details.useVersion \"3.19.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {\n                details.useVersion \"3.13.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {\n                details.useVersion \"3.12.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {\n                details.useVersion \"3.10.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {\n                details.useVersion \"3.11.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {\n                details.useVersion \"3.7.0\"\n            }\n            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {\n                details.useVersion \"3.9.0\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/ide/ProtoLangIdeModule.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.ide\n\nimport com.google.inject.Binder\nimport org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider\nimport com.db.plexus.interop.ide.assist.ImportContentProvider\n\nclass ProtoLangIdeModule extends AbstractProtoLangIdeModule {\n\n    def configureContentAssistProvider(Binder binder) {\n        binder.bind(typeof(IdeContentProposalProvider))\n            .to(typeof(ImportContentProvider));\n    }\n\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/ide/ProtoLangIdeSetup.xtend",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.ide\n\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangRuntimeModule\nimport com.db.plexus.interop.dsl.protobuf.ProtoLangStandaloneSetup\nimport com.google.inject.Guice\nimport org.eclipse.xtext.util.Modules2\n\n/**\n * Initialization support for running Xtext languages as language servers.\n */\nclass ProtoLangIdeSetup extends ProtoLangStandaloneSetup {\n\n\toverride createInjector() {\n\t\tGuice.createInjector(Modules2.mixin(new ProtoLangRuntimeModule, new ProtoLangIdeModule))\n\t}\n\t\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/server/ProtoDebugServerLauncher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.server;\n\nimport com.google.inject.Guice;\nimport com.google.inject.Injector;\nimport org.eclipse.xtext.ide.server.LanguageServerImpl;\n\nimport java.io.IOException;\nimport java.util.concurrent.ExecutionException;\n\nimport static com.db.plexus.interop.ide.server.DebugServerLauncher.launch;\n\npublic class ProtoDebugServerLauncher {\n\n    public static void main(String[] args) throws InterruptedException, IOException, ExecutionException {\n        final Injector injector = Guice.createInjector(new ProtoLangServerModule());\n        final LanguageServerImpl languageServer = injector.getInstance(ProtoLanguageServer.class);\n        launch(languageServer, 5556);\n    }\n\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/server/ProtoLangServerModule.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.server;\n\nimport com.google.inject.AbstractModule;\nimport org.eclipse.xtext.ide.ExecutorServiceProvider;\nimport org.eclipse.xtext.ide.server.*;\nimport org.eclipse.xtext.resource.IContainer;\nimport org.eclipse.xtext.resource.IResourceServiceProvider;\nimport org.eclipse.xtext.resource.ResourceServiceProviderServiceLoader;\nimport org.eclipse.xtext.resource.containers.ProjectDescriptionBasedContainerManager;\n\nimport java.util.concurrent.ExecutorService;\n\npublic class ProtoLangServerModule extends AbstractModule {\n\n    protected void configure() {\n        this.binder().bind(ExecutorService.class).toProvider(ExecutorServiceProvider.class);\n        this.bind(LanguageServerImpl.class).to(ProtoLanguageServer.class);\n        this.bind(IResourceServiceProvider.Registry.class).toProvider(ResourceServiceProviderServiceLoader.class);\n        this.bind(IWorkspaceConfigFactory.class).to(ProjectWorkspaceConfigFactory.class);\n        this.bind(IProjectDescriptionFactory.class).to(DefaultProjectDescriptionFactory.class);\n        this.bind(IContainer.Manager.class).to(ProjectDescriptionBasedContainerManager.class);\n    }\n\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/server/ProtoLanguageServer.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.server;\n\nimport com.db.plexus.interop.dsl.protobuf.StaticConfigHolder;\nimport org.eclipse.emf.common.util.URI;\nimport org.eclipse.lsp4j.InitializeParams;\nimport org.eclipse.lsp4j.InitializeResult;\nimport org.eclipse.xtext.ide.server.LanguageServerImpl;\n\nimport java.util.concurrent.CompletableFuture;\n\npublic class ProtoLanguageServer extends LanguageServerImpl {\n\n    @Override\n    public CompletableFuture<InitializeResult> initialize(InitializeParams params) {\n        final String rootUri = params.getRootUri();\n        if (rootUri != null) {\n            StaticConfigHolder.protoLangConfig.addBaseURI(stringToUri(rootUri));\n        }\n        return super.initialize(params);\n    }\n\n    private URI stringToUri(String rootUri) {\n        final String normalized = rootUri.endsWith(\"/\") ? rootUri : rootUri + \"/\";\n        return URI.createURI(normalized);\n    }\n}\n"
  },
  {
    "path": "dsl/proto-lang.ide/src/main/java/com/db/plexus/interop/dsl/protobuf/server/StdIOServerLauncher.java",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.db.plexus.interop.dsl.protobuf.server;\n\nimport org.eclipse.xtext.ide.server.ServerLauncher;\n\npublic class StdIOServerLauncher extends ServerLauncher {\n\n    public static void main(final String[] args) {\n        ServerLauncher.launch(StdIOServerLauncher.class.getName(), args, new ProtoLangServerModule());\n    }\n\n}\n"
  },
  {
    "path": "gradle/maven-deployment.gradle",
    "content": "//see https://docs.gradle.org/current/userguide/maven_plugin.html\napply plugin: 'maven'\n\nuploadArchives {\n\trepositories {\n\t\tmavenDeployer {\n\t\t\trepository(url: \"file://${buildDir}/localRepo\")\n\t\t\tsnapshotRepository(url: \"file://${buildDir}/localRepo\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "gradle/source-layout.gradle",
    "content": "sourceSets {\n\tmain {\n\t\tjava.srcDirs = ['src/main/java', 'src/main/xtext-gen']\n\t\tresources.srcDirs = ['src/main/resources', 'src/main/xtext-gen']\n\t\txtendOutputDir = 'src/main/xtend-gen'\n\t}\n\ttest {\n\t\tjava.srcDirs = ['src/test/java', 'src/test/xtext-gen']\n\t\tresources.srcDirs = ['src/test/resources', 'src/test/xtext-gen']\n\t\txtendOutputDir = 'src/test/xtend-gen'\n\t}\n}\n\njar {\n\tfrom('model') {\n\t\tinto('model')\n\t}\n\tmanifest {\n\t\tattributes 'Bundle-SymbolicName': project.name\n\t}\n}\n\nplugins.withId('war') {\n\twebAppDirName = \"src/main/webapp\"\n}\n\nplugins.withId('org.xtext.idea-plugin') {\n\tassembleSandbox.metaInf.from('src/main/resources/META-INF')\n}"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Aug 09 20:01:34 MSK 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.10-bin.zip\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [[ \"$(uname)\" == \"Darwin\" ]] && [[ \"$HOME\" == \"$PWD\" ]]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windows variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "greeting-details.md",
    "content": "\n# Greeting Sample Internal Detals\n\nThis page provides detailed view on Greeting sample - two apps communicating via Plexus Interop with simple greeting messages. Fully runnable examples are available at **./bin/win-x86/samples/greeting** folder after you run the full build of the repo. Steps to run the demo from your workstation and links to code of demo apps are described at [Public Documentation](https://plexus.finos.org/#sample-apps)\n\nFollowing diagram defines high level structure of running components, *blue* boxes define Plexus Interop artifacts available for Open Source Community.\n\n![Key components and high level architecture](./docs/src/main/asciidoc/images/greeting-high-level.png \"Key components and high level architecture\")\n\n- [DSL CLI Tools](./dsl) - Metadata's DSL definition and tooling, including validation / code generation / vscode editor plugin / Command Line Interface and other features\n- [Broker](./desktop/src/Plexus.Interop.Broker) - component runningon desktop, the mediator between all communication flows between Applications\n- [Generic Client (JS)](./web/packages/client) - JS/TS Client API, entry point of communication between JS based Applications and Broker, used as a base for Generated Clients\n- [Generic Client (.Net)](/desktop/src/Plexus.Interop.Client) - .Net Client API, entry point of communication between JS based Applications and Broker, used as a base for Generated Clients\n- **Native App Launcher** and [Electron App Launcher](./web/packages/electron-launcher) - reference implementations of **App Launcher** interface, implemented in .Net and JS\n\n\n\n"
  },
  {
    "path": "nodejs-broker-roadmap.md",
    "content": "\n# Node JS Broker Implementation Road Map\n\n<!-- TOC -->\n- [High Level Design](#high-level-design)\n- [Road Map](#road-map)\n    - [1. Adoption of Existing JS Broker for Desktop](#adoption-of-existing-js-broker-for-desktop)\n        - [Target State](#target-state)\n    - [2. Feature Parity with .Net Broker](#feature-parity-with-net-broker)\n        - [Target State](#target-state-3)\n    - [3. Support for JSON and ProtobufJS based Serialization for JS clients](#support-for-json-and-protobufjs-based-serialization-for-js-clients)\n        - [Target State](#target-state-1)\n    - [4. Full Implementation of Common Interop API](#full-implementation-of-common-interop-api)\n        - [Target State](#target-state-2)\n    <!-- /TOC -->\n\n<a id=\"high-level-design\" name=\"high-level-design\"></a>\n## High Level Design\n\nExisting [Desktop Interop Broker](./desktop/src/Plexus.Interop.Broker) is implemented using following architecture, including main components:\n\n- **Interop Broker** - process which handles application connections, routes calls between them and able to launch new applications instances on demand.\n- **App Life Cycle Manager** - component inside Broker which tracks active connections and can trigger launch of an application on demand by sending a request to the appropriate Application Launcher.\n- **App Launcher** - responsible for launching of Applications and reporting about their status to App Life Cycle Manager.\n- **Interop Transport** - plagguble transport implementation, used by both Broker and App Instance for comminication\n\n![Key components and high level architecture](./docs/src/main/asciidoc/images/high-level-architecture2.png \"Key components and high level architecture\")\n\nCurrent [Broker Implementation for Stand alone Browser](./web/packages/broker/src/broker/Broker.ts) based on same principles, therefore already defined required interfaces:\n\n- [App Life Cycle Manager (TS)](./web/packages/broker/src/lifecycle/AppLifeCycleManager.ts)\n- [App Launcher (TS)](./web/packages/broker/src/launcher/AppLifeCycleManager.ts)\n- [Transport Connection (TS)](./packages/transport-common/src/transport/TransportConnection.ts)\n- [Interop Client (TS)](./packages/client/src/client/api/generic/GenericClientApi.ts)\n\nAlso default implementation of some components, like **InteropRegistryProvider**/**Broker**/**Discovery Handler**/etc, will work well in Node JS environment. So we can start with adopting everything we already have and implement missed Desktop implementations like native App Life Cycle Manager.\n\n<a id=\"road-map\" name=\"road-map\"></a>\n## Road Map\n\n<a id=\"adoption-of-existing-js-broker-for-desktop\" name=\"adoption-of-existing-js-broker-for-desktop\"></a>\n### 1. Adoption of Existing JS Broker for Desktop\n\nAs described above - we need to adopt existing functionality of **JS Broker for Stand Alone Browser** to Desktop environment. \n\n<a id=\"target-state\" name=\"target-state\"></a>\n#### Target State\n\nNode JS Broker, which supports Web Sockets Transport for connectivity, basic Discovery, fully compatible with both Generic and Generated Typescript/.Net clients.\n\n<a id=\"feature-parity-with-net-broker\" name=\"feature-parity-with-net-broker\"></a>\n### 2. Feature Parity with .Net Broker\n\nImplement all functionality, already available in .Net Broker implementation\n\n<a id=\"target-state-3\" name=\"target-state-3\"></a>\n#### Target State\n\nSupports all existing functionality and Transport Implementation, including:\n\n- Different Launch Modes\n- Named Pipes Transport for .Net\n- Full Discovery Support\n- etc\n\n<a id=\"support-for-json-and-protobufjs-based-serialization-for-js-clients\" name=\"support-for-json-and-protobufjs-based-serialization-for-js-clients\"></a>\n### 3. Support for JSON and ProtobufJS based Serialization for JS clients\n\nWe still need to support ProtobufJS based transport for **.Net** <-> **JS** communication and for support of existing clients. However we would like to add JSON based serialization for JS clients to significantly decrease Generated JS bundle size and unblock usage of Generic API (no code generation).\n\n<a id=\"target-state-1\" name=\"target-state-1\"></a>\n#### Target State\n\nPlexus Client can choose one of two serialization mechanisms during connection to Broker.\n\n<a id=\"full-implementation-of-common-interop-api\" name=\"full-implementation-of-common-interop-api\"></a>\n### 4. Full Implementation of Common Interop API\n\nSupport of all supported methods of [Common Interop API](https://github.com/finos-plexus/finos-plexus.github.io/blob/master/client-api/client-api.ts)\n\n<a id=\"target-state-2\" name=\"target-state-2\"></a>\n#### Target State\n\nApplications implemented with [Common Interop API](https://github.com/finos-plexus/finos-plexus.github.io/blob/master/client-api/client-api.ts) can use **Plexus Interop** as *InteropPlatform*."
  },
  {
    "path": "protocol/plexus.interop.proto",
    "content": "// Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nsyntax = \"proto3\";\n\nimport \"plexus.proto\";\n\npackage plexus.interop.protocol;\n\noption csharp_namespace = \"Plexus.Interop.Protocol.Protobuf.Internal\";\n\n// ---------------------- General -----------------------------------\n// For any invocation a dedicated transport channel is created (see Plexus.Interop.Transport.proto).\n// Termination of the underlying channel must be treated as termination of the invocation itself.\n// ------------------------------------------------------------------\n\n// ---------------------- Common messages ---------------------------\n\nmessage ConsumedServiceReference {\n\n\t// Protobuf service id\n\tstring service_id = 1;\n\n\t// Service alias used in case there are many imports of the same service in the calling app. Can be null.\n\tstring service_alias = 2;\n}\n\nmessage ConsumedMethodReference {\n\n\tConsumedServiceReference consumed_service = 1;\n\t\n\t// Protobuf method id\n\tstring method_id = 2;\n}\n\nmessage ProvidedServiceReference {\t\n\n\tstring service_id = 1;\n\n\tstring service_alias = 2;\n\n\tstring application_id = 3;\n\n\t.plexus.UniqueId connection_id = 4;\n\n\t.plexus.UniqueId application_instance_id = 5;\n}\n\nmessage ProvidedMethodReference {\n\n\tProvidedServiceReference provided_service = 1;\n\n\tstring method_id = 2;\n}\n\n// ---------------------- Connect Invocation ------------------------\n\n// client -> broker\nmessage ConnectRequest {\n\t// Host application id from app registry\n\tstring application_id = 1;\n\n\t// Unique id of host application instance which created this connection\n\t.plexus.UniqueId application_instance_id = 2;\n}\n\n// broker -> client\nmessage ConnectResponse {\n\t// This message is sent as response to ConnectRequest to confirm connect completed\n\t.plexus.UniqueId connection_id = 1;\n}\n\n\n// ---------------------- Request Envelopes ---------------------\n\n// Envelope wraps all the possible messages which can initiate new channel from client to broker\nmessage ClientToBrokerRequestEnvelope {\n\toneof payload {\n\t\tInvocationStartRequest invocation_start_request = 1;\n\t\tServiceDiscoveryRequest service_discovery_request = 2;\n\t\tMethodDiscoveryRequest method_discovery_request = 3;\n\t}\n}\n\n// Envelope wraps all the possible messages which can initiate new channel from broker to client\nmessage BrokerToClientRequestEnvelope {\n\toneof payload {\n\t\tInvocationStartRequested invocation_start_requested = 1;\n\t}\n}\n\n// ---------------------- Service Method Invocation -----------------\n\n// source -> broker;\n// Sent by the source client to start invocation with the specified parameters\nmessage InvocationStartRequest {\n\n\toneof target {\n\t    \n\t\t// Invocation to any implementation of method\n\t\tConsumedMethodReference consumed_method = 1;\n\n\t\t// Invocation to the specific implementation of method\n\t\tProvidedMethodReference provided_method = 2;\n\t}\n\n\tContextLinkageOptions context_linkage_options = 3;\n}\n\n// broker -> source\n// Sent back to the source client to let him know invocation is starting, e.g. broker is performing it\nmessage InvocationStarting {\n}\n\n// broker -> target;\n// Sent by the source client to start invocation with the specified parameters\nmessage InvocationStartRequested {\n\t\n\t// Target protobuf service id\n\tstring service_id = 1;\n\n\t// Target service alias id. Can be null if service has no alias.\n\tstring service_alias = 2;\n\t\t\n\t// Target protobuf method id\n\tstring method_id = 3;\n\n\t// Source application id\n\tstring consumer_application_id = 4;\n\n\t// Source connection id\n\t.plexus.UniqueId consumer_connection_id = 5;\n\n\t// Source application instance id\n\t.plexus.UniqueId consumer_application_instance_id = 6;\n}\n\n// target -> broker -> source\n// Sent back to the source client to let him know invocation is started (e.g. the target client launched and invocation routed to it)\nmessage InvocationStarted {\n}\n\n// target -> broker -> source | source -> broker -> target\n// Message header. Must be followed by transport message which represents message body.\nmessage InvocationMessageHeader {\n}\n\n// target -> broker -> source | source -> broker -> target\n// Sent as response to InvocationMessageHeader to confirm the message received by the target client.\nmessage InvocationMessageReceived {\n}\n\n// target -> broker -> source & source -> broker -> target\n// Must be sent by both clients before closing transport channel. Indicates that the clients won't send any more messages.\nmessage InvocationSendCompletion {\n}\n\n// Envelope wraps messages which can be sent during the established invocation\nmessage InvocationMessageEnvelope {\n\toneof payload {\n\t\tInvocationMessageHeader message = 1;\n\t\tInvocationMessageReceived confirmation = 2;\n\t\tInvocationSendCompletion send_completion = 3;\n\t}\n}\n\n// ---------------------- Discovery Invocation ---------------------\n\nenum DiscoveryMode {\n\tOffline = 0;\n\tOnline = 1;\n}\n\nenum MethodType {\n\tUnary = 0;\n\tServerStreaming = 1;\n\tClientStreaming = 2;\n\tDuplexStreaming = 3;\n}\n\nmessage ContextLinkageOptions {\t\n\toneof mode {\n\t\tstring specific_context_id = 1;\n\t\tEmpty current_context = 2;\n\t}\n}\n\nmessage Empty { }\n\n// client -> broker\n// Sent by client to initiate discovery of services\nmessage ServiceDiscoveryRequest {\n\n\tConsumedServiceReference consumed_service = 1;\n\n\tDiscoveryMode discovery_mode = 2;\n\n\tContextLinkageOptions context_linkage_options = 3;\n}\n\n// broker -> client\n// Sent by broker when discovery is completed\nmessage ServiceDiscoveryResponse {\n\n\t// Discovered service instances\n\trepeated DiscoveredService services = 1;\n}\n\nmessage DiscoveredService {\n\n\tConsumedServiceReference consumed_service = 1;\n\n\tProvidedServiceReference provided_service = 2;\n\n\tstring service_title = 3;\n\n\trepeated DiscoveredServiceMethod methods = 4;\n}\n\nmessage DiscoveredServiceMethod {\n\n\tstring method_id = 1;\n\t\t\n\tstring method_title = 2;\n\n\tstring input_message_id = 3;\n\n\tstring output_message_id = 4;\n\n\tMethodType method_type = 5;\n\n\trepeated Option options = 6;\n}\n\n// client -> broker\n// Sent by client to initiate discovery of services\nmessage MethodDiscoveryRequest {\n\n\tstring input_message_id = 1;\n\n\tstring output_message_id = 2;\t\n\n\tConsumedMethodReference consumed_method = 3;\n\n\tDiscoveryMode discovery_mode = 4;\n\n\tContextLinkageOptions context_linkage_options = 5;\n}\n\nmessage MethodDiscoveryResponse {\n\n\trepeated DiscoveredMethod methods = 1;\n}\n\nmessage DiscoveredMethod {\n\t\n\tProvidedMethodReference provided_method = 1;\n\n\tstring method_title = 2;\n\n\tstring input_message_id = 3;\n\n\tstring output_message_id = 4;\n\n\tMethodType method_type = 5;\n\n\trepeated Option options = 6;\n}\n\nmessage Option {\n\n\tstring id = 1;\n\n\tstring value = 2;\n}"
  },
  {
    "path": "protocol/plexus.interop.transport.proto",
    "content": "// Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nsyntax = \"proto3\";\n\nimport \"plexus.proto\";\n\npackage plexus.interop.transport.protocol;\n\noption csharp_namespace = \"Plexus.Interop.Transport.Protocol.Protobuf.Internal\";\n\nmessage MessageFrameHeader {\n\tplexus.UniqueId channel_id = 1;\t\n\tuint32 length = 2;\n\tbool has_more = 3;\n}\n\nmessage ConnectionOpenHeader {\n\t.plexus.UniqueId connection_id = 1;\n}\n\nmessage ConnectionCloseHeader {\n\t.plexus.Completion completion = 1;\n}\n\nmessage ChannelOpenHeader {\n\t.plexus.UniqueId channel_id = 1;\n}\n\nmessage ChannelCloseHeader {\n\t.plexus.UniqueId channel_id = 1;\n\t.plexus.Completion completion = 2;\n}\n\nmessage Header {\n\toneof content {\n\t\tMessageFrameHeader message_frame = 1;\n\t\tChannelOpenHeader channel_open = 2;\n\t\tChannelCloseHeader channel_close = 3;\n\t\tConnectionOpenHeader open = 4;\n\t\tConnectionCloseHeader close = 5;\n\t}\n}\n"
  },
  {
    "path": "protocol/plexus.proto",
    "content": "// Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nsyntax = \"proto3\";\n\npackage plexus;\n\noption csharp_namespace = \"Plexus.Interop.Protobuf\";\n\n// Stores UUID in little-endian format (i.e. in reversed RFC 4122 format).\n// To convert to bytes on little-endian systems (most common case): concat (toBytes(hi), toBytes(lo))\n// To convert to bytes on big-endian systems need to additionally reverse \"hi\" and \"lo\" parts: concat( reverse(toBytes(hi)), reverse(toBytes(lo)) )\nmessage UniqueId {\n    fixed64 lo = 1;\n    fixed64 hi = 2;\n}\n\nmessage Error {\n\tstring message = 1;\n\tstring details = 2;\n\tstring exception_name = 3;\n}\n\nmessage Completion {\n\tenum Status {\n\t\tCompleted = 0;\n\t\tCanceled = 1;\n\t\tFailed = 2;\n\t}\n\n\tStatus status = 1;\n\tError error = 2;\n}"
  },
  {
    "path": "samples/broadcast/registry/interop/samples/ip_telephony_app.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/samples/ip_telephony_broadcast_service.proto\";\n\npackage interop.samples;\n\napplication IPTelephonyApp {\n\n\tprovides IPTelephonyBroadcastService { IncomingCallReceived; CallCompleted; }\n}"
  },
  {
    "path": "samples/broadcast/registry/interop/samples/ip_telephony_broadcast_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop.samples;\n\nservice IPTelephonyBroadcastService {\n\toption (broadcast) = true;\n\n\trpc IncomingCallReceived (CallContext) returns (Empty);\n\trpc CallCompleted (CompletedCallDetails) returns (Empty);\n}\n\nmessage PhoneNumber {\n\tuint32 country_code = 1;\n\tuint32 country_area_code = 2;\n\tstring number = 3;\t\n}\n\nmessage ClientDetails {\n\tint32 id = 1;\n\tstring name = 2;\n\tstring email = 5;\n}\n\nmessage CallContext {\n\tPhoneNumber phone_number = 1;\n\tClientDetails client_details = 2;\n}\n\nmessage CompletedCallDetails {\n\tCallContext context = 1;\n\tuint32 call_length_in_seconds = 2;\n}\n\nmessage Empty {\n}"
  },
  {
    "path": "samples/broadcast/registry/interop/samples/sales_app.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/samples/ip_telephony_broadcast_service.proto\";\n\npackage interop.samples;\n\napplication SalesApp {\n\n\tconsumes IPTelephonyBroadcastService { IncomingCallReceived; CallCompleted; }\n}"
  },
  {
    "path": "samples/build.gradle",
    "content": "import org.apache.tools.ant.taskdefs.condition.Os\n\nplugins {\n    id \"com.github.hierynomus.license\" version\"0.14.0\"\n}\n\nlicense {\n    header file(\"${rootDir}/FILE_HEADER\")\n    mapping {\n        cs='JAVADOC_STYLE'\n        proto='DOUBLESLASH_STYLE'\n        interop='DOUBLESLASH_STYLE'\n    }\n    strictCheck true\n}\n\ntask licenseFormatProto(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {\n    source = fileTree(dir: '.')\n            .exclude(\"**/google/protobuf/*.proto\")\n            .include(\"**/*.proto\").include(\"**/*.interop\")\n}\n\ntasks[\"license\"].dependsOn licenseFormatProto\nlicenseFormat.dependsOn licenseFormatProto\n\ntask copySamplesMetadata(type: Copy) {\n  def outputDir = \"${rootDir}/bin/win-x86/samples/greeting/metadata\"\n  if (Os.isFamily(Os.FAMILY_MAC)) {\n      outputDir=\"${rootDir}/bin/osx-x64/samples/greeting/metadata\"\n  }\n  outputs.dir outputDir\n  inputs.dir 'samples/metadata'\n  from 'samples/metadata'\n  into outputDir\n}\n\ntask copyQuickStartMetadata(type: Copy) {\n  def outputDir = \"${rootDir}/bin/win-x86/samples/quick-start/metadata\"\n  if (Os.isFamily(Os.FAMILY_MAC)) {\n      outputDir=\"${rootDir}/bin/osx-x64/samples/quick-start/metadata\"\n  }\n  outputs.dir outputDir\n  inputs.dir 'quick-start/metadata'\n  from 'quick-start/metadata'\n  into outputDir\n}\n\ntask build\n\nbuild.dependsOn copySamplesMetadata \nbuild.dependsOn copyQuickStartMetadata\nbuild.dependsOn('license')"
  },
  {
    "path": "samples/greeting/GenBrokerMetadata.cmd",
    "content": "CD %~dp0\njava -jar %~dp0../../bin/win-x86/sdk/plexusgen.jar --type=json_meta --baseDir=registry --out=metadata"
  },
  {
    "path": "samples/greeting/metadata/apps.json",
    "content": "﻿{\n  \"apps\": [\n    {\n      \"id\": \"interop.samples.GreetingClient\",\n      \"displayName\": \"Sample Greeting Client\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../LaunchGreetingClient.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"interop.ElectronAppLauncher\",\n      \"displayName\": \"Electron App Launcher\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../ElectronAppLauncher.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"interop.samples.GreetingServer\",\n      \"displayName\": \"Sample Greeting Server implemented in .NET\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../LaunchGreetingServer.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"interop.samples.WebGreetingServer\",\n      \"displayName\": \"Sample Greeting Server implemented in JS\",\n      \"launcherId\": \"interop.ElectronAppLauncher\",\n      \"launcherParams\": {\n        \"path\": \"../WebGreetingServer/greetingServer.html\"\n       }\n    }\n  ]\n}"
  },
  {
    "path": "samples/greeting/metadata/interop.json",
    "content": "{\n\t\"messages\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLaunchRequest\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"app_id\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"launch_params_json\",\n\t\t\t\t\t\"num\": 2,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"launch_mode\",\n\t\t\t\t\t\"num\": 3,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.AppLaunchMode\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"suggested_app_instance_id\",\n\t\t\t\t\t\"num\": 4,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.UniqueId\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLaunchResponse\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"app_instance_id\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.UniqueId\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingRequest\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"name\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingResponse\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"greeting\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.UniqueId\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"lo\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"fixed64\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"hi\",\n\t\t\t\t\t\"num\": 2,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"fixed64\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n    ],\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"interop.ElectronAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingClient\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.samples.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greeting from .NET app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greetings from .NET app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.samples.GreetingClient\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Greeting service implemented by .NET app\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.WebGreetingServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greeting from Electron Web app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.samples.GreetingClient\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "samples/greeting/registry/interop/electron_app_launcher.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/app_launcher_service.proto\";\n\npackage interop;\n\napplication ElectronAppLauncher {\n\n\tprovides AppLauncherService to interop.AppLifecycleManager { Launch; }\n}"
  },
  {
    "path": "samples/greeting/registry/interop/samples/greeting_client.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/samples/greeting_service.proto\";\n\npackage interop.samples;\n\napplication GreetingClient {\n\n\tconsumes GreetingService from interop.samples.* {Unary; ServerStreaming; ClientStreaming; DuplexStreaming; }\n}"
  },
  {
    "path": "samples/greeting/registry/interop/samples/greeting_server.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/samples/greeting_service.proto\";\n\npackage interop.samples;\n\napplication GreetingServer {\n\n\tprovides GreetingService to interop.samples.GreetingClient {\n\n\t\toption title = \"Greeting service implemented by .NET app\";\n\n\t\tUnary [title=\"Greeting from .NET app\"];\n\t\tServerStreaming [title=\"Greetings from .NET app\"];\n\t\tClientStreaming;\n\t\tDuplexStreaming;\n\t}\n}"
  },
  {
    "path": "samples/greeting/registry/interop/samples/greeting_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage interop.samples;\n\nservice GreetingService {\n\trpc Unary (GreetingRequest) returns (GreetingResponse);\n\trpc ServerStreaming (GreetingRequest) returns (stream GreetingResponse);\n\trpc ClientStreaming (stream GreetingRequest) returns (GreetingResponse);\n\trpc DuplexStreaming (stream GreetingRequest) returns (stream GreetingResponse);\n}\n\nmessage GreetingRequest {\n\tstring name = 1;\n}\n\nmessage GreetingResponse {\n\tstring greeting = 1;\n}"
  },
  {
    "path": "samples/greeting/registry/interop/samples/web_greeting_server.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/samples/greeting_service.proto\";\n\npackage interop.samples;\n\napplication WebGreetingServer {\n\n\tprovides GreetingService to interop.samples.GreetingClient { \n\t\tUnary [title=\"Greeting from Electron Web app\"];\n\t}\n}"
  },
  {
    "path": "samples/quick-start/GenBrokerMetadata.cmd",
    "content": "CD %~dp0\njava -jar %~dp0../../bin/win-x86/sdk/plexusgen.jar --type=json_meta --baseDir=registry --out=metadata"
  },
  {
    "path": "samples/quick-start/metadata/apps.json",
    "content": "{\n  \"apps\": [\n    {\n      \"id\": \"interop.ElectronAppLauncher\",\n      \"displayName\": \"Electron App Launcher\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../../greeting/ElectronAppLauncher.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"vendor_b.fx.CcyPairRateViewer\",\n      \"displayName\": \"Currency Pair Rate Viewer\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../apps/CcyPairRateViewer/CcyPairRateViewer.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"vendor_a.fx.CcyPairRateProvider\",\n      \"displayName\": \"Currency Pair Rate Provider\",\n      \"launcherId\": \"interop.NativeAppLauncher\",\n      \"launcherParams\": {\n        \"cmd\": \"../apps/CcyPairRateProvider/CcyPairRateProvider.cmd\",\n        \"args\": \"\"\n      }\n    },\n    {\n      \"id\": \"vendor_a.fx.WebCcyPairRateProvider\",\n      \"displayName\": \"Web Currency Pair Rate Provider\",\n      \"launcherId\": \"interop.ElectronAppLauncher\",\n      \"launcherParams\": {\n        \"path\": \"../../../quick-start/apps/WebCcyPairRateProvider/index.html\"\n      }\n    },\n    {\n      \"id\": \"vendor_b.fx.WebCcyPairRateViewer\",\n      \"displayName\": \"Web Currency Pair Rate Viewer\",\n      \"launcherId\": \"interop.ElectronAppLauncher\",\n      \"launcherParams\": {\n        \"path\": \"../../../quick-start/apps/WebCcyPairRateViewer/index.html\"\n      }\n    }\n  ]\n}"
  },
  {
    "path": "samples/quick-start/metadata/interop.json",
    "content": "{\n\t\"messages\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLaunchRequest\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"app_id\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"launch_params_json\",\n\t\t\t\t\t\"num\": 2,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"launch_mode\",\n\t\t\t\t\t\"num\": 3,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.AppLaunchMode\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"suggested_app_instance_id\",\n\t\t\t\t\t\"num\": 4,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.UniqueId\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLaunchResponse\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"app_instance_id\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": false,\n\t\t\t\t\t\"type\": \"interop.UniqueId\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"fx.CcyPair\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ccyPairName\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"fx.CcyPairRate\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ccyPairName\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"rate\",\n\t\t\t\t\t\"num\": 2,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"double\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.UniqueId\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"lo\",\n\t\t\t\t\t\"num\": 1,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"fixed64\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"hi\",\n\t\t\t\t\t\"num\": 2,\n\t\t\t\t\t\"primitive\": true,\n\t\t\t\t\t\"type\": \"fixed64\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n    ],\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"fx.CcyPairRateService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"GetRate\",\n\t\t\t\t\t\"request\": \"fx.CcyPair\",\n\t\t\t\t\t\"response\": \"fx.CcyPairRate\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"interop.ElectronAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"vendor_a.fx.CcyPairRateProvider\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"fx.CcyPairRateService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetRate\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \".NET Provider - Get Rate\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"vendor_a.fx.WebCcyPairRateProvider\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"fx.CcyPairRateService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetRate\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Web Provider - Get Rate\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"vendor_b.fx.CcyPairRateViewer\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"fx.CcyPairRateService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetRate\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"vendor_a.fx.CcyPairRateProvider\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"vendor_b.fx.WebCcyPairRateViewer\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"fx.CcyPairRateService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"GetRate\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"vendor_a.fx.WebCcyPairRateProvider\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "samples/quick-start/registry/fx/ccy_pair_rate_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage fx;\n\nmessage CcyPair {\n    string ccy_pair_name = 1;\n}\n\nmessage CcyPairRate {\n    string ccy_pair_name = 1;\n    double rate = 2;\n}\n\nservice CcyPairRateService {\n    rpc GetRate(CcyPair) returns (CcyPairRate);\n}"
  },
  {
    "path": "samples/quick-start/registry/interop/electron_app_launcher.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/app_launcher_service.proto\";\n\npackage interop;\n\napplication ElectronAppLauncher {\n\n\tprovides AppLauncherService to interop.AppLifecycleManager { Launch; }\n}"
  },
  {
    "path": "samples/quick-start/registry/vendor_a/fx/ccy_pair_rate_provider.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage vendor_a.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication CcyPairRateProvider {\n\n    provides .fx.CcyPairRateService {\n        GetRate [title = \".NET Provider - Get Rate\"];\n    }\n\n}"
  },
  {
    "path": "samples/quick-start/registry/vendor_a/fx/web_ccy_pair_rate_provider.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage vendor_a.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication WebCcyPairRateProvider {\n\n    provides .fx.CcyPairRateService {\n        GetRate [title = \"Web Provider - Get Rate\"];\n    }\n\n}"
  },
  {
    "path": "samples/quick-start/registry/vendor_b/fx/ccy_pair_rate_viewer.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage vendor_b.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication CcyPairRateViewer {\n\n    consumes .fx.CcyPairRateService from vendor_a.fx.CcyPairRateProvider { GetRate; }\n\n}"
  },
  {
    "path": "samples/quick-start/registry/vendor_b/fx/web_ccy_pair_rate_viewer.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage vendor_b.fx;\n\nimport \"fx/ccy_pair_rate_service.proto\";\n\napplication WebCcyPairRateViewer {\n\n    consumes .fx.CcyPairRateService from vendor_a.fx.WebCcyPairRateProvider { GetRate; }\n\n}"
  },
  {
    "path": "settings.gradle",
    "content": "include ':docs'\n\ninclude ':dsl:model'\ninclude ':dsl:ide-common'\ninclude ':dsl:proto-lang'\ninclude ':dsl:proto-lang.ide'\ninclude ':dsl:interop-lang'\ninclude ':dsl:interop-lang.ide'\n//include ':dsl:interop-lang-vscode'\ninclude ':dsl:gen:common'\ninclude ':dsl:gen:test'\ninclude ':dsl:gen:meta'\ninclude ':dsl:gen:ts'\ninclude ':dsl:gen:js'\ninclude ':dsl:gen:proto'\ninclude ':dsl:gen:csharp'\ninclude ':dsl:gen:cli'\ninclude ':desktop'\ninclude ':web'\ninclude ':samples'"
  },
  {
    "path": "web/.ci-npmrc-tpl",
    "content": "# Placeholders to be replaced with env variables\nregistry=${NPM_REGISTRY}\n_auth=${NPM_AUTH_TOKEN}\n"
  },
  {
    "path": "web/.ci-publish-npmrc-tpl",
    "content": "# Placeholders to be replaced with env variables\n@plexus-interop:registry=https:${NPM_REGISTRY}\n${NPM_REGISTRY}:_authToken=${NPM_AUTH_TOKEN}\n${NPM_REGISTRY}:always-auth=true\n"
  },
  {
    "path": "web/.gitignore",
    "content": ".npmrc\njunit.xml"
  },
  {
    "path": "web/.yarnrc",
    "content": "workspaces-experimental true"
  },
  {
    "path": "web/README.md",
    "content": "\n# Plexus Interop Web Components [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)\n\n## General \n\nContains all JS modules and integration tests for Plexus Interop JS Client and Interop solution for stand alone browser.\n\n## Local Build\n\nCode base is splitted to multiple isolated modules, managed using [lerna](https://lernajs.io/) and [yarn](https://yarnpkg.com). So first you need to install all build dependencies including lerna with: \n\n```\nnpm i\n```\nThen you can run \n```\nnpm run build\n```\nWhich will install dependencies for all child modules, link them between each other with symlinks and trigger build in topological order.\n\n## CI Build configuration\n\nBuild scripts rely on following Environment variables for CI build and publishing of artifacts:\n\n- BuildRunner - CI build tasks triggered during default gradle build \n- NPM_REGISTRY - Custom NPM registry URL\n- NPM_AUTH_TOKEN - Auth Token\n- NPM_AUTH_USER - User Account\n- PackageVersion - Version used for publishing the artifacts\n\nIf you want to use specific values for publish and install operations - you can add ```_PUBLISH``` and ```_INSTALL``` postfixes to env property names correspondingly.\n\nRun build without publishing of artifacts:\n\n```\nnpm run ci-build\n```\n\nRun build and publish artifacts to configured registry:\n\n```\nnpm run ci-publish\n```"
  },
  {
    "path": "web/build.gradle",
    "content": "plugins {\n    id \"com.moowork.node\" version \"1.2.0\"\n    id \"com.github.hierynomus.license\" version\"0.14.0\"\n}\n\ndef ciBuild = System.env['BuildRunner'] != null\ndef ciPublishBuild = ciBuild && (System.env['APPVEYOR_REPO_TAG'] == \"true\" || System.env['NPM_PUBLISH'] == \"true\")\ndef isWindows = org.gradle.internal.os.OperatingSystem.current().isWindows()\ndef e2eTestsEnabled = isWindows && System.env['BuildRunner'] != \"MyGet\" && System.env['PLEXUS_BUILD_SKIP_WEB_TESTS'] != 'true'\ndef ciFullBuild = ciBuild && e2eTestsEnabled\ndef npmPackageVersion = System.getenv(\"PLEXUS_BUILD_NPM_PACKAGE_VERSION\") ?: (System.getenv(\"APPVEYOR_REPO_TAG_NAME\") ?: System.getenv(\"PackageVersion\"))\ndef npmRegistry = System.env['NPM_REGISTRY']\ndef npmEmail = System.env['NPM_AUTH_USER']\ndef npmAuth = System.env['NPM_AUTH_TOKEN']\ndef customNpmVersion = '6.10.3'\n\nnode {\n    version = '10.16.2'\n    npmVersion = customNpmVersion\n    nodeModulesDir = projectDir\n    download = true\n}\n\nlicense {\n    header file(\"${rootDir}/FILE_HEADER\")\n    mapping {\n        ts='JAVADOC_STYLE'\n        proto='DOUBLESLASH_STYLE'\n        interop='DOUBLESLASH_STYLE'\n    }\n    strictCheck true\n}\n\ntask licenseFormatTS(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {\n    source = fileTree(dir: \".\").exclude(\"**/node_modules/*\").exclude(\"**/dist/*\")\n            .include(\"**/*.ts\").include(\"**/*.js\").include(\"**/*.proto\").include(\"**/*.interop\")\n}\n\ntask genNpmrc()  {\n    doLast {\n        def content = \"\"\"\n# Auto generated by Gradle build\n${npmRegistry != null ? \"registry=\" + npmRegistry : \"\"}\n${npmEmail != null ? \"email=\" + npmEmail : \"\"}\n${npmAuth != null ? \"_auth=\" + npmAuth : \"\"}\n        \"\"\"\n        def npmConfigFolder = \"$projectDir/.gradle/npm/npm-v$customNpmVersion/etc\"\n        file(npmConfigFolder).mkdirs()\n        // global config\n        file(\"$npmConfigFolder/npmrc\").text = content\n        // user config\n        file(\"$projectDir/.npmrc\").text = content\n    }\n}\n\ntasks[\"license\"].dependsOn licenseFormatTS\nlicenseFormat.dependsOn licenseFormatTS\n\ntasks.npmSetup.dependsOn genNpmrc\n\ntask npmVersion(type: NpmTask) {\n    args = ['--version']\n}\n\ntask npmRunInstall(type: NpmTask, dependsOn: npmVersion) {\n    args = ['install', '--no-package-lock']\n}\n\ntask preNpmBuild {\n    doLast {\n        println \"NPM Package version: $npmPackageVersion\"\n\t    println \"CI Publish: $ciPublishBuild\"\n\t    println \"CI Full: $ciFullBuild\"\n\t    println \"CI Build: $ciBuild\"\n\t    println \"Integration tests: $e2eTestsEnabled\"\n        File packagesDir = file('packages');\n        FileCollection collection = files { packagesDir.listFiles() }\n        println \"\\nModules to build:\"\n        collection.collect { relativePath(it) }.sort().each { println it }\n    }\n}\n\ntask npmBuild(type: NpmTask, dependsOn: ['npmRunInstall', 'preNpmBuild', ':dsl:gen:cli:build']) {\n    // https://github.com/srs/gradle-node-plugin/issues/128 \n    environment = [\n        'PLEXUS_BUILD_NPM_PACKAGE_VERSION': npmPackageVersion,\n        'PLEXUS_CLI_SKIP_JRE_DOWNLOAD': 'true',\n        'PLEXUS_CLI_SKIP_PROTOC_DOWNLOAD': 'true'\n    ]\n    args =  ciPublishBuild ? ['run', 'ci-publish'] :\n            ciFullBuild ? ['run', 'ci-build-e2e'] : \n            ciBuild ? ['run', 'ci-build'] :\n            e2eTestsEnabled ? ['run', 'build-e2e'] : ['run', 'build']\n}\n\ntask npmBuildOnly(type: NpmTask, dependsOn: ['npmRunInstall', 'preNpmBuild']) {\n    args =  ['run', 'build']\n}\n\ntask buildTransport(dependsOn: npmBuild) {\n    outputs.dir('.')\n}\n\ntask build(dependsOn: buildTransport) {\n}\n\nbuild.dependsOn('license')\n"
  },
  {
    "path": "web/configs/tslint.json",
    "content": "{\n    \"rules\": {\n        \"adjacent-overload-signatures\": true,\n        \"member-access\": true,\n        \"no-any\": false,\n        \"no-inferrable-types\": false,\n        \"no-internal-module\": true,\n        \"no-reference\": true,\n        \"no-var-requires\": false,\n        \"only-arrow-functions\": [\n            true,\n            \"allow-declarations\"\n        ],\n        \"no-namespace\": true,\n        \"member-ordering\": [\n            true,\n            {\n                \"order\": [\n                    \"private-static-field\",\n                    \"protected-static-field\",\n                    \"public-static-field\",\n                    \"private-instance-field\",\n                    \"protected-instance-field\",\n                    \"public-instance-field\",\n                    \"constructor\",\n                    \"public-static-method\",\n                    \"protected-static-method\",\n                    \"private-static-method\",\n                    \"public-instance-method\",\n                    \"protected-instance-method\",\n                    \"private-instance-method\"\n                ]\n            }\n        ],\n        \"typedef\": [\n            true,\n            \"call-signature\",\n            \"parameter\",\n            \"member-variable-declaration\"\n        ],\n        \"typedef-whitespace\": [\n            true,\n            {\n                \"call-signature\": \"nospace\",\n                \"index-signature\": \"nospace\",\n                \"parameter\": \"nospace\",\n                \"property-declaration\": \"nospace\",\n                \"variable-declaration\": \"nospace\"\n            }\n        ],\n        \"ban\": false,\n        \"curly\": true,\n        \"forin\": false,\n        \"label-position\": true,\n        \"no-arg\": true,\n        \"no-conditional-assignment\": true,\n        \"no-bitwise\": false,\n        \"no-console\": [],\n        \"no-construct\": true,\n        \"no-duplicate-variable\": true,\n        \"no-empty\": false,\n        \"no-eval\": true,\n        \"no-invalid-this\": true,\n        \"no-null-keyword\": false,\n        \"no-shadowed-variable\": false,\n        \"no-string-literal\": true,\n        \"no-switch-case-fall-through\": true,\n        \"no-unsafe-finally\": true,\n        \"no-unused-expression\": true,\n        \"no-var-keyword\": true,\n        \"radix\": true,\n        \"restrict-plus-operands\": false,\n        \"switch-default\": true,\n        \"triple-equals\": [\n            true,\n            \"allow-null-check\"\n        ],\n        \"use-isnan\": true,\n        \"eofline\": false,\n        \"indent\": [\n            true,\n            \"spaces\"\n        ],\n        \"max-line-length\": [\n            false\n        ],\n        \"max-file-line-count\": [\n            false\n        ],\n        \"no-default-export\": true,\n        \"no-mergeable-namespace\": true,\n        \"no-require-imports\": false,\n        \"object-literal-sort-keys\": false,\n        \"trailing-comma\": [\n            true,\n            {\n                \"multiline\": \"never\",\n                \"singleline\": \"never\"\n            }\n        ],\n        \"align\": [\n            true,\n            \"parameters\",\n            \"statements\"\n        ],\n        \"arrow-parens\": false,\n        \"class-name\": true,\n        \"comment-format\": [\n            true,\n            \"check-space\"\n        ],\n        \"file-header\": [\n            false\n        ],\n        \"interface-name\": [\n            false\n        ],\n        \"jsdoc-format\": true,\n        \"new-parens\": true,\n        \"no-angle-bracket-type-assertion\": true,\n        \"no-consecutive-blank-lines\": [\n            true,\n            2\n        ],\n        \"no-constructor-vars\": false,\n        \"object-literal-key-quotes\": [\n            true,\n            \"as-needed\"\n        ],\n        \"object-literal-shorthand\": true,\n        \"one-variable-per-declaration\": [\n            true,\n            \"ignore-for-loop\"\n        ],\n        \"ordered-imports\": [\n            false,\n            {\n                \"import-sources-order\": \"lowercase-last\",\n                \"named-imports-order\": \"lowercase-first\"\n            }\n        ],\n        \"one-line\": [\n            true,\n            \"check-open-brace\",\n            \"check-whitespace\"\n        ],\n        \"quotemark\": [\n            true,\n            \"single\"\n        ],\n        \"semicolon\": [\n            true,\n            \"always\"\n        ],\n        \"variable-name\": [\n            true,\n            \"ban-keywords\",\n            \"check-format\",\n            \"allow-leading-underscore\"\n        ],\n        \"whitespace\": [\n            true,\n            \"check-branch\",\n            \"check-decl\",\n            \"check-operator\",\n            \"check-separator\",\n            \"check-type\",\n            \"check-module\",\n            \"check-typecast\"\n        ]\n    },\n    \"linterOptions\": {\n        \"exclude\": [\n            \"../packages/**/*Generated*.ts\",\n            \"../packages/**/gen/*.ts\"\n        ]\n    }\n}"
  },
  {
    "path": "web/lerna.json",
    "content": "{\n  \"packages\": [\n    \"packages/*\"\n  ],\n  \"npmClient\": \"npm\",\n  \"version\": \"0.1.0\",\n  \"command\": {\n    \"init\": {\n      \"exact\": true\n    },\n    \"bootstrap\": {\n      \"hoist\": false\n    }\n  }\n}\n"
  },
  {
    "path": "web/package.json",
    "content": "{\n\t\"private\": true,\n\t\"name\": \"@plexus-interop/web\",\n\t\"version\": \"0.1.0\",\n\t\"license\": \"Apache-2.0\",\n\t\"description\": \"Plexus Web Interop root module\",\n\t\"scripts\": {\n\t\t\"prebootstrap\": \"node ./scripts/replace-lock-registry.js && lerna exec -- node ../../scripts/replace-lock-registry.js && node ./scripts/replace-auth-vars.js --install && lerna exec -- cross-var shx cp $LERNA_ROOT_PATH/.npmrc .npmrc\",\n\t\t\"bootstrap\": \"lerna bootstrap -- --check-files --ignore-optional\",\n\t\t\"postbootstrap\": \"node ./scripts/replace-lock-registry.js --backward && lerna exec -- node ../../scripts/replace-lock-registry.js --backward && shx rm -rf .npmrc\",\n\t\t\"preinstall\": \"node ./scripts/replace-lock-registry.js && node ./scripts/replace-auth-vars.js --install\",\n\t\t\"prebuild\": \"run-s bootstrap\",\n\t\t\"build\": \"run-s build-only\",\n\t\t\"build-only\": \"lerna run build --stream --concurrency 1\",\n\t\t\"prepublish-all\": \"node ./scripts/replace-auth-vars.js --publish && lerna exec -- cross-var shx cp $LERNA_ROOT_PATH/.npmrc .npmrc\",\n\t\t\"publish-all\": \"lerna exec --stream --scope {@plexus-interop/broker,@plexus-interop/cli,@plexus-interop/client,@plexus-interop/client-api,@plexus-interop/common,@plexus-interop/protocol,@plexus-interop/transport-common,@plexus-interop/websocket-transport,@plexus-interop/io,@plexus-interop/metadata,@plexus-interop/remote,@plexus-interop/common-api-impl,@plexus-interop/studio} --concurrency 1 -- npm publish --verbose --access=public\",\n\t\t\"postpublish-all\": \"shx rm -rf .npmrc && lerna exec -- shx rm -rf .npmrc\",\n\t\t\"e2e-native\": \"cd ./packages/e2e && yarn e2e-native\",\n\t\t\"poste2e-native\": \"yarn coverage\",\n\t\t\"e2e-web\": \"cd ./packages/e2e && yarn e2e-web-electron\",\n\t\t\"poste2e-web\": \"yarn coverage\",\n\t\t\"coverage\": \"nyc report --reporter=text --reporter=html\",\n\t\t\"build-e2e\": \"run-s build e2e-native e2e-web\",\n\t\t\"ci-build\": \"run-s build\",\n\t\t\"ci-build-e2e\": \"run-s build e2e-native e2e-web\",\n\t\t\"ci-publish\": \"run-s bump-version build publish-all\",\n\t\t\"bump-version\": \"cross-var lerna publish --repo-version $PLEXUS_BUILD_NPM_PACKAGE_VERSION --no-git-tag-version --no-push --exact --skip-npm --yes --loglevel=silly --force-publish=*\",\n\t\t\"benchmarks\": \"cd ./packages/e2e && yarn native-broker-benchmarks && yarn web-broker-benchmarks\"\n\t},\n\t\"workspaces\": [\n\t\t\"packages/*\"\n\t],\n\t\"devDependencies\": {\n\t\t\"cross-var\": \"1.1.0\",\n\t\t\"lerna\": \"^3.18.4\",\n\t\t\"minimist\": \"^1.2.0\",\n\t\t\"electron\": \"1.8.8\",\n\t\t\"nyc\": \"^11.2.1\",\n\t\t\"npm-run-all\": \"4.1.1\",\n\t\t\"shx\": \"0.2.2\",\n\t\t\"yarn\": \"^1.17.3\"\n\t}\n}\n"
  },
  {
    "path": "web/packages/broker/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/broker/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/broker\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Plexus Interop Broker\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main && yarn build:host\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"build:host\": \"browserify dist/main/src/api/CrossDomainHostEntryPoint.js -s proxyHost -o dist/main/src/CrossDomainHostBuilder.bundle.js\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"jest --coverage\"\n  },\n  \"dependencies\": {\n    \"protobufjs\": \"6.11.3\",\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/metadata\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/client-api\": \"0.1.0\",\n    \"ya-js-storage\": \"0.1.4\",\n    \"long\": \"^4.0.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/jstorage\": \"^0.3.30\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/node\": \"^7.0.5\",\n    \"@types/superagent\": \"^3.5.6\",\n    \"babel-register\": \"^6.23.0\",\n    \"browserify\": \"^14.5.0\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"peerDependencies\": {\n    \"protobufjs\": \"6.11.3\",\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}"
  },
  {
    "path": "web/packages/broker/preprocessor.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst tsc = require('typescript');\nconst tsConfig = require('./tsconfig.json');\n\nmodule.exports = {\n    process(src, path) {\n        if (path.endsWith('.ts') || path.endsWith('.tsx')) {\n            return tsc.transpile(\n                src,\n                tsConfig.compilerOptions,\n                path,\n                []\n            );\n        }\n        return src;\n    },\n};\n"
  },
  {
    "path": "web/packages/broker/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/broker/src/AsyncHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface AsyncHandler<Req, Res> {\n    handle(input: Req): Promise<Res>;\n}"
  },
  {
    "path": "web/packages/broker/src/api/AppLifeCycleConfig.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface AppLifeCycleConfig {\n    heartBitPeriod: number;\n    heartBitTtl: number;\n}"
  },
  {
    "path": "web/packages/broker/src/api/CrossDomainEventBusProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../bus/EventBus';\nimport { Logger, LoggerFactory, DomUtils } from '@plexus-interop/common';\nimport { CrossDomainEventBus } from '../bus/cross/CrossDomainEventBus';\n\nexport class CrossDomainEventBusProvider {\n\n    private readonly log: Logger = LoggerFactory.getLogger('CrossDomainEventBusProvider');\n\n    public constructor(private readonly proxyUrlProvider: () => Promise<string>, private readonly id: string = 'plexus-proxy-iframe') { }\n\n    public async connect(): Promise<EventBus> {\n\n        this.log.info('Resolving Proxy Iframe URL');\n        const proxyIframeUrl = await this.proxyUrlProvider();\n\n        this.log.info(`Initialyzing proxy iFrame with url [${proxyIframeUrl}]`);\n        const proxyiFrame = await DomUtils.getOrCreateHiddenIFrame(this.id, proxyIframeUrl);\n\n        this.log.info('Initialyzing Event Bus');\n        const crossDomainBus: CrossDomainEventBus = new CrossDomainEventBus(proxyiFrame, DomUtils.getOrigin(proxyIframeUrl));\n        await crossDomainBus.init();\n        return crossDomainBus;\n\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/api/CrossDomainHostBuilder.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../bus/EventBus';\nimport { CrossDomainHost } from '../bus/cross/host/CrossDomainHost';\nimport { CrossDomainHostConfig } from '../bus/cross/host/CrossDomainHostConfig';\nimport { BroadCastChannelEventBus } from '../bus/same/BroadCastChannelEventBus';\nimport { FallbackEventBus } from '../bus/FallbackEventBus';\nimport { JStorageEventBus } from '../bus/same/JStorageEventBus';\n\nexport class CrossDomainHostBuilder {\n\n    private crossDomainConfig: CrossDomainHostConfig;\n\n    public withEventBusProvider(eventBusProvider: () => Promise<EventBus>): CrossDomainHostBuilder {\n        this.eventBusProvider = eventBusProvider;\n        return this;\n    }\n\n    public withCrossDomainConfig(crossDomainConfig: CrossDomainHostConfig): CrossDomainHostBuilder {\n        this.crossDomainConfig = crossDomainConfig;\n        return this;\n    }\n\n    public async build(): Promise<CrossDomainHost> {\n        const eventBus = await this.eventBusProvider();\n        const crossDomainHost = new CrossDomainHost(eventBus, this.crossDomainConfig);\n        await crossDomainHost.connect();\n        return crossDomainHost;\n    }\n\n    private eventBusProvider: () => Promise<EventBus> = async () => new FallbackEventBus([new BroadCastChannelEventBus(), new JStorageEventBus()]).init();\n\n}"
  },
  {
    "path": "web/packages/broker/src/api/CrossDomainHostEntryPoint.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport 'core-js/es6/promise';\nimport 'core-js/fn/array/find';\nimport 'core-js/es6/symbol';\nimport 'core-js/es6/object';\nimport 'core-js/es6/function';\nimport 'core-js/es6/parse-int';\nimport 'core-js/es6/parse-float';\nimport 'core-js/es6/number';\nimport 'core-js/es6/math';\nimport 'core-js/es6/string';\nimport 'core-js/es6/date';\nimport 'core-js/es6/array';\nimport 'core-js/es6/regexp';\nimport 'core-js/es6/map';\nimport 'core-js/es6/set';\nimport 'core-js/es6/reflect';\n\nexport * from './CrossDomainHostBuilder';\n"
  },
  {
    "path": "web/packages/broker/src/api/WebBrokerConnectionBuilder.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection, InMemoryConnectionFactory } from '@plexus-interop/transport-common';\nimport { AppRegistryProvider } from '@plexus-interop/metadata';\nimport { InteropRegistryProvider } from '@plexus-interop/metadata';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { AppRegistryService } from '@plexus-interop/metadata';\nimport { EventBus } from '../bus/EventBus';\nimport { RemoteBrokerService } from '../peers/remote/RemoteBrokerService';\nimport { EventBusRemoteBrokerService } from '../peers/remote/EventBusRemoteBrokerService';\nimport { PeerConnectionsService } from '../peers/PeerConnectionsService';\nimport { PeerServerConnectionFactory } from '../peers/PeerServerConnectionFactory';\nimport { MultiSourcesServerConnectionFactory } from '../transport/MultiSourcesServerConnectionFactory';\nimport { Broker } from '../broker/Broker';\nimport { PeerAppLifeCycleManager } from '../peers/PeerAppLifeCycleManager';\nimport { HostConnectionFactory } from '../peers/host/HostConnectionFactory';\nimport { AppLifeCycleConfig } from './AppLifeCycleConfig';\nimport { AppLauncher } from '../launcher/AppLauncher';\nimport { AppLauncherRegistry } from '../launcher/AppLauncherRegistry';\n\nexport class WebBrokerConnectionBuilder {\n\n    private readonly log: Logger = LoggerFactory.getLogger('WebBrokerConnectionBuilder');\n\n    private appRegistryProviderFactory: () => Promise<AppRegistryProvider>;\n\n    private interopRegistryProviderFactory: () => Promise<InteropRegistryProvider>;\n\n    private eventBusProvider: () => Promise<EventBus>;\n\n    private appLifeCycleConfig: AppLifeCycleConfig = { heartBitTtl: 5000, heartBitPeriod: 1500 };\n\n    private readonly launcherRegistry: AppLauncherRegistry = new AppLauncherRegistry();\n\n    public withAppLifeCycleConfig(config: AppLifeCycleConfig): WebBrokerConnectionBuilder {\n        this.appLifeCycleConfig = config;\n        return this;\n    }\n\n    public withAppLauncher(launcherId: string, launcher: AppLauncher): WebBrokerConnectionBuilder {\n        this.launcherRegistry.registerAppLauncher(launcherId, launcher);\n        return this;\n    }\n\n    public withEventBusProvider(provider: () => Promise<EventBus>): WebBrokerConnectionBuilder {\n        this.eventBusProvider = provider;\n        return this;\n    }\n\n    public withInteropRegistryProviderFactory(factory: () => Promise<InteropRegistryProvider>): WebBrokerConnectionBuilder {\n        this.interopRegistryProviderFactory = factory;\n        return this;\n    }\n\n    public withAppRegistryProviderFactory(factory: () => Promise<AppRegistryProvider>): WebBrokerConnectionBuilder {\n        this.appRegistryProviderFactory = factory;\n        return this;\n    }\n\n    public async connect(): Promise<TransportConnection> {\n\n        this.validate();\n\n        this.log.info('Initialyzing App Registry Provider');\n        const appRegistryProvider = await this.appRegistryProviderFactory();\n\n        this.log.info('Initialyzing Interop Registry Provider');\n        const interopRegistryProvider = await this.interopRegistryProviderFactory();\n        const appRegistryService = new AppRegistryService(appRegistryProvider);\n\n        const hostClientConnectionFactory = new InMemoryConnectionFactory();\n        this.log.debug('Creating in memory host connection');\n        const [hostClientConnection, hostServerConnection] = await hostClientConnectionFactory.connectBoth();\n        const hostServerConnectionId = hostServerConnection.uuid().toString();\n        const hostClientConnectionId = hostClientConnection.uuid().toString();\n\n        this.log.info('Initialyzing Event Bus');\n        const eventBus = await this.eventBusProvider();\n\n        const remoteBrokerService: RemoteBrokerService = new EventBusRemoteBrokerService(eventBus, hostServerConnectionId);\n\n        const peerConnectionService: PeerConnectionsService = new PeerConnectionsService(remoteBrokerService);\n        const peerConnectionsFactory = new PeerServerConnectionFactory(hostClientConnectionId, peerConnectionService, remoteBrokerService);\n        const brokerConnectionsFactory = new MultiSourcesServerConnectionFactory(\n            new HostConnectionFactory(hostClientConnectionFactory, remoteBrokerService),\n            peerConnectionsFactory);\n\n        const appLifeCycleManager = new PeerAppLifeCycleManager(\n            peerConnectionService,\n            appRegistryService,\n            this.launcherRegistry,\n            this.appLifeCycleConfig.heartBitPeriod,\n            this.appLifeCycleConfig.heartBitTtl);\n\n        this.log.info('Starting Broker');\n        new Broker(appLifeCycleManager, brokerConnectionsFactory, interopRegistryProvider, appRegistryService).start();\n\n        return hostClientConnection;\n\n    }\n\n    private validate(): void {\n        if (!this.appRegistryProviderFactory) {\n            throw new Error('App Registry Provider is required');\n        }\n        if (!this.interopRegistryProviderFactory) {\n            throw new Error('Interop Registry Provider is required');\n        }\n        if (!this.eventBusProvider) {\n            throw new Error('Event Bus Provider is required');\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/api/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './WebBrokerConnectionBuilder';\nexport * from './CrossDomainHostBuilder';\nexport * from './CrossDomainEventBusProvider';\nexport * from './AppLifeCycleConfig';\nexport * from '../bus';"
  },
  {
    "path": "web/packages/broker/src/broker/AuthenticationHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AsyncHandler } from '../AsyncHandler';\nimport { TransportChannel, TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { ClientProtocolHelper, clientProtocol as plexus, ErrorCompletion, ClientError } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { ApplicationDescriptor } from '../lifecycle/ApplicationDescriptor';\nimport { AppRegistryService } from '@plexus-interop/metadata';\n\n/**\n * Responsible for handling of first channel with Authentication Details\n */\nexport class AuthenticationHandler implements AsyncHandler<[TransportConnection, TransportChannel], ApplicationDescriptor> {\n\n    constructor(private readonly appService: AppRegistryService) { }\n\n    public handle(connectionDetails: [TransportConnection, TransportChannel]): Promise<ApplicationDescriptor> {\n\n        const [connection, channel] = connectionDetails;\n        const channelId = channel.uuid().toString();\n\n        const log: Logger = LoggerFactory.getLogger(`AuthenticationHandler [${channelId}]`);\n\n        return new Promise((resolve, reject) => {\n\n            channel.open({\n\n                started: () => { },\n\n                startFailed: (e) => reject(e),\n\n                next: async message => {\n\n                    if (log.isDebugEnabled()) {\n                        log.debug(`Connect message received`);\n                    }\n\n                    const clientToBrokerMessage = ClientProtocolHelper.decodeConnectRequest(message);\n\n                    const appId = clientToBrokerMessage.applicationId as string;\n\n                    if (log.isDebugEnabled()) {\n                        log.debug(`Connect request from [${appId}] application received`);\n                    }\n\n                    if (!this.appService.isAppExist(appId)) {\n                        const errorMsg = `App [${appId}] doesn't exist`;\n                        log.warn(errorMsg);\n                        channel.close(new ErrorCompletion(new ClientError(errorMsg)));\n                        reject(new Error(errorMsg));\n                    } else {\n                        channel.sendLastMessage(ClientProtocolHelper.connectResponsePayload({ connectionId: connection.uuid() }))\n                            .catch(e => log.error('Failed to sent connection details', e));\n                        const instanceId = UniqueId.fromProperties(clientToBrokerMessage.applicationInstanceId as plexus.IUniqueId);\n                        log.debug(`Received connection request with instance ID ${instanceId.toString()}`);\n                        resolve({\n                            applicationId: clientToBrokerMessage.applicationId as string,\n                            instanceId: UniqueId.fromProperties(clientToBrokerMessage.applicationInstanceId as plexus.IUniqueId).toString()\n                        });\n                    }\n                    \n                },\n\n                error: e => {\n                    log.error('Error from source channel received', e);\n                    reject(e);\n                },\n\n                complete: () => {\n                    log.debug(`Channel closed`);\n                }\n\n            });\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/broker/Broker.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLifeCycleManager } from '../lifecycle/AppLifeCycleManager';\nimport { ServerConnectionFactory } from '@plexus-interop/transport-common';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { ClientConnectionProcessor } from './ClientConnectionProcessor';\nimport { AuthenticationHandler } from './AuthenticationHandler';\nimport { InvocationRequestHandler } from './InvocationRequestHandler';\nimport { InteropRegistryProvider } from '@plexus-interop/metadata';\nimport { InteropRegistryService } from '@plexus-interop/metadata';\nimport { ClientRequestProcessor } from './ClientRequestProcessor';\nimport { AppRegistryService } from '@plexus-interop/metadata';\nimport { DiscoveryRequestHandler } from './DiscoveryRequestHandler';\n\nexport class Broker {\n\n    private readonly log: Logger = LoggerFactory.getLogger('Broker');\n\n    private readonly connectionProcessor: ClientConnectionProcessor;\n\n    constructor(\n        private readonly appLifeCycleManager: AppLifeCycleManager,\n        private readonly connectionFactory: ServerConnectionFactory,\n        private readonly registryProvider: InteropRegistryProvider,\n        private readonly appService: AppRegistryService\n    ) {\n        const authHandler = new AuthenticationHandler(this.appService);\n        const registryService = new InteropRegistryService(this.registryProvider);\n        const invocationRequestHandler = new InvocationRequestHandler(registryService, this.appLifeCycleManager);\n        const discoveryRequestHandler = new DiscoveryRequestHandler(appLifeCycleManager, appService, registryService);\n        const clientRequestProcessor = new ClientRequestProcessor(invocationRequestHandler, discoveryRequestHandler);\n        this.connectionProcessor = new ClientConnectionProcessor(authHandler, clientRequestProcessor, this.appLifeCycleManager);\n        this.log.trace('Created');\n    }\n\n    public start(): void {\n        this.log.debug('Starting to listen for incoming connections');\n        this.connectionFactory.acceptConnections({\n            next: connection => {\n                const connectionGuid = connection.uuid().toString();\n                if (this.log.isDebugEnabled()) {\n                    this.log.debug(`Accepted new connection [${connectionGuid}]`);\n                }\n                this.connectionProcessor.handle(connection)\n                    .then(() => this.log.info(`Finished processing of [${connectionGuid}] connection`))\n                    .catch(e => this.log.error(`Error while processing of [${connectionGuid}] connection`, e));\n            },\n            error: e => this.log.error('Error on receiving new connection', e),\n            complete: () => this.log.info('No more connections')\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/broker/ClientConnectionProcessor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AsyncHandler } from '../AsyncHandler';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { Completion, ErrorCompletion, ClientError } from '@plexus-interop/protocol';\nimport { AppLifeCycleManager } from '../lifecycle/AppLifeCycleManager';\nimport { ClientRequestProcessor } from './ClientRequestProcessor';\nimport { ApplicationConnection } from '../lifecycle/ApplicationConnection';\nimport { AuthenticationHandler } from './AuthenticationHandler';\nimport { TasksTracker } from './TasksTracker';\n\nexport class ClientConnectionProcessor implements AsyncHandler<TransportConnection, Completion> {\n\n    constructor(\n        private readonly authenticationProcessor: AuthenticationHandler,\n        private readonly clientRequestProcessor: ClientRequestProcessor,\n        private readonly appLifeCycleManager: AppLifeCycleManager) { }\n\n    public async handle(connection: TransportConnection): Promise<Completion> {\n\n        const connectionGuid = connection.uuid().toString();\n        const log: Logger = LoggerFactory.getLogger(`ConnectionProcessor [${connectionGuid}]`);\n        log.debug(`Received connection`);\n\n        const requestsTracker = new TasksTracker();\n\n        return new Promise((resolve, reject) => {\n            let sourceConnection: undefined | ApplicationConnection;\n            connection.subscribeToChannels({\n                next: async channel => {\n                    const channelStrId = channel.uuid().toString();\n                    log.debug(`Received new channel [${channelStrId}]`);\n                    if (!sourceConnection) {\n                        try {\n                            log.debug('First channel, trying to setup connection');\n                            const appDescriptor = await this.authenticationProcessor.handle([connection, channel]);\n                            const appConnection = await this.appLifeCycleManager.acceptConnection(connection, {\n                                applicationId: appDescriptor.applicationId as string,\n                                instanceId: appDescriptor.instanceId\n                            }, c => {\n                                log.error('Connection dropped');\n                            });\n                            sourceConnection = appConnection;\n                            log.trace('Connected to client');\n                        } catch (error) {\n                            log.error('Unable to authenticate client connection', error);\n                            connection.disconnect(new ErrorCompletion(new ClientError(error)));\n                            reject(error);\n                        }\n                    } else {\n                        log.trace(`Processing client request channel [${channelStrId}]`);\n                        try {\n                            const channelCompletion = await requestsTracker.start(\n                                channelStrId,\n                                () => this.clientRequestProcessor.handle(channel, sourceConnection as ApplicationConnection));\n                            if (log.isTraceEnabled()) {\n                                log.trace(`Received channel completion [${JSON.stringify(channelCompletion)}]`);\n                            }\n                        } catch (error) {\n                            log.trace(`Failed on processing of [${channelStrId}] client request`);\n                        }\n                    }\n                },\n                complete: async () => {\n                    log.debug(`Source connection completed`);\n                    this.completeAndDisconnect(connection, requestsTracker, log)\n                        .then(result => resolve(result))\n                        .catch(e => {\n                            log.error(`Failed to complete pending requests`, e);\n                            reject(new ErrorCompletion(e));\n                        });\n                },\n                error: e => {\n                    log.error(`Error received from source connection`, e);\n                    this.completeAndDisconnect(connection, requestsTracker, log)\n                        .catch(completeErr => log.error('Failed to complete pending requests', e))\n                        .then(() => log.debug('Pending requests completed'));\n                    reject(new ErrorCompletion(e));\n                }\n            });\n        });\n    }\n\n    private async completeAndDisconnect(connection: TransportConnection, requestsTracker: TasksTracker, log: Logger): Promise<Completion> {\n        const result = await requestsTracker.completePending();\n        log.info(`Completed pending actions`);\n        await connection.disconnect(result);\n        log.info(`Diconnected`);\n        return result;\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/broker/ClientRequestProcessor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportChannel, BufferedObserver } from '@plexus-interop/transport-common';\nimport { Completion, ClientProtocolHelper } from '@plexus-interop/protocol';\nimport { LoggerFactory, Logger } from '@plexus-interop/common';\nimport { InvocationRequestHandler } from './InvocationRequestHandler';\nimport { ApplicationConnection } from '../lifecycle/ApplicationConnection';\nimport { DiscoveryRequestHandler } from './DiscoveryRequestHandler';\n\nexport class ClientRequestProcessor {\n\n    private readonly log: Logger = LoggerFactory.getLogger('ClientRequestProcessor');\n\n    constructor(\n        private readonly invocationRequestProcessor: InvocationRequestHandler,\n        private readonly discoveryRequestHandler: DiscoveryRequestHandler) { }\n\n    public async handle(channel: TransportChannel, sourceConnection: ApplicationConnection): Promise<Completion> {\n\n        const channelStrId = channel.uuid().toString();\n        const log = LoggerFactory.getLogger(`Client Request Processor [${channelStrId}]`);\n\n        return new Promise((resolve, reject) => {\n\n            let channelObserver: BufferedObserver<ArrayBuffer> | undefined;\n\n            channel.open({\n                started: () => log.trace('Channel started'),\n                startFailed: e => {\n                    log.error('Start failed', e);\n                    reject(e);\n                },\n                next: async messagePayload => {\n                    if (!channelObserver) {\n                        const clientToBrokerRequest = ClientProtocolHelper.decodeClientToBrokerRequest(messagePayload);\n                        if (clientToBrokerRequest.invocationStartRequest) {\n                            channelObserver = new BufferedObserver<ArrayBuffer>();\n                            try {\n                                const result = await this.invocationRequestProcessor.handleRequest(\n                                    channelObserver,\n                                    clientToBrokerRequest.invocationStartRequest,\n                                    channel,\n                                    sourceConnection.descriptor);\n                                resolve(result);\n                            } catch (error) {\n                                reject(error);\n                            }\n                        } else if (clientToBrokerRequest.methodDiscoveryRequest) {\n                            try {\n                                await this.discoveryRequestHandler.handleMethodDiscovery(clientToBrokerRequest.methodDiscoveryRequest, channel, sourceConnection);\n                                resolve();\n                            } catch (error) {\n                                reject(error);\n                            }\n                        } else {\n                            // TODO support service discovery\n                            this.log.error('Not supported request received', JSON.stringify(clientToBrokerRequest));\n                        }\n                    } else {\n                        channelObserver.next(messagePayload);\n                    }\n                },\n                error: e => {\n                    log.error('Error from source channel received', e);\n                    if (channelObserver) {\n                        channelObserver.error(e);\n                    }\n                    reject(e);\n                },\n                complete: completion => {\n                    if (channelObserver) {\n                        channelObserver.complete(completion);\n                    }\n                    log.trace('Channel completed');\n                }\n            });\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/broker/DiscoveryRequestHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLifeCycleManager } from '../lifecycle/AppLifeCycleManager';\nimport { AppRegistryService } from '@plexus-interop/metadata';\nimport { InteropRegistryService } from '@plexus-interop/metadata';\nimport { MethodDiscoveryRequest } from '@plexus-interop/client-api';\nimport { TransportChannel } from '@plexus-interop/transport-common';\nimport { ApplicationConnection } from '../lifecycle/ApplicationConnection';\nimport { clientProtocol, ErrorCompletion, ClientError, UniqueId, ClientProtocolHelper } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory, ExtendedArray } from '@plexus-interop/common';\nimport { ProvidedMethod } from '@plexus-interop/metadata';\nimport { DiscoveredMethod, MethodType } from '@plexus-interop/client';\n\nexport class DiscoveryRequestHandler {\n\n    private readonly log: Logger = LoggerFactory.getLogger('DiscoveryRequestHandler');\n\n    public constructor(\n        private readonly appLifeCycleManager: AppLifeCycleManager,\n        readonly appRegistryService: AppRegistryService,\n        private readonly interopRegistryService: InteropRegistryService\n    ) { }\n\n    public async handleMethodDiscovery(\n        methodDiscoveryRequest: MethodDiscoveryRequest,\n        sourceChannel: TransportChannel,\n        sourceConnection: ApplicationConnection): Promise<void> {\n\n        const appId = sourceConnection.descriptor.applicationId;\n\n        this.log.info(`Handling method discovery from ${appId}`);\n\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Method discovery request`, methodDiscoveryRequest);\n        }\n\n        try {\n\n            const appMetadata = this.interopRegistryService.getApplication(appId);\n\n            let providedMethods: ProvidedMethod[] = methodDiscoveryRequest.consumedMethod ?\n                this.interopRegistryService\n                    .getMatchingProvidedMethods(sourceConnection.descriptor.applicationId, methodDiscoveryRequest.consumedMethod)\n                : this.interopRegistryService.getMatchingProvidedMethodsForApp(appMetadata);\n\n            if (methodDiscoveryRequest.inputMessageId) {\n                providedMethods = providedMethods.filter(m => m.method.requestMessage.id === methodDiscoveryRequest.inputMessageId);\n            }\n\n            if (methodDiscoveryRequest.outputMessageId) {\n                providedMethods = providedMethods.filter(m => methodDiscoveryRequest.outputMessageId === methodDiscoveryRequest.outputMessageId);\n            }\n\n            let discoveredMethods: DiscoveredMethod[];\n\n            if (clientProtocol.interop.protocol.DiscoveryMode.Online\n                === methodDiscoveryRequest.discoveryMode) {\n\n                const connectedApps = await this.appLifeCycleManager.getOnlineConnections();\n\n                this.log.trace(`Handling online discovery, ${connectedApps.length} apps connected`);\n\n                discoveredMethods = ExtendedArray.of(providedMethods)\n                    .joinWith(connectedApps, (providedMethod, app) => {\n                        // join fn\n                        return this.convertDiscoveredMethod(providedMethod, app.descriptor.connectionId);\n                    }, (providedMethod, app) => {\n                        // predicate\n                        return providedMethod.providedService.application.id === app.descriptor.applicationId;\n                    })\n                    .toArray();\n\n            } else {\n                discoveredMethods = providedMethods.map(pm => this.convertDiscoveredMethod(pm));\n            }\n\n\n            this.log.debug(`Discovered ${discoveredMethods.length} methods`);\n        \n            const payload = ClientProtocolHelper.discoveryMethodResponsePayload({methods: discoveredMethods});\n\n            await sourceChannel.sendLastMessage(payload);\n\n        } catch (e) {\n            this.log.error('Failed to execute discovery', e);\n            sourceChannel.close(new ErrorCompletion(new ClientError(e)));\n        }\n\n    }\n\n    private convertDiscoveredMethod(pm: ProvidedMethod, connectionId?: UniqueId): DiscoveredMethod {\n        const methodType: MethodType = pm.method.type;\n        const methodTitle = pm.title;\n        const inputMessageId = pm.method.requestMessage.id;\n        const outputMessageId = pm.method.responseMessage.id;        \n        const options = pm.options;\n\n        const providedMethod = {\n            providedService: {\n                serviceId: pm.providedService.service.id,\n                serviceAlias: pm.providedService.alias,\n                applicationId: pm.providedService.application.id,\n                connectionId\n            },\n            methodId: pm.method.name        \n        };\n\n        return {\n            methodType,\n            methodTitle,\n            inputMessageId,\n            outputMessageId,\n            providedMethod,\n            options\n        };\n\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/broker/InvocationRequestHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus, SuccessCompletion, ClientProtocolHelper, ErrorCompletion, Completion, UniqueId, ClientProtocolUtils } from '@plexus-interop/protocol';\nimport { ApplicationConnectionDescriptor } from '../lifecycle/ApplicationConnectionDescriptor';\nimport { InteropRegistryService } from '@plexus-interop/metadata';\nimport { AppLifeCycleManager } from '../lifecycle/AppLifeCycleManager';\nimport { TransportChannel, Defaults, BufferedObserver, PlexusObserver } from '@plexus-interop/transport-common';\nimport { LoggerFactory, Logger } from '@plexus-interop/common';\nimport { ConsumedMethodReference } from '@plexus-interop/metadata';\nimport { ProvidedMethodReference } from '@plexus-interop/metadata';\nimport { ApplicationConnection } from '../lifecycle/ApplicationConnection';\nimport { Types } from '../util/Types';\n\nexport class InvocationRequestHandler {\n\n    private log: Logger = LoggerFactory.getLogger('InvocationRequestHandler');\n\n    constructor(\n        private readonly registryService: InteropRegistryService,\n        private readonly appLifeCycleManager: AppLifeCycleManager) { }\n\n    public async handleRequest(\n        inMessagesBufferedObserver: BufferedObserver<ArrayBuffer>,\n        invocationRequest: plexus.interop.protocol.IInvocationStartRequest,\n        sourceChannel: TransportChannel,\n        sourceConnectionDescriptor: ApplicationConnectionDescriptor): Promise<Completion> {\n\n        const sourceChannelId = sourceChannel.uuid().toString();\n        const sourceConnectionId = sourceConnectionDescriptor.connectionId.toString();\n\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Handling start invocation request [${sourceChannelId}] from [${sourceConnectionId}]`);\n        }\n\n        try {\n\n            const methodReference: ConsumedMethodReference | ProvidedMethodReference = (invocationRequest.consumedMethod as ConsumedMethodReference) || invocationRequest.providedMethod;\n            const targetAppConnection = await this.resolveTargetConnection(methodReference, sourceConnectionDescriptor);\n\n            if (this.log.isDebugEnabled()) {\n                this.log.debug(`Target connection [${targetAppConnection.descriptor.connectionId.toString()}] found`);\n            }\n\n            const targetChannel = await targetAppConnection.connection.createChannel();\n\n            try {\n\n                const targetChannelId = targetChannel.uuid().toString();\n                this.log = LoggerFactory.getLogger(`InvocationRequestHandler ${sourceChannelId}->${targetChannelId}`);\n                this.log.debug(`Target channel created`);\n\n                const targetChannelObserver = new BufferedObserver(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n                await targetChannel.open({\n                    next: m => targetChannelObserver.next(m),\n                    complete: completion => targetChannelObserver.complete(completion),\n                    error: e => targetChannelObserver.error(e),\n                    started: () => { },\n                    startFailed: e => this.log.error('Failed to start target channel', e)\n                });\n\n                this.log.trace(`Sending InvocationStarting to source`);\n                sourceChannel.sendMessage(ClientProtocolHelper.invocationStartingMessagePayload({}));\n\n                this.log.trace(`Sending InvocationRequested to [${targetChannelId}]`);\n                targetChannel.sendMessage(ClientProtocolHelper.invocationRequestedPayload(this.createInvocationStartRequested(methodReference, sourceConnectionDescriptor)));\n\n                const targetPropogationCompleted = this.propogateAll(inMessagesBufferedObserver, targetChannel, sourceChannel);\n                const sourcePropogationCompleted = this.propogateAll(targetChannelObserver, sourceChannel, targetChannel);\n\n                await Promise.all([targetPropogationCompleted, sourcePropogationCompleted]);\n\n                this.log.debug(`All messages sent, closing channels`);\n                const targetClosed = targetChannel.close();\n                const sourceClosed = sourceChannel.close();\n\n                try {\n                    await Promise.all([targetClosed, sourceClosed]);\n                    this.log.debug(`Channels closed`);\n                } catch (error) {\n                    this.log.error(`Failed to close channels`, error);\n                    return new ErrorCompletion(error);\n                }\n\n                this.log.info('Completed');\n                return new SuccessCompletion();\n\n            } catch (error) {\n                this.log.error(`Communication between channels failed`, error);\n                const completion = new ErrorCompletion(error);\n                targetChannel.close(completion);\n                sourceChannel.close(completion);\n                return completion;\n            }\n\n        } catch (targetError) {\n            this.log.error(`Error on getting target channel`, targetError);\n            const completion = new ErrorCompletion(targetError);\n            sourceChannel.close(completion);\n            return completion;\n        }\n\n    }\n\n    private async propogateAll(source: BufferedObserver<ArrayBuffer>, targetChannel: TransportChannel, sourceChannel: TransportChannel): Promise<void> {\n\n        const targetChannelId = targetChannel.uuid().toString();\n        const sourceChannelId = sourceChannel.uuid().toString();\n\n        const sourceObserver: (resolve: any, reject: any) => PlexusObserver<ArrayBuffer> = (resolve, reject) => {\n            return {\n                next: async messagePayload => {\n                    if (this.log.isTraceEnabled()) {\n                        this.log.trace(`[${sourceChannelId}]->[${targetChannelId}] Transferring message of ${messagePayload.byteLength} bytes`);\n                    }\n                    try {\n                        await targetChannel.sendMessage(messagePayload);\n                    } catch (e) {\n                        this.log.error('Unable to send message', e);\n                        reject(e);\n                    }\n                },\n                complete: completion => {\n                    if (completion && ClientProtocolUtils.isCancelCompletion(completion)) {\n                        this.log.info(`Source channel [${sourceChannelId}] cancelled invocation, sending cancellation close to target [${targetChannelId}]`);\n                        targetChannel.close(completion);\n                    }\n                    this.log.trace(`Source channel [${sourceChannelId}] completed`);\n                    resolve();\n                },\n                error: e => {\n                    this.log.error(`Received error from source channel [${sourceChannelId}]`, e);\n                    reject(e);\n                }\n            };\n        };\n\n        return new Promise<void>((resolve, reject) => {\n            source.setObserver(sourceObserver(resolve, reject));\n        });\n    }\n\n    private createInvocationStartRequested(methodReference: ConsumedMethodReference | ProvidedMethodReference, sourceConnection: ApplicationConnectionDescriptor): plexus.interop.protocol.IInvocationStartRequested {\n        return {\n            serviceId: Types.isConsumedMethodReference(methodReference) ?\n                (methodReference.consumedService as plexus.interop.protocol.IConsumedServiceReference).serviceId :\n                (methodReference.providedService as plexus.interop.protocol.IProvidedServiceReference).serviceId,\n            methodId: methodReference.methodId,\n            consumerApplicationId: sourceConnection.applicationId,\n            consumerConnectionId: sourceConnection.connectionId\n        };\n    }\n\n    private async resolveTargetConnection(methodReference: ConsumedMethodReference | ProvidedMethodReference, sourceConnection: ApplicationConnectionDescriptor): Promise<ApplicationConnection> {\n        if (!Types.isConsumedMethodReference(methodReference)) {\n            if (!methodReference.providedService) {\n                throw new Error('Provided Service information is required');\n            }\n            let appConnection;\n            if (methodReference.providedService && methodReference.providedService.connectionId) {\n                const onlineApps = await this.appLifeCycleManager.getOnlineConnections();\n                const connectionId = UniqueId.fromProperties(methodReference.providedService.connectionId as plexus.IUniqueId);\n                this.log.trace(`Looking for app by connection id [${connectionId.toString()}]`);\n                appConnection = onlineApps.find(a => connectionId.equals(a.connection.uuid()));\n            } else if (methodReference.providedService && methodReference.providedService.applicationInstanceId) {\n                const onlineApps = await this.appLifeCycleManager.getOnlineConnections();\n                const appInstanceId = UniqueId.fromProperties(methodReference.providedService.applicationInstanceId as plexus.IUniqueId).toString();\n                this.log.trace(`Looking for app by appInstanceId [${appInstanceId}]`);\n                let connections = onlineApps.filter(a => appInstanceId === a.descriptor.instanceId);\n                if (methodReference.providedService.applicationId) {\n                    const appId = methodReference.providedService.applicationId;\n                    connections = connections.filter(a => appId === appId);\n                }\n                if (connections.length === 0) {\n                    appConnection = null;\n                }\n                else if (connections.length > 1) {\n                    throw new Error(`App instance ${appInstanceId} has several connections, you need to specify ApplicationId to make call to specific connection`);\n                }\n                else {\n                    appConnection = connections[0];\n                }\n            }\n             else if (methodReference.providedService && methodReference.providedService.applicationId) {\n                this.log.trace(`Looking for app by app id [${methodReference.providedService.applicationId}]`);\n                appConnection = this.appLifeCycleManager.getOrSpawnConnection(methodReference.providedService.applicationId, sourceConnection.instanceId);\n            }\n            if (!appConnection) {\n                throw new Error('Requested application is not online');\n            }\n            return appConnection;\n        } else {\n            const targetMethods = this.registryService.getMatchingProvidedMethods(sourceConnection.applicationId, methodReference);\n            if (\n                targetMethods.length === 1 && targetMethods[0].options !== undefined &&\n                targetMethods[0].options.filter(o => o.id === 'interop.ProvidedMethodOptions.launch_on_call' && o.value === 'ALWAYS').length > 0\n            ) {\n                const appConnection = await this.appLifeCycleManager.spawnConnection(targetMethods[0].providedService.application.id);\n                return appConnection;\n            } else {\n                const targetAppIds = targetMethods\n                    .map(method => method.providedService.application.id);\n                const appConnection = await this.appLifeCycleManager.getOrSpawnConnectionForOneOf(targetAppIds, sourceConnection.instanceId);\n                return appConnection;\n            }\n        }\n    }\n}"
  },
  {
    "path": "web/packages/broker/src/broker/TasksTracker.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Completion, ClientProtocolUtils } from '@plexus-interop/protocol';\n\nexport class TasksTracker {\n\n    // tslint:disable-next-line:typedef\n    private readonly tasks = new Map<string, Promise<Completion>>();\n\n    public async start(id: string, task: () => Promise<Completion>): Promise<Completion> {\n        const resultPromise = task();\n        this.tasks.set(id, resultPromise);\n        try {\n            return await resultPromise;\n        } finally {\n            this.tasks.delete(id);\n        }\n    }\n\n    public async completePending(): Promise<Completion> {\n        const pendingTasks = this.tasks.values();\n        const results = await Promise.all(pendingTasks);\n        return ClientProtocolUtils.createSummarizedCompletion(...results);\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/bus/Event.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Event {\n    payload: any;\n}"
  },
  {
    "path": "web/packages/broker/src/bus/EventBus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Event } from './Event';\nimport { Subscription } from '@plexus-interop/common';\n\nexport interface EventBus {\n\n    subscribe(key: string, handler: (event: Event) => void): Subscription;\n\n    publish(key: string, event: Event): void;\n\n    init(): Promise<EventBus>;\n\n}"
  },
  {
    "path": "web/packages/broker/src/bus/FallbackEventBus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from './EventBus';\nimport { Event } from './Event';\nimport { Subscription, Logger, LoggerFactory } from '@plexus-interop/common';\n\nexport class FallbackEventBus implements EventBus {\n\n    private readonly log: Logger = LoggerFactory.getLogger('FallbackEventBus');\n\n    private baseEventBus: EventBus;\n\n    public constructor(private readonly sources: EventBus[]) { }\n\n    public async init(): Promise<EventBus> {\n        if (!this.sources || this.sources.length === 0) {\n            throw new Error('No source provided');\n        }\n        for (let i = 0; i < this.sources.length; i++) {\n            try {\n                this.baseEventBus = await this.sources[i].init();\n                break;\n            } catch (error) {\n                this.log.warn('Unable to init Event Bus', error);\n            }\n        }\n        if (this.baseEventBus) {\n            return this.baseEventBus;\n        } else {\n            throw new Error('All source Event Bus providers failed');\n        }\n    }\n\n    public publish(key: string, event: Event): void {\n        if (this.baseEventBus) {\n            this.baseEventBus.publish(key, event);\n        } else {\n            throw new Error('Not initialyzed');\n        }\n    }\n\n    public subscribe(key: string, handler: (event: Event) => void): Subscription {\n        if (this.baseEventBus) {\n            return this.baseEventBus.subscribe(key, handler);\n        } else {\n            throw new Error('Not initialyzed');\n        }\n    }\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/CrossDomainBusConfig.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface CrossDomainBusConfig {\n    hostIFrameId: string;\n    hostUrl: string;\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/CrossDomainEventBus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Event } from '../Event';\nimport { EventBus } from '../EventBus';\nimport { Subscription, Logger, LoggerFactory, Observer, GUID, StateMaschine, StateMaschineBase } from '@plexus-interop/common';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/fromEvent';\nimport 'rxjs/add/operator/filter';\nimport 'rxjs/add/operator/map';\nimport 'rxjs/add/operator/publish';\nimport { IFrameHostMessage } from './model/IFrameHostMessage';\nimport { SubscribeRequest } from './model/SubscribeRequest';\nimport { ResponseType } from './model/ResponseType';\nimport { MessageType } from './model/MessageType';\nimport { PartialObserver } from 'rxjs/Observer';\n\nenum State {\n    CREATED = 'CREATED',\n    CONNECTED = 'CONNECTED',\n    CLOSED = 'CLOSED'\n}\n\nexport class CrossDomainEventBus implements EventBus {\n\n    private readonly log: Logger = LoggerFactory.getLogger('CrossDomainEventBus');\n\n    private readonly singleOperationTimeOut: number = 60000;\n    private readonly pingTimeoutInMillis: number = 1000;\n\n    private readonly emitters: Map<string, Observer<any>> = new Map<string, Observer<any>>();\n    private readonly observables: Map<string, Observable<any>> = new Map<string, Observable<any>>();\n    private readonly rejectTimeouts: Map<string, NodeJS.Timer> = new Map<string, NodeJS.Timer>();\n\n    private hostIframeEventsSubscription: Subscription;\n\n    private readonly stateMaschine: StateMaschine<State> = new StateMaschineBase(State.CREATED, [\n        { from: State.CREATED, to: State.CONNECTED },\n        { from: State.CONNECTED, to: State.CLOSED }\n    ], this.log);\n\n    public constructor(\n        private readonly hostIFrame: HTMLIFrameElement,\n        private readonly hostOrigin: string) { }\n\n\n    public init(): Promise<EventBus> {\n        this.stateMaschine.throwIfNot(State.CREATED);\n        this.createHostMessagesSubscription();\n        this.log.info('Host iFrame created, sending ping messages');        \n        return this.chainRetries(20, () => this.sendPingToHost(this.pingTimeoutInMillis))\n            .then(() => this);\n    }\n\n    public async disconnect(): Promise<void> {\n        this.stateMaschine.throwIfNot(State.CONNECTED);\n        this.stateMaschine.go(State.CLOSED);\n        if (this.hostIframeEventsSubscription) {\n            this.log.info('Unsubsribing from Host iFrame');\n            this.hostIframeEventsSubscription.unsubscribe();\n        }\n        this.emitters.forEach((v, k) => v.error('Disconnected from Host iFrame'));\n        this.emitters.clear();\n        this.observables.clear();\n    }\n\n    public publish(topic: string, event: Event): void {\n        this.stateMaschine.throwIfNot(State.CONNECTED);\n        const payload = event.payload;\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Publishing to [${topic}]`, payload);\n        }\n        const message = this.hostMessage({ topic, payload }, MessageType.Publish);\n        this.postToIFrame(message);\n    }\n\n    public subscribe(topic: string, handler: (event: Event) => void): Subscription {\n        this.stateMaschine.throwIfNot(State.CONNECTED);\n        const message = this.hostMessage({ topic }, MessageType.Subscribe, ResponseType.Stream);\n        return this.sendAndSubscribe<SubscribeRequest, Event>(message, {\n            next: message => handler(message.responsePayload as Event)\n        });\n    }\n\n    protected sharedObservable<T>(key: string, postInit?: (key: string, observable: Observable<T>) => void): Observable<T> {\n        let eventsObservable = this.observables.get(key);\n        if (eventsObservable === undefined) {\n            eventsObservable = Observable.create((observer: Observer<T>) => {\n                this.log.debug(`Creating ${key} observable`);\n                this.emitters.set(key, observer);\n                return () => {\n                    this.log.debug(`Cleaning up ${key} observable`);\n                    this.emitters.delete(key);\n                    this.observables.delete(key);\n                };\n            }).publish().refCount() as Observable<T>;\n            this.observables.set(key, eventsObservable);\n            if (postInit) {\n                postInit(key, eventsObservable);\n            }\n        }\n        return eventsObservable;\n    }\n\n    protected clearEmitter(key: string): void {\n        this.emitters.delete(key);\n        this.observables.delete(key);\n    }\n\n    private sendAndSubscribe<T, ResType>(\n        message: IFrameHostMessage<T, ResType>,\n        observer: PartialObserver<IFrameHostMessage<T, ResType>>,\n        rejectTimeout: number = this.singleOperationTimeOut): Subscription {\n\n        const responseType = message.responseType;\n        const subscriptionKey = this.subscriptionKey(message);\n        message.responseType = (!responseType || responseType === ResponseType.None) ? ResponseType.Stream : message.responseType;\n\n        return this.sharedObservable<IFrameHostMessage<T, ResType>>(\n            subscriptionKey,\n            () => {\n                this.postToIFrame(message);\n                if (message.responseType === ResponseType.Single) {\n                    this.rejectTimeouts.set(subscriptionKey, setTimeout(() => {\n                        const errorMsg = `Operation's timeout passed ${rejectTimeout}`;\n                        this.log.warn(errorMsg);\n                        this.emitError(subscriptionKey, errorMsg);\n                        this.rejectTimeouts.delete(subscriptionKey);\n                    }, rejectTimeout));\n                }\n            }).subscribe(observer);\n\n    }\n\n    private chainRetries(times: number, fn: () => Promise<void>): Promise<void> {\n        let res = fn();\n        for (let index = 0; index < times; index++) {\n            res = res.catch(fn);\n        }\n        return res;\n    }\n\n    private sendPingToHost(timeout: number): Promise<void> {\n        return new Promise((resolve, reject) => {\n            this.log.info('Sending ping message');        \n            const message = this.hostMessage({}, MessageType.Ping, ResponseType.Single);\n            this.sendAndSubscribe(message, {\n                next: m => {\n                    this.log.info('Success ping response received');\n                    this.stateMaschine.go(State.CONNECTED);\n                    resolve();\n                },\n                error: e => {\n                    this.log.warn('Failed to receive ping response', e);\n                    reject(e);\n                }\n            }, timeout);\n        });\n    }\n\n    private postToIFrame(message: any): void {\n        const contentWindow = this.hostIFrame.contentWindow;\n        if (contentWindow) {\n            contentWindow.postMessage(message, this.hostOrigin);\n        } else {\n            this.log.warn('Content window is empty');\n        }\n    }\n\n    private clearRejectTimeout(key: string): void {\n        const timeout = this.rejectTimeouts.get(key);\n        if (timeout) {\n            this.log.trace(`Clearing reject timeout for ${key}`);\n            clearTimeout(timeout);\n            this.rejectTimeouts.delete(key);\n        }\n    }\n\n    private createHostMessagesSubscription(): void {\n        this.log.info('Creating subscription to Host iFrame');\n        this.hostIframeEventsSubscription = Observable.fromEvent<MessageEvent>(window, 'message')\n            .filter(event => {\n                this.log.trace(`Received message from ${event.origin}`);\n                return event.origin === this.hostOrigin;\n            })\n            .map(event => event.data)\n            .filter(parsed => (parsed as IFrameHostMessage<any, any>).type !== undefined)\n            .map(parsed => parsed as IFrameHostMessage<any, any>)\n            .subscribe((m) => { this.handleHostMessage(m); });\n    }\n\n    private handleHostMessage<T, R>(hostMessage: IFrameHostMessage<T, R>): void {\n        switch (hostMessage.responseType as ResponseType) {\n            case ResponseType.Single:\n                this.emitAndComplete(this.subscriptionKey(hostMessage), hostMessage);\n                break;\n            case ResponseType.Stream:\n                this.emit(this.subscriptionKey(hostMessage), hostMessage);\n                break;\n            default:\n                this.log.error(`Unsupported host message type ${hostMessage.responseType}`);\n                break;\n        }\n    }\n\n    private hostMessage<T, R>(requestPayload: T, type: MessageType<T, R>, responseType?: ResponseType): IFrameHostMessage<T, R> {\n        responseType = responseType ? responseType : ResponseType.None;\n        return { id: GUID.getNewGUIDString(), type, requestPayload, responseType };\n    }\n\n    private subscriptionKey(hostMessage: IFrameHostMessage<any, any>): string {\n        switch (hostMessage.type.id) {\n            case MessageType.Subscribe.id:\n                let message = hostMessage as IFrameHostMessage<SubscribeRequest, any>;\n                return message.type.id + '.' + (message.requestPayload ? message.requestPayload.topic : message.responsePayload.key);\n            default:\n                return hostMessage.id;\n        }\n    }\n\n    private emit(subscription: string, value: any, complete?: boolean): void {\n        this.clearRejectTimeout(subscription);\n        const observer = this.emitters.get(subscription);\n        if (observer !== undefined) {\n            observer.next(value);\n            if (complete) {\n                observer.complete();\n                this.clearEmitter(subscription);\n            }\n        }\n    }\n\n    private emitError(subscription: string, error: string): void {\n        let observer = this.emitters.get(subscription);\n        if (observer) {\n            observer.error(new Error(error));\n            this.clearEmitter(subscription);\n        }\n    }\n\n    private emitAndComplete(subscription: string, value: any): void {\n        this.emit(subscription, value, true);\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/host/CrossDomainHost.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../../EventBus';\nimport { Event } from '../../Event';\nimport { StateMaschine, StateMaschineBase, LoggerFactory, Logger } from '@plexus-interop/common';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/fromEvent';\nimport 'rxjs/add/operator/filter';\nimport 'rxjs/add/operator/map';\nimport { IFrameHostMessage } from '../model/IFrameHostMessage';\nimport { CrossDomainHostConfig } from './CrossDomainHostConfig';\nimport { MessageType } from '../model/MessageType';\nimport { HostState } from './HostState';\nimport { HostMessageEvent } from './HostMessageEvent';\nimport { PublishRequest } from '../model/PublishRequest';\nimport { SubscribeRequest } from '../model/SubscribeRequest';\nimport { RemoteActionStatus } from '../../../peers/remote/RemoteActionStatus';\n\nexport class CrossDomainHost {\n\n    private readonly log: Logger = LoggerFactory.getLogger('CrossDomainHost');\n\n    private readonly parentWin: Window;\n\n    private stateMaschine: StateMaschine<HostState> = new StateMaschineBase<HostState>(HostState.CREATED, [\n        { from: HostState.CREATED, to: HostState.CONNECTED },\n        { from: HostState.CONNECTED, to: HostState.CLOSED }\n    ], this.log);\n\n    public constructor(\n        private readonly internalBus: EventBus,\n        private readonly config: CrossDomainHostConfig\n    ) {\n        this.parentWin = window.parent;\n    }\n\n    public async connect(): Promise<void> {\n        this.stateMaschine.throwIfNot(HostState.CREATED);\n        this.initCommunicationWithParent();\n        this.stateMaschine.go(HostState.CONNECTED);\n    }\n\n    private whiteListed(message: MessageEvent): boolean {\n        const { origin, source } = message;\n        return source === this.parentWin\n            && this.config.whiteListedUrls\n            && !!this.config.whiteListedUrls.find(pattern => pattern === '*' || origin.endsWith(pattern));\n    }\n\n    private initCommunicationWithParent(): void {\n        this.log.info('Subscribing to parent messages');\n        Observable.fromEvent<MessageEvent>(window, 'message')\n            .filter(event => this.whiteListed(event))\n            .map(event => {\n                if (this.log.isTraceEnabled()) {\n                    this.log.trace(`Received event from ${event.origin}`);\n                }\n                return {\n                    message: event.data as IFrameHostMessage<any, any>,\n                    sourceWindow: event.source,\n                    sourceOrigin: event.origin\n                };\n            })\n            .filter((parsed) =>\n                parsed.message.type !== undefined\n                && parsed.message.requestPayload !== undefined\n                && !parsed.message.responsePayload)\n            .subscribe({\n                next: msg => this.handleParentMessage({\n                    ...msg,\n                    sourceWindow: msg.sourceWindow as Window\n                }),\n                error: e => this.log.error('Error from parent messages subscription', e)\n            });\n    }\n\n    private sendToParent<T, R>(message: IFrameHostMessage<T, R>, source: Window, origin: string): void {\n        source.postMessage(message, origin);\n    }\n\n    private handleParentMessage(parsedEvent: HostMessageEvent): void {\n        const message = parsedEvent.message;\n        switch (message.type.id) {\n            case MessageType.Ping.id:\n                this.log.trace('Received ping request');\n                message.responsePayload = {};\n                this.sendToParent(\n                    message,\n                    parsedEvent.sourceWindow,\n                    parsedEvent.sourceOrigin);\n                break;\n            case MessageType.Publish.id:\n                const pubMsg = message as IFrameHostMessage<PublishRequest, {}>;\n                const requestPayload = pubMsg.requestPayload as PublishRequest;\n                if (this.log.isTraceEnabled()) {\n                    this.log.trace(`Received publish request to [${requestPayload.topic}] topic`, requestPayload.payload);\n                }\n                this.internalBus.publish(requestPayload.topic, { payload: requestPayload.payload });\n                break;\n            case MessageType.Subscribe.id:\n                const subMsg = message as IFrameHostMessage<SubscribeRequest, Event>;\n                const request = subMsg.requestPayload as SubscribeRequest;\n                this.log.trace(`Received subscribe request, [${request.topic}]`);\n                const subscription = this.internalBus.subscribe(request.topic, event => {\n                    if (this.log.isTraceEnabled()) {\n                        this.log.trace(`Received event for [${request.topic}] topic`, event.payload);                    \n                    }\n                    if (this.isLastRemoteMessage(event)) {\n                        subscription.unsubscribe();    \n                    }\n                    subMsg.responsePayload = {\n                        payload: event.payload\n                    };\n                    this.sendToParent(\n                        subMsg,\n                        parsedEvent.sourceWindow,\n                        parsedEvent.sourceOrigin);\n                    });\n                break;\n            default:\n                this.log.error(`Unsupported message type ${message.type.id}`);\n                break;\n        }\n    }\n\n    private isLastRemoteMessage(event: Event): boolean {\n        const payload = event.payload;\n        return payload && (payload.status === RemoteActionStatus.COMPLETED || payload.status === RemoteActionStatus.FAILURE);\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/host/CrossDomainHostConfig.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface CrossDomainHostConfig {\n    whiteListedUrls: string[];\n}\n"
  },
  {
    "path": "web/packages/broker/src/bus/cross/host/HostMessageEvent.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { IFrameHostMessage } from '../model/IFrameHostMessage';\n\nexport interface HostMessageEvent {\n    message: IFrameHostMessage<any, any>;\n    sourceWindow: Window;\n    sourceOrigin: string;\n}\n"
  },
  {
    "path": "web/packages/broker/src/bus/cross/host/HostState.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum HostState {\n    CREATED = 'CREATED',\n    CONNECTED = 'CONNECTED',\n    CLOSED = 'CLOSED'\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './CrossDomainEventBus';"
  },
  {
    "path": "web/packages/broker/src/bus/cross/model/IFrameHostMessage.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MessageType } from './MessageType';\nimport { ResponseType } from './ResponseType';\n\nexport interface IFrameHostMessage<Req, Res> {\n    id: string;\n    type: MessageType<Req, Res>;\n    responseType: ResponseType;\n    requestPayload?: Req;\n    responsePayload?: Res;\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/model/MessageType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PublishRequest } from './PublishRequest';\nimport { Event } from '../../Event';\nimport { SubscribeRequest } from './SubscribeRequest';\n\nexport class MessageType<Req, Res> {\n\n    // tslint:disable-next-line:variable-name\n    public static Ping: MessageType<{}, {}> = new MessageType<{}, {}>(1);\n\n    // tslint:disable-next-line:variable-name\n    public static Publish: MessageType<PublishRequest, {}> = new MessageType<PublishRequest, {}>(6);\n\n    // tslint:disable-next-line:variable-name\n    public static Subscribe: MessageType<SubscribeRequest, Event> = new MessageType<SubscribeRequest, Event>(8);\n\n    constructor(public id: number) { }\n    \n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/model/PublishRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface PublishRequest {\n    payload: any;\n    topic: string;\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/model/ResponseType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum ResponseType {\n    None = 'NONE',\n    Stream = 'STREAM',\n    Single = 'SINGLE'\n}"
  },
  {
    "path": "web/packages/broker/src/bus/cross/model/SubscribeRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface SubscribeRequest {\n    topic: string;\n}"
  },
  {
    "path": "web/packages/broker/src/bus/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './EventBus';\nexport * from './Event';\nexport * from './cross';\nexport * from './same/BroadCastChannelEventBus';\nexport * from './same/JStorageEventBus';\nexport * from './FallbackEventBus';"
  },
  {
    "path": "web/packages/broker/src/bus/same/BroadCastChannelEventBus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../EventBus';\nimport { Event } from '../Event';\nimport { Subscription, AnonymousSubscription, Logger, LoggerFactory, InMemoryCache, CacheEntry } from '@plexus-interop/common';\n\n/**\n * Event bus based on Broad Cast Channel API \n * https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts\n */\nexport class BroadCastChannelEventBus implements EventBus {\n\n    private readonly openChannelTtl: number = 300000;\n\n    private readonly log: Logger;\n\n    // tslint:disable-next-line:typedef\n    private readonly openChannels = new InMemoryCache();\n\n    public constructor(private readonly namespace: string = 'plexus-bus') {\n        this.log = LoggerFactory.getLogger(`BroadCastEventBus [${namespace}]`);\n    }\n\n    public subscribe(key: string, handler: (event: Event) => void): Subscription {\n        this.log.trace(`Subscribing to ${key}`);\n        const channel = new BroadcastChannel(this.internalKey(key));\n        channel.onmessage = e => {\n            handler({ payload: e.data });\n        };\n        return new AnonymousSubscription(() => {\n            this.log.trace(`Closing subscription to channel ${key}`);\n            channel.close();\n        });\n    }\n\n    public publish(key: string, event: Event): void {\n        this.log.trace(`Publishing to ${key}`);\n        const channel = this.lookupOpenChannel(key);\n        channel.postMessage(event.payload);\n    }\n\n    public async init(): Promise<EventBus> {\n        if (typeof BroadcastChannel === 'undefined') {\n            throw new Error('Browser doesn\\'t support BroadCastChannel API');\n        } else {\n            return this;\n        }\n    }\n\n    private lookupOpenChannel(key: string): BroadcastChannel {\n        let channel = this.openChannels.get<BroadcastChannel>(key);\n        if (!channel) {\n            channel = new BroadcastChannel(this.internalKey(key));\n            this.openChannels.set<BroadcastChannel>(key, new CacheEntry<BroadcastChannel>(channel, this.openChannelTtl, () => {\n                this.log.debug(`TTL passed for ${key} channel, closing it`);\n                (channel as BroadcastChannel).close();\n            }));\n        } else {\n            this.openChannels.resetTtl(key);\n        }\n        return channel;\n    }\n\n    private internalKey(key: string): string {\n        return `${this.namespace}:${key}`;\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/bus/same/JStorageEventBus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../EventBus';\nimport { Event } from '../Event';\nimport 'ya-js-storage';\nimport { Subscription, Logger, LoggerFactory, AnonymousSubscription } from '@plexus-interop/common';\n\nconst globalObj: any = global || window;\nconst yaJsStorage = globalObj.$.yaJsStorage;\n\nexport class JStorageEventBus implements EventBus {\n\n    private readonly log: Logger;\n\n    private yaStorage: JStorageStatic = yaJsStorage;\n\n    public constructor(readonly namespace: string = 'plexus-bus') {\n        this.log = LoggerFactory.getLogger(`JStorageEventBus [${namespace}]`);\n    }\n\n    public async init(): Promise<EventBus> {\n        return this;\n    }\n\n    public publish(key: string, event: Event): void {\n        const topic = this.internalKey(key);\n        this.log.trace(`Publishing event to ${topic}`);\n        this.yaStorage.publish(topic, event.payload);\n    }\n\n    public subscribe(key: string, handler: (event: Event) => void): Subscription {\n        const topic = this.internalKey(key);\n        this.log.trace(`Subscribing to ${topic}`);        \n        const unsubscribe: any = this.yaStorage.subscribe(this.internalKey(key), (channel: string, value: any) => {\n            this.log.trace(`Received update for ${topic}`);\n            handler({ payload: value });\n        });\n        return new AnonymousSubscription(() => {\n            this.log.trace(`Unsubscribing from internal ${key} channel`);\n            unsubscribe();\n        });\n    }\n\n    private internalKey(key: string): string {\n        return `${this.namespace}:${key}`;\n    }\n}"
  },
  {
    "path": "web/packages/broker/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './api';\nexport * from './bus';\nexport * from './launcher';"
  },
  {
    "path": "web/packages/broker/src/launcher/AppLaunchRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface AppLaunchRequest {\n    \n    appId: string;\n\n    launchParams: any;\n\n}"
  },
  {
    "path": "web/packages/broker/src/launcher/AppLaunchResponse.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport interface AppLaunchResponse {\n\n    appInstanceId: UniqueId;\n\n}"
  },
  {
    "path": "web/packages/broker/src/launcher/AppLauncher.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLaunchRequest } from './AppLaunchRequest';\nimport { AppLaunchResponse } from './AppLaunchResponse';\nimport { LaunchInvocationContext } from './LaunchInvocationContext';\n\nexport interface AppLauncher {\n\n    /**\n     * Launches new application, returns instance Id\n     */\n    launch(invocationContext: LaunchInvocationContext, request: AppLaunchRequest): Promise<AppLaunchResponse>;\n}"
  },
  {
    "path": "web/packages/broker/src/launcher/AppLauncherRegistry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLauncher } from './AppLauncher';\nimport { UrlWebAppLauncher } from './UrlWebAppLauncher';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\n\nexport class AppLauncherRegistry {\n\n    private static readonly log: Logger = LoggerFactory.getLogger('AppLauncherRegistry');\n\n    private static globalRegistry: Map<string, AppLauncher> = new Map<string, AppLauncher>();\n\n    public static readonly URL_APP_LAUNCHER: string = 'plexus.interop.UrlWebAppLauncher';\n\n    private registry: Map<string, AppLauncher> = new Map<string, AppLauncher>();\n\n    public static registerGlobalAppLauncher(id: string, launcher: AppLauncher): void {\n        this.log.info(`Registering global [${id}] App Launcher`);\n        this.globalRegistry.set(id, launcher);\n    }\n\n    public registerAppLauncher(id: string, launcher: AppLauncher): void {\n        AppLauncherRegistry.log.info(`Registering [${id}] App Launcher`);\n        this.registry.set(id, launcher);\n    }\n\n    public getAppLauncher(launcherId: string): AppLauncher {\n        let res = this.registry.get(launcherId);\n        if (!res) {\n            res = AppLauncherRegistry.globalRegistry.get(launcherId);\n        }\n        if (!res) {\n            throw new Error(`App Launcher with [${launcherId}] ID is not found`);\n        }\n        return res;\n    }\n\n}\n\nAppLauncherRegistry.registerGlobalAppLauncher(AppLauncherRegistry.URL_APP_LAUNCHER, new UrlWebAppLauncher());"
  },
  {
    "path": "web/packages/broker/src/launcher/LaunchInvocationContext.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReadOnlyCancellationToken } from '@plexus-interop/common';\n\nexport interface LaunchInvocationContext {\n    cancellationToken: ReadOnlyCancellationToken;\n}"
  },
  {
    "path": "web/packages/broker/src/launcher/UrlWebAppLauncher.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLauncher } from './AppLauncher';\nimport { AppLaunchRequest } from './AppLaunchRequest';\nimport { AppLaunchResponse } from './AppLaunchResponse';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { LaunchInvocationContext } from './LaunchInvocationContext';\n\nexport class UrlWebAppLauncher implements AppLauncher {\n\n    public static readonly instanceIdRequestParam: string = 'plexusInstanceId';\n\n    private readonly log: Logger = LoggerFactory.getLogger('UrlWebAppLauncher');\n\n    public async launch(invocationContext: LaunchInvocationContext, request: AppLaunchRequest): Promise<AppLaunchResponse> {\n        const appInstanceId = UniqueId.generateNew();\n        const launchUrl: string = request.launchParams.url;\n        const instanceIdParam = `${UrlWebAppLauncher.instanceIdRequestParam}=${appInstanceId.toString()}`;\n        const url = launchUrl.indexOf('?') === -1 ? `${launchUrl}?${instanceIdParam}` : `${launchUrl}&${instanceIdParam}`;\n        this.log.info(`Launching application with [${url}] url`);\n        window.open(url, '_blank');\n        return {\n            appInstanceId\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/launcher/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './AppLauncher';\nexport * from './UrlWebAppLauncher';\nexport * from './AppLaunchResponse';\nexport * from './LaunchInvocationContext';\nexport * from './AppLaunchRequest';\nexport * from './AppLauncherRegistry';"
  },
  {
    "path": "web/packages/broker/src/lifecycle/AppLifeCycleManager.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { ApplicationConnection } from './ApplicationConnection';\nimport { ApplicationDescriptor } from './ApplicationDescriptor';\n\nexport interface AppLifeCycleManager {\n\n    getOnlineConnections(): Promise<ApplicationConnection[]>;\n\n    spawnConnection(applicationId: string): Promise<ApplicationConnection>; \n\n    getOrSpawnConnection(applicationId: string, excludedInstance?: string): Promise<ApplicationConnection>;\n\n    getOrSpawnConnectionForOneOf(applicationIds: string[], excludedInstance?: string): Promise<ApplicationConnection>;\n\n    acceptConnection(connection: TransportConnection, appDescriptor: ApplicationDescriptor, connectionDropped: (connection: ApplicationConnection) => void): Promise<ApplicationConnection>;\n\n}\n"
  },
  {
    "path": "web/packages/broker/src/lifecycle/ApplicationConnection.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { ApplicationConnectionDescriptor } from './ApplicationConnectionDescriptor';\n\nexport interface ApplicationConnection {\n    descriptor: ApplicationConnectionDescriptor;\n    connection: TransportConnection;\n}"
  },
  {
    "path": "web/packages/broker/src/lifecycle/ApplicationConnectionDescriptor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { ApplicationDescriptor } from './ApplicationDescriptor';\n\nexport interface ApplicationConnectionDescriptor extends ApplicationDescriptor {\n    \n    connectionId: UniqueId;\n    \n}"
  },
  {
    "path": "web/packages/broker/src/lifecycle/ApplicationDescriptor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ApplicationDescriptor {\n    \n    applicationId: string;\n\n    instanceId: string;\n    \n}"
  },
  {
    "path": "web/packages/broker/src/peers/ActionType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ActionType<Req, Res> {\n\n    id: string;\n    \n}"
  },
  {
    "path": "web/packages/broker/src/peers/PeerAppLifeCycleManager.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppLifeCycleManager } from '../lifecycle/AppLifeCycleManager';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { ApplicationConnection } from '../lifecycle/ApplicationConnection';\nimport { Cache, InMemoryCache, Logger, LoggerFactory, CacheEntry } from '@plexus-interop/common';\nimport { ApplicationDescriptor } from '../lifecycle/ApplicationDescriptor';\nimport { PeerProxyConnection } from '../peers/PeerProxyConnection';\nimport { PeerConnectionsService } from './PeerConnectionsService';\nimport { AppConnectionHeartBit } from './events/AppConnectionHeartBit';\nimport { AppRegistryService } from '@plexus-interop/metadata';\nimport { AppLauncherRegistry } from '../launcher/AppLauncherRegistry';\nimport { CancellationToken } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { AsyncHelper } from '@plexus-interop/common';\nimport { HostTransportConnection } from './host/HostTransportConnection';\n\n/**\n * Manages one client connection and proxy connections for peer brokers\n */\nexport class PeerAppLifeCycleManager implements AppLifeCycleManager {\n\n    private readonly log: Logger = LoggerFactory.getLogger('PeerAppLifeCycleManager');\n\n    // time to wait for application to start before rejecting broker's request\n    private readonly spawnConnectionTimeout: number = 5 * 60 * 1000;\n\n    private onlineConnections: Cache = new InMemoryCache();\n\n    constructor(\n        private readonly peerConnectionsService: PeerConnectionsService,\n        private readonly appRegistryService: AppRegistryService,\n        private readonly launcherRegistry: AppLauncherRegistry,\n        private readonly heartBitPeriod: number,\n        private readonly heartBitTtl: number\n    ) {\n        this.subscribeToHeartBits();\n    }\n\n    public async acceptConnection(connection: TransportConnection, appDescriptor: ApplicationDescriptor, connectionDropped: (connection: ApplicationConnection) => void): Promise<ApplicationConnection> {\n        const connectionId = connection.uuid();\n        const connectionStrId = connectionId.toString();\n        const { applicationId, instanceId } = appDescriptor;\n        const appConnection: ApplicationConnection = {\n            descriptor: {\n                connectionId,\n                applicationId,\n                instanceId\n            },\n            connection\n        };\n        if ((connection as PeerProxyConnection).isProxy) {\n            this.log.debug(`Accepted proxy [${connectionStrId}] connection`);\n            const connectionCacheEntry = new CacheEntry(appConnection, this.heartBitTtl, () => this.handleDroppedConnection(appConnection, connectionDropped));\n            this.onlineConnections.set(connectionStrId, connectionCacheEntry);\n        } else if ((connection as HostTransportConnection).onDisconnect) {\n            this.log.debug(`Accepted host [${connectionStrId}] connection`);\n            this.log.debug(`Starting to send heart bits for [${connectionStrId}] with [${this.heartBitPeriod}] period`);\n            const connectionHeartBitInterval = this.sendHeartBitsFor(appConnection);\n            const hostConnection = connection as HostTransportConnection;\n            hostConnection.onDisconnect(() => {\n                this.log.debug(`Stopping heart bits for [${connectionStrId}]`);\n                clearInterval(connectionHeartBitInterval);\n            });\n            this.onlineConnections.set(connectionId.toString(), new CacheEntry(appConnection));\n        } else {\n            throw new Error('Unsupported Transport Connection Type');\n        }\n        return appConnection;\n    }\n\n    public async getOrSpawnConnection(applicationId: string, excludedInstance?: string): Promise<ApplicationConnection> {\n        return this.getOrSpawnConnectionForOneOf([applicationId], excludedInstance);\n    }\n\n    public async spawnConnection(applicationId: string): Promise<ApplicationConnection> {\n        this.log.debug(`Spawning instance for [${applicationId}] app`);\n        const app = this.appRegistryService.getApplication(applicationId);\n        this.log.debug(`App [${applicationId}] found in registry`);\n        const appLauncher = this.launcherRegistry.getAppLauncher(app.launcherId);\n        this.log.debug(`App Launcher found for [${applicationId}] app, launching ... `);\n        const cancellationToken = new CancellationToken();\n        const appLaunchResponse = await appLauncher.launch({\n            cancellationToken\n        }, {\n                appId: applicationId,\n                launchParams: app.launcherParams\n            });\n        this.log.debug(`Waiting for application [${applicationId}] id with instance id [${appLaunchResponse.appInstanceId.toString()}] to connect`);\n        try {\n            await AsyncHelper.waitFor(() => this.isInstanceConnected(appLaunchResponse.appInstanceId),\n                new CancellationToken(), this.heartBitPeriod, this.spawnConnectionTimeout);\n            const launchedAppInstanceId = appLaunchResponse.appInstanceId.toString();\n            this.log.debug(`App [${applicationId}] id, instance id [${launchedAppInstanceId}] is connected`);\n            return this.getOnlineConnectionsInternal()\n                .find(appConnection => appConnection.descriptor.instanceId === launchedAppInstanceId) as ApplicationConnection;\n        } catch (e) {\n            this.log.error(`Failed to wait for [${appLaunchResponse.appInstanceId.toString()}] instance to start`, e);\n            cancellationToken.cancel(`Time out ${this.spawnConnectionTimeout} passed`);\n            throw e;\n        }\n    }\n\n    public async getOrSpawnConnectionForOneOf(applicationIds: string[], excludedInstance?: string): Promise<ApplicationConnection> {\n        const appConnections = this.getOnlineConnectionsInternal()\n            // do not match excluded if provided\n            .filter(connection => !excludedInstance || connection.descriptor.instanceId !== excludedInstance)\n            .filter(connection => applicationIds.indexOf(connection.descriptor.applicationId) >= 0);\n        return appConnections.length > 0 ? appConnections[0] : this.spawnConnection(applicationIds[0]);\n    }\n\n    public async getOnlineConnections(): Promise<ApplicationConnection[]> {\n        return this.getOnlineConnectionsInternal();\n    }\n\n    private sendHeartBitsFor(connection: ApplicationConnection): NodeJS.Timer {\n        const heartBit: AppConnectionHeartBit = {\n            applicationId: connection.descriptor.applicationId,\n            connectionId: connection.descriptor.connectionId.toString(),\n            instanceId: connection.descriptor.instanceId\n        };\n        this.peerConnectionsService.sendHeartBit(heartBit);\n        return setInterval(() => {\n            this.peerConnectionsService.sendHeartBit(heartBit);\n        }, this.heartBitPeriod);\n    }\n\n    private subscribeToHeartBits(): void {\n        this.log.trace('Subscribing to app heartbits');\n        this.peerConnectionsService.subscribeToConnectionsHearBits({\n            next: connectionDescriptor => {\n                const connectionStrId = connectionDescriptor.connectionId;\n                if (this.onlineConnections.has(connectionStrId)) {\n                    // app still with us\n                    this.onlineConnections.resetTtl(connectionStrId);\n                }\n            }\n        });\n    }\n\n    private handleDroppedConnection(appConnection: ApplicationConnection, listener: (connection: ApplicationConnection) => void): void {\n        this.log.error(`Connection [${appConnection.descriptor.connectionId}] dropped`);\n        listener(appConnection);\n    }\n\n    private isInstanceConnected(instanceId: UniqueId): boolean {\n        return this.getOnlineConnectionsInternal()\n            .filter(appConnection => appConnection.descriptor.instanceId.toString() === instanceId.toString())\n            .length > 0;\n    }\n\n    private getOnlineConnectionsInternal(): ApplicationConnection[] {\n        return this.onlineConnections.keys()\n            .map(k => this.onlineConnections.get<ApplicationConnection>(k))\n            .filter(v => !!v)\n            .map(c => c as ApplicationConnection);\n    }\n}\n\n"
  },
  {
    "path": "web/packages/broker/src/peers/PeerConnectionsService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppConnectionHeartBit } from './events/AppConnectionHeartBit';\nimport { Subscription, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { PartialObserver } from 'rxjs/Observer';\nimport { Observable } from 'rxjs/Observable';\nimport { EventType } from './events/EventType';\nimport 'rxjs/add/operator/share';\nimport { RemoteBrokerService } from './remote/RemoteBrokerService';\n\nexport class PeerConnectionsService {\n\n    private readonly log: Logger = LoggerFactory.getLogger('PeerConnectionService');\n\n    private $heartbits: Observable<AppConnectionHeartBit>;\n\n    constructor(private remoteBrokerService: RemoteBrokerService) {\n        this.init();\n    }\n\n    public subscribeToConnectionsHearBits(observer: PartialObserver<AppConnectionHeartBit>): Subscription {\n        return this.$heartbits.subscribe(observer);\n    }\n\n    public sendHeartBit(heartBit: AppConnectionHeartBit): void {\n        this.remoteBrokerService.publish<AppConnectionHeartBit>(EventType.AppConnectionHearBit, heartBit);\n    }\n\n    private init(): void {\n        this.$heartbits = new Observable<AppConnectionHeartBit>(observer => {\n            this.log.debug('Subscribing to app heartbits');\n            const sourceSubscription = this.remoteBrokerService.subscribe(EventType.AppConnectionHearBit, observer);\n            return () => {\n                this.log.debug('Unsubscribing from app hearbits');\n                sourceSubscription.unsubscribe();\n            };\n        })\n            // important, make observable shared between multiple subscriptions\n            .share();\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/PeerProxyConnection.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection, TransportChannel, UniqueId, Defaults, BufferedObserver } from '@plexus-interop/transport-common';\nimport { Observer, Logger, LoggerFactory, Subscription, AnonymousSubscription } from '@plexus-interop/common';\nimport { clientProtocol } from '@plexus-interop/protocol';\nimport { ApplicationConnectionDescriptor } from '../lifecycle/ApplicationConnectionDescriptor';\nimport { ProxyAuthenticationHandler } from './ProxyAuthenticationHandler';\nimport { RemoteActions } from './actions/RemoteActions';\nimport { PeerProxyTransportChannel } from './PeerProxyTransportChannel';\nimport { RemoteBrokerService } from './remote/RemoteBrokerService';\n\nexport class PeerProxyConnection implements TransportConnection {\n\n    private readonly incomingChannelsObserver: BufferedObserver<TransportChannel>;\n\n    private readonly remoteConnectionId: string;\n\n    private readonly log: Logger;\n\n    public readonly isProxy: boolean = true;\n\n    constructor(\n        private hostConnectionId: string,\n        private readonly connectionDescriptor: ApplicationConnectionDescriptor,\n        private readonly remoteBrokerService: RemoteBrokerService) {\n        this.remoteConnectionId = connectionDescriptor.connectionId.toString();\n        this.log = LoggerFactory.getLogger(`PeerProxyConnection [${connectionDescriptor.connectionId.toString()}]`);\n        this.incomingChannelsObserver = new BufferedObserver<TransportChannel>(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n        this.incomingChannelsObserver.next(new ProxyAuthenticationHandler(connectionDescriptor));\n    }\n\n    public async connect(channelObserver: Observer<TransportChannel>): Promise<void> {\n        this.log.debug(`Broker subscribed to channels via connect`);\n        this.incomingChannelsObserver.setObserver(channelObserver);\n    }\n\n    public subscribeToChannels(channelObserver: Observer<TransportChannel>): Subscription {\n        this.log.debug(`Broker subscribed to channels via subscibe`);\n        this.incomingChannelsObserver.setObserver(channelObserver);\n        return new AnonymousSubscription();\n    }\n\n    public uuid(): UniqueId {\n        return this.connectionDescriptor.connectionId;\n    }\n\n    public getManagedChannel(): TransportChannel | undefined {\n        throw 'getManagedChannel Not implemented';\n    }\n\n    public getManagedChannels(): TransportChannel[] {\n        throw 'getManagedChannels Not implemented';\n    }\n\n    public isConnected(): boolean {\n        this.log.trace('isConnected called');\n        return true;\n    }\n\n    public async disconnect(completion?: clientProtocol.ICompletion): Promise<void> {\n        this.log.info('Disconnect called', completion);\n    }\n\n    public async createChannel(): Promise<TransportChannel> {\n        this.log.debug('Received create channel request');\n        const response = await this.remoteBrokerService.invokeUnary(RemoteActions.CREATE_CHANNEL, {}, this.remoteConnectionId);\n        return new PeerProxyTransportChannel(response.id, this.remoteConnectionId, this.remoteBrokerService);\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/PeerProxyTransportChannel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportChannel, ChannelObserver } from '@plexus-interop/transport-common';\nimport { clientProtocol as plexus, UniqueId, SuccessCompletion, ErrorCompletion, ClientError } from '@plexus-interop/protocol';\nimport { AnonymousSubscription, Logger, LoggerFactory, arrayBufferToString, stringToArrayBuffer } from '@plexus-interop/common';\nimport { RemoteActions } from './actions/RemoteActions';\nimport { RemoteBrokerService } from './remote/RemoteBrokerService';\n\nexport class PeerProxyTransportChannel implements TransportChannel {\n\n    private readonly log: Logger;\n\n    private readonly channelId: UniqueId;\n\n    public constructor(\n        private strChannelId: string,\n        private remoteConnectionId: string,\n        private remoteBrokerService: RemoteBrokerService) {\n        this.channelId = UniqueId.fromString(strChannelId);\n        this.log = LoggerFactory.getLogger(`PeerProxyTransportChannel [${strChannelId}]`);\n        this.log.debug('Created');\n    }\n\n    public uuid(): UniqueId {\n        return this.channelId;\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.log.trace(`Sending message of ${data.byteLength} bytes`);\n        await this.remoteBrokerService.invokeUnary(RemoteActions.SEND_MESSAGE, {\n            channelId: this.strChannelId,\n            messagePayload: arrayBufferToString(data)\n        }, this.remoteConnectionId);\n    }\n\n    public sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion> {\n        this.sendMessage(data);\n        return this.close();\n    }\n\n    public open(observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.trace('Received open channel request');\n        this.remoteBrokerService.invoke(RemoteActions.OPEN_CHANNEL, {\n            channelId: this.strChannelId\n        }, this.remoteConnectionId, {\n                next: payload => {\n                    const abPayload = stringToArrayBuffer(payload);\n                    this.log.trace(`Received payload from remote, ${abPayload.byteLength} bytes`);\n                    observer.next(abPayload);\n                },\n                error: e => {\n                    this.log.error('Received remote error', e);\n                    observer.error(e);\n                },\n                complete: completion => {\n                    this.log.trace('Received remote completion');\n                    observer.complete(completion);\n                }\n            });\n    }\n\n    public async close(completion: plexus.ICompletion = new SuccessCompletion()): Promise<plexus.ICompletion> {\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Sending channel close ${JSON.stringify(completion)} bytes`);\n        }\n        try {\n            const response = await this.remoteBrokerService.invokeUnary(RemoteActions.CLOSE_CHANNEL, {\n                channelId: this.strChannelId,\n                completion\n            }, this.remoteConnectionId);\n            return response.completion;\n        } catch (error) {\n            this.log.error('Error on close received', error);\n            return new ErrorCompletion(new ClientError(error));\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/PeerServerConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer, Subscription, Logger, LoggerFactory, AnonymousSubscription } from '@plexus-interop/common';\nimport { TransportConnection, UniqueId, ServerConnectionFactory, BufferedObserver } from '@plexus-interop/transport-common';\nimport { AppConnectionHeartBit } from '../peers/events/AppConnectionHeartBit';\nimport { PeerConnectionsService } from '../peers/PeerConnectionsService';\nimport { ApplicationConnectionDescriptor } from '../lifecycle/ApplicationConnectionDescriptor';\nimport { PeerProxyConnection } from '../peers/PeerProxyConnection';\nimport { RemoteBrokerService } from './remote/RemoteBrokerService';\n\nexport class PeerServerConnectionFactory implements ServerConnectionFactory {\n\n    private readonly log: Logger;\n\n    private readonly processedConnections: Set<string> = new Set();\n\n    private readonly connectionsObserver: BufferedObserver<TransportConnection>;\n\n    constructor(\n        private readonly hostConnectionGuid: string,\n        private readonly peerConnectionsService: PeerConnectionsService,\n        private readonly remoteBrokerService: RemoteBrokerService) {\n        this.log = LoggerFactory.getLogger('PeerServerConnectionFactory');\n        this.connectionsObserver = new BufferedObserver(100, this.log);\n        this.listenForPeerConnections();\n    }\n\n    public acceptConnections(connectionsObserver: Observer<TransportConnection>): Subscription {\n        this.connectionsObserver.setObserver(connectionsObserver);\n        return new AnonymousSubscription();\n    }\n\n    private listenForPeerConnections(): void {\n        this.log.debug('Starting to listen for connections');\n        this.peerConnectionsService.subscribeToConnectionsHearBits({\n            next: (connectionDescriptor: AppConnectionHeartBit) => {\n                // create proxy connection only once\n                if (!this.processedConnections.has(connectionDescriptor.connectionId)\n                    && connectionDescriptor.connectionId !== this.hostConnectionGuid) {\n                    this.log.debug(`Detected new connection, app id ${connectionDescriptor.applicationId} [${connectionDescriptor.connectionId}]`);\n                    this.processedConnections.add(connectionDescriptor.connectionId);\n                    const appConnectionDescriptor: ApplicationConnectionDescriptor = {\n                        applicationId: connectionDescriptor.applicationId,\n                        instanceId: connectionDescriptor.instanceId,\n                        connectionId: UniqueId.fromString(connectionDescriptor.connectionId)\n                    };\n                    this.connectionsObserver.next(new PeerProxyConnection(connectionDescriptor.connectionId, appConnectionDescriptor, this.remoteBrokerService));\n                }\n            }\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/ProxyAuthenticationHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportChannel, ChannelObserver } from '@plexus-interop/transport-common';\nimport { clientProtocol as plexus, UniqueId, ClientProtocolHelper, SuccessCompletion } from '@plexus-interop/protocol';\nimport { AnonymousSubscription, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { ApplicationConnectionDescriptor } from '../lifecycle/ApplicationConnectionDescriptor';\n\n/**\n * Providing connectivity details about proxy connection to locally running Broker\n */\nexport class ProxyAuthenticationHandler implements TransportChannel {\n\n    private readonly log: Logger;\n\n    constructor(\n        private readonly connectionDescriptor: ApplicationConnectionDescriptor,\n        private readonly id: UniqueId = UniqueId.generateNew()) {\n        this.log = LoggerFactory.getLogger(`ProxyAuthenticationHandler [${this.id.toString()}]`);\n    }\n\n    public sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion> {\n        this.sendMessage(data);\n        return this.close(new SuccessCompletion());\n    }\n\n    public async close(completion?: plexus.ICompletion): Promise<plexus.ICompletion> {\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Received completion from broker, ${JSON.stringify(completion)}`);\n        }\n        return new SuccessCompletion();\n    }\n\n    public open(observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.trace(`Received subscribe, sending connect payload`);\n        observer.started(new AnonymousSubscription());\n        observer.next(ClientProtocolHelper.connectRequestPayload({\n            applicationId: this.connectionDescriptor.applicationId,\n            applicationInstanceId: UniqueId.fromString(this.connectionDescriptor.instanceId)\n        }));\n        observer.complete();\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.log.debug(`Received message of ${data.byteLength} bytes`);\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/StreamingInvocationClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface StreamingInvocationClient<T> {\n\n    next(value: T): Promise<void>;\n\n    complete(): Promise<void>;\n\n    error(e: any): void;\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/ChannelRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ChannelRequest {\n\n    channelId: string;\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/CloseChannelRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChannelRequest } from './ChannelRequest';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface CloseChannelRequest extends ChannelRequest {\n    completion: plexus.ICompletion;\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/CloseChannelResponse.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface CloseChannelResponse {\n    completion: plexus.ICompletion;\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/CreateChannelResponse.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface CreateChannelResponse {\n    id: string;\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/RemoteActions.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ActionType } from '../ActionType';\nimport { CreateChannelResponse } from './CreateChannelResponse';\nimport { SendMessageRequest } from './SendMessageRequest';\nimport { CloseChannelRequest } from './CloseChannelRequest';\nimport { CloseChannelResponse } from './CloseChannelResponse';\nimport { ChannelRequest } from './ChannelRequest';\n\nexport class RemoteActions {\n\n    public static readonly CREATE_CHANNEL: ActionType<{}, CreateChannelResponse> = { id: 'CREATE_CHANNEL' };\n\n    public static readonly SEND_MESSAGE: ActionType<SendMessageRequest, {}> = { id: 'SEND_MESSAGE' };\n\n    public static readonly CLOSE_CHANNEL: ActionType<CloseChannelRequest, CloseChannelResponse> = { id: 'CLOSE_CHANNEL' };\n\n    public static readonly OPEN_CHANNEL: ActionType<ChannelRequest, string> = { id: 'OPEN_CHANNEL' };\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/actions/SendMessageRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface SendMessageRequest {\n    channelId: string;\n    messagePayload: string;\n}"
  },
  {
    "path": "web/packages/broker/src/peers/events/AppConnectionHeartBit.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ApplicationDescriptor } from '../../lifecycle/ApplicationDescriptor';\n\nexport interface AppConnectionHeartBit extends ApplicationDescriptor {\n    connectionId: string;\n} "
  },
  {
    "path": "web/packages/broker/src/peers/events/EventType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppConnectionHeartBit } from './AppConnectionHeartBit';\n\nexport class EventType<PayloadType> {\n    \n    // tslint:disable-next-line:variable-name\n    public static readonly AppConnectionHearBit: EventType<AppConnectionHeartBit> = new EventType<AppConnectionHeartBit>('AppConnection');\n\n    constructor(public readonly id: string) {}\n    \n}"
  },
  {
    "path": "web/packages/broker/src/peers/host/HostConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection, ServerConnectionFactory } from '@plexus-interop/transport-common';\nimport { Subscription, Observer } from '@plexus-interop/common';\nimport { HostTransportConnection } from './HostTransportConnection';\nimport { RemoteBrokerService } from '../../peers/remote/RemoteBrokerService';\n\nexport class HostConnectionFactory implements ServerConnectionFactory {\n\n    public constructor(\n        private readonly baseFactory: ServerConnectionFactory,\n        private readonly remoteBrokerService: RemoteBrokerService\n    ) { }\n\n    public acceptConnections(connectionsObserver: Observer<TransportConnection>): Subscription {\n        return this.baseFactory.acceptConnections({\n            next: c => connectionsObserver.next(new HostTransportConnection(c, this.remoteBrokerService)),\n            complete: () => connectionsObserver.complete(),\n            error: e => connectionsObserver.error(e)\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/host/HostTransportConnection.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection, TransportChannel } from '@plexus-interop/transport-common';\nimport { Observer, Logger, LoggerFactory, Subscription, stringToArrayBuffer, arrayBufferToString } from '@plexus-interop/common';\nimport { UniqueId, clientProtocol } from '@plexus-interop/protocol';\nimport { RemoteBrokerService } from '../remote/RemoteBrokerService';\nimport { RemoteActions } from '../actions/RemoteActions';\nimport { CreateChannelResponse } from '../actions/CreateChannelResponse';\nimport { Observable } from 'rxjs/Observable';\nimport { ChannelRequest } from '../actions/ChannelRequest';\nimport { SendMessageRequest } from '../actions/SendMessageRequest';\nimport { CloseChannelRequest } from '../actions/CloseChannelRequest';\nimport { CloseChannelResponse } from '../actions/CloseChannelResponse';\nimport { Types } from '../../util/Types';\n\nexport type DisconnectListener = (completion?: clientProtocol.ICompletion) => void;\n\nexport class HostTransportConnection implements TransportConnection {\n\n    private readonly disconnectListeners: DisconnectListener[] = [];\n\n    private readonly stringUuid: string;\n\n    private readonly log: Logger;\n\n    public constructor(\n        private readonly baseConnection: TransportConnection,\n        private readonly remoteBrokerService: RemoteBrokerService) {\n        this.stringUuid = this.uuid().toString();\n        this.log = LoggerFactory.getLogger(`HostTransportConnection [${this.stringUuid}]`);\n        this.bindToRemoteActions();\n    }\n\n    public connect(channelObserver: Observer<TransportChannel>): Promise<void> {\n        return this.baseConnection.connect(channelObserver);\n    }\n\n    public subscribeToChannels(channelObserver: Observer<TransportChannel>): Subscription {\n        return this.baseConnection.subscribeToChannels(channelObserver);\n    }\n\n    public isConnected(): boolean {\n        return this.baseConnection.isConnected();\n    }\n\n    public uuid(): UniqueId {\n        return this.baseConnection.uuid();\n    }\n\n    public getManagedChannels(): TransportChannel[] {\n        return this.baseConnection.getManagedChannels();\n    }\n\n    public getManagedChannel(id: string): TransportChannel | undefined {\n        return this.baseConnection.getManagedChannel(id);\n    }\n\n    public onDisconnect(disconnectListener: DisconnectListener): void {\n        this.disconnectListeners.push(disconnectListener);\n    }\n\n    public disconnect(completion?: clientProtocol.ICompletion): Promise<void> {\n        this.log.trace('Disconnect requested, passing to listeners');\n        this.disconnectListeners.forEach(l => l(completion));\n        this.log.trace('Disconnecting from base connection');\n        return this.baseConnection.disconnect(completion);\n    }\n\n    public createChannel(): Promise<TransportChannel> {\n        return this.baseConnection.createChannel();\n    }\n\n    private bindToRemoteActions(): void {\n\n        this.log.info('Binding to remote actions');\n\n        this.remoteBrokerService.host<{}, CreateChannelResponse>(RemoteActions.CREATE_CHANNEL, (request, responseObserver) => {\n            return new Observable(observer => {\n                this.log.trace('Create channel request received');\n                this.createChannel()\n                    .then(channel => {\n                        observer.next({ id: channel.uuid().toString() });\n                        observer.complete();\n                    })\n                    .catch(e => observer.error(Types.toClientError(e)));\n            }).subscribe(responseObserver);\n        }, this.stringUuid);\n\n        this.remoteBrokerService.host<ChannelRequest, string>(RemoteActions.OPEN_CHANNEL, (request: ChannelRequest, responseObserver) => {\n            const channel = this.getManagedChannel(request.channelId);\n            this.log.trace(`Open Channel [${request.channelId}] request received`);\n            if (channel) {\n                channel.open({\n                    started: () => { },\n                    startFailed: e => responseObserver.error(e),\n                    next: msg => responseObserver.next(arrayBufferToString(msg)),\n                    complete: completion => responseObserver.complete(completion),\n                    error: e => responseObserver.error(Types.toClientError(e))\n                });\n            } else {\n                responseObserver.error(`No channel with id [${request.channelId}]`);\n            }\n            return {\n                unsubscribe: () => { }\n            };\n        }, this.stringUuid);\n\n        this.remoteBrokerService.host<SendMessageRequest, {}>(RemoteActions.SEND_MESSAGE, (request: SendMessageRequest, responseObserver) => {\n            return new Observable(observer => {\n                if (this.log.isTraceEnabled()) {\n                    this.log.trace(`Send Message of [${request.messagePayload.length}] length for [${request.channelId}] channel received`);\n                }\n                const channel = this.getManagedChannel(request.channelId);\n                if (channel) {\n                    channel.sendMessage(stringToArrayBuffer(request.messagePayload))\n                        .then(() => observer.complete())\n                        .catch(e => observer.error(Types.toClientError(e)));\n                } else {\n                    observer.error(`No channel with id [${request.channelId}]`);\n                }\n            }).subscribe(responseObserver);\n        }, this.stringUuid);\n\n        this.remoteBrokerService.host<CloseChannelRequest, CloseChannelResponse>(RemoteActions.CLOSE_CHANNEL, (request: CloseChannelRequest, responseObserver) => {\n            return new Observable(observer => {\n                this.log.trace(`Close channel [${request.channelId}] received`);\n                const channel = this.getManagedChannel(request.channelId);\n                if (channel) {\n                    channel.close(request.completion)\n                        .then(completion => {\n                            observer.next({ completion });\n                            observer.complete();\n                        })\n                        .catch(e => observer.error(Types.toClientError(e)));\n                } else {\n                    observer.error(`No channel with id [${request.channelId}]`);\n                }\n            }).subscribe(responseObserver);\n\n        }, this.stringUuid);\n\n    }\n}"
  },
  {
    "path": "web/packages/broker/src/peers/remote/EventBasedRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface EventBasedRequest {\n    senderId: string;\n    requestId: string;\n    payload: any;\n}"
  },
  {
    "path": "web/packages/broker/src/peers/remote/EventBusRemoteBrokerService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventBus } from '../../bus/EventBus';\nimport { ActionType } from '../../peers/ActionType';\nimport { EventType } from '../events/EventType';\nimport { Subscription, Observer, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { RemoteBrokerService } from './RemoteBrokerService';\nimport { Observable } from 'rxjs/Observable';\nimport { RemoteActionResult, isFailed, isCompleted, successResult, errorResult, completedResult } from './RemoteActionResult';\nimport { EventBasedRequest } from './EventBasedRequest';\nimport { PlexusPartialObserver, PlexusObserver } from '@plexus-interop/transport-common';\n\nexport class EventBusRemoteBrokerService implements RemoteBrokerService {\n\n    private requestCounter: number = 0;\n\n    private readonly log: Logger;\n\n    public constructor(private readonly eventBus: EventBus, private readonly id: string) {\n        this.log = LoggerFactory.getLogger(`EventBusRemoteBrokerService [${id}]`);\n    }\n\n    public invokeUnary<Req, Res>(actionType: ActionType<Req, Res>, requestPayload: Req, remoteBrokerId: string): Promise<Res> {\n        return new Promise((resolve, reject) => {\n            let res: Res | null = null;\n            this.invoke(actionType, requestPayload, remoteBrokerId, {\n                next: update => {\n                    res = update;\n                },\n                complete: () => {\n                    if (!res) {\n                        this.log.trace(`[${actionType.id}] - No response, resolve with empty object`);\n                    }\n                    resolve(res || {} as Res);\n                },\n                error: e => reject(e)\n            });\n        });\n    }\n\n    public host<Req, Res>(actionType: ActionType<Req, Res>, handler: (requestPaylaod: Req, observer: PlexusObserver<Res>) => Subscription, hostId: string): void {\n\n        const requestTopic = this.requestTopic(hostId, actionType);\n\n        this.eventBus.subscribe(requestTopic, event => {\n            const requestEvent = event.payload as EventBasedRequest;\n            const senderId = requestEvent.senderId;\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Received [${actionType.id}.${requestEvent.requestId}] request from [${senderId}]`);\n            }\n            const responseTopic = this.responseUpdateTopic(senderId, actionType, requestEvent.requestId);\n            handler(requestEvent.payload, {\n                next: update => {\n                    this.eventBus.publish(responseTopic, { payload: successResult(update) });\n                },\n                error: e => {\n                    this.eventBus.publish(responseTopic, { payload: errorResult(e) });\n                },\n                complete: completion => {\n                    this.eventBus.publish(responseTopic, { payload: completedResult({ completion }) });\n                }\n            });\n        });\n\n    }\n\n    public invoke<Req, Res>(actionType: ActionType<Req, Res>, requestPayload: Req, remoteBrokerId: string, observer: PlexusObserver<Res>): Subscription {\n\n        this.log.trace(`Sending invocation ${actionType.id} to ${remoteBrokerId}`);\n\n        const requestId = this.newRequestId();\n        const requestTopic = this.requestTopic(remoteBrokerId, actionType);\n        const responseTopic = this.responseHandlingTopic(remoteBrokerId, actionType, requestId);\n\n        const subscription = this.eventBus.subscribe(responseTopic, (event) => {\n            this.log.trace(`Received update for ${responseTopic}`);\n            const invocationResult = event.payload as RemoteActionResult;\n            if (isFailed(invocationResult)) {\n                subscription.unsubscribe();\n                observer.error(invocationResult.error);\n            } else if (isCompleted(invocationResult)) {\n                subscription.unsubscribe();\n                observer.complete(invocationResult.completion);\n            } else {\n                observer.next(invocationResult.payload);\n            }\n        });\n\n        this.log.trace(`Sending request to ${requestTopic}`);\n        const payload: EventBasedRequest = {\n            payload: requestPayload,\n            requestId: requestId.toString(),\n            senderId: this.id\n        };\n\n        this.eventBus.publish(requestTopic, {\n            payload\n        });\n\n        return subscription;\n\n    }\n\n    public publish<T>(eventType: EventType<T>, payload: T, remoteBrokerId?: string): void {\n        const requestTopic = this.eventTopic(eventType, remoteBrokerId);\n        this.log.trace(`Publishing to ${requestTopic}`);\n        this.eventBus.publish(requestTopic, {\n            payload\n        });\n    }\n\n    public subscribe<T>(eventType: EventType<T>, observer: PlexusPartialObserver<T>, remoteBrokerId?: string): Subscription {\n        const requestTopic = this.eventTopic(eventType, remoteBrokerId);\n        this.log.trace(`Subscribing to ${requestTopic}`);\n        return new Observable((observer: Observer<T>) => {\n            this.eventBus.subscribe(requestTopic, event => {\n                observer.next(event.payload);\n            });\n        }).subscribe(observer);\n    }\n\n    private responseHandlingTopic(remoteId: string, actionType: ActionType<any, any>, requestId: number | string): string {\n        return `res.${requestId}.${actionType.id}.${remoteId}.${this.id}`;\n    }\n\n    private responseUpdateTopic(remoteId: string, actionType: ActionType<any, any>, requestId: number | string): string {\n        return `res.${requestId}.${actionType.id}.${this.id}.${remoteId}`;\n    }\n\n    private eventTopic(eventType: EventType<any>, remoteId?: string): string {\n        return `event.${eventType.id}${remoteId ? '.' + remoteId : ''}`;\n    }\n\n    private requestTopic(remoteId: string, actionType: ActionType<any, any>): string {\n        return `req.${actionType.id}.${remoteId}`;\n    }\n\n    private newRequestId(): number {\n        return this.requestCounter++;\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/src/peers/remote/RemoteActionResult.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RemoteActionStatus } from './RemoteActionStatus';\nimport { ClientError } from '@plexus-interop/protocol';\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface RemoteActionResult {\n\n    status: RemoteActionStatus;\n\n    payload?: any;\n\n    error?: ClientError;\n\n    completion?: plexus.ICompletion;\n\n}\n\nexport function isFailed(result: RemoteActionResult): boolean {\n    return result.status === RemoteActionStatus.FAILURE;\n}\n\nexport function isSucceded(result: RemoteActionResult): boolean {\n    return result.status === RemoteActionStatus.SUCCESS;\n}\n\nexport function isCompleted(result: RemoteActionResult): boolean {\n    return result.status === RemoteActionStatus.COMPLETED;\n}\n\nexport function successResult(payload: any): RemoteActionResult {\n    return {\n        status: RemoteActionStatus.SUCCESS,\n        payload\n    };\n}\n\nexport function completedResult(completed: { payload?: any, completion?: plexus.ICompletion } = {}): RemoteActionResult {\n    return {\n        status: RemoteActionStatus.COMPLETED,\n        payload: completed.payload,\n        completion: completed.completion\n    };\n}\n\nexport function errorResult(error?: ClientError): RemoteActionResult {\n    return {\n        error,\n        status: RemoteActionStatus.FAILURE\n    };\n}"
  },
  {
    "path": "web/packages/broker/src/peers/remote/RemoteActionStatus.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum RemoteActionStatus {\n    SUCCESS = 'SUCCESS',\n    COMPLETED = 'COMPLETED',\n    FAILURE = 'FAILURE'\n}"
  },
  {
    "path": "web/packages/broker/src/peers/remote/RemoteBrokerService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ActionType } from '../ActionType';\nimport { EventType } from '../events/EventType';\nimport { Subscription } from '@plexus-interop/common';\nimport { PlexusObserver } from '@plexus-interop/transport-common';\n\n/**\n * All action calls passed from Proxy Channels/Connections to remote connection\n */\nexport interface RemoteBrokerService {\n\n    subscribe<T>(eventType: EventType<T>, observer: PlexusObserver<T>): Subscription;\n\n    publish<T>(eventType: EventType<T>, payload: T, remoteBrokerId?: string): void;\n\n    invokeUnary<Req, Res>(actionType: ActionType<Req, Res>, requestPayload: Req, remoteBrokerId: string): Promise<Res>;\n\n    invoke<Req, Res>(actionType: ActionType<Req, Res>, requestPaylaod: Req, remoteBrokerId: string, observer: PlexusObserver<Res>): Subscription;\n\n    host<Req, Res>(actionType: ActionType<Req, Res>, handler: (requestPaylaod: Req, observer: PlexusObserver<Res>) => Subscription, hostId: string): void;\n\n}"
  },
  {
    "path": "web/packages/broker/src/storage/Storage.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Storage {\n\n    get(key: string): Promise<void>;\n\n    set(key: string, payload: any): Promise<void>;\n\n}\n\n"
  },
  {
    "path": "web/packages/broker/src/transport/MultiSourcesServerConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ServerConnectionFactory, TransportConnection } from '@plexus-interop/transport-common';\nimport { Observer, Subscription, AnonymousSubscription } from '@plexus-interop/common';\n\nexport class MultiSourcesServerConnectionFactory implements ServerConnectionFactory {\n\n    private readonly sources: ServerConnectionFactory[];\n\n    constructor(...sources: ServerConnectionFactory[]) {\n        this.sources = sources;\n    }\n\n    public acceptConnections(connectionsObserver: Observer<TransportConnection>): Subscription {\n        const subscriptions: Subscription[] = [];\n        this.sources.forEach(s => subscriptions.push(s.acceptConnections(connectionsObserver)));\n        return new AnonymousSubscription(() => {\n            subscriptions.forEach(s => s.unsubscribe());\n        });\n    }\n}"
  },
  {
    "path": "web/packages/broker/src/util/Types.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observable } from 'rxjs/Observable';\nimport { isString } from '@plexus-interop/common';\nimport { ProvidedMethodReference } from '@plexus-interop/metadata';\nimport { ConsumedMethodReference } from '@plexus-interop/metadata';\nimport { ClientError } from '@plexus-interop/protocol';\n\nexport class Types {\n\n    public static isObservable<T>(obj: any): obj is Observable<T> {\n        return (obj as Observable<T>).subscribe !== undefined;\n    }\n\n    public static isConsumedMethodReference(methodReference: ConsumedMethodReference | ProvidedMethodReference): methodReference is ConsumedMethodReference {\n        return !!(methodReference as ConsumedMethodReference).consumedService;\n    }\n\n    public static isError(value: any): value is Error {\n        return value && value.stack && value.message;\n    }\n\n    public static toClientError(e: any): ClientError {\n        if (Types.isError(e)) {\n            return new ClientError(e.message, e.stack);\n        } else if (isString(e)) {\n            return new ClientError(e);\n        } else if (e.message && e.details) {\n            return new ClientError(e.message, e.details);\n        } else {\n            e = new Error('Unknown error received');\n            return Types.toClientError(e);\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/broker/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\",\n            \"jstorage\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/broker/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/gen-client.cmd",
    "content": "java -jar ../../../bin/win-x86/sdk/plexusgen.jar --type=ts --baseDir=../../../samples/quick-start/registry --input=web_ccy_pair_rate_provider.interop --out=./src/gen --protoc=./node_modules/.bin/pbts.cmd"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/ccy-pair-rate-provider\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Quick start Rate Provider App\",\n  \"main\": \"index.js\",\n  \"private\": true,\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"protobufjs\": \"6.11.3\"\n  },\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"compile\": \"tsc -p tsconfig.json\",\n    \"copy-assets\": \"copyfiles src/gen/* dist/main && copyfiles -f src/views/* dist\",\n    \"package\": \"browserify ./dist/main/src/index.js --outfile ./dist/app.bundle.js\",\n    \"build\": \"npm run compile && npm run copy-assets && npm run package\",\n    \"postbuild\": \"copyfiles ./dist/* -f ../../../bin/win-x86/samples/quick-start/apps/WebCcyPairRateProvider\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@types/node\": \"^7.0.5\",\n    \"browserify\": \"^14.5.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"electron\": \"1.8.8\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"typescript\": \"3.7.2\"\n  }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/RateService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as plexus from './gen/plexus-messages';\n\nexport class RateService {\n    \n    public getRate(ccyPair: string): plexus.fx.ICcyPairRate {\n         switch (ccyPair)  {\n            case 'EURUSD':\n                return {\n                    ccyPairName: ccyPair,\n                    rate: parseFloat((1.15 + 0.1 * Math.random()).toFixed(3))\n                };\n            case 'EURGBP':\n                return {\n                    ccyPairName: ccyPair,\n                    rate: parseFloat((0.87 + 0.1 * Math.random()).toFixed(3))\n                };\n            default:\n                throw new Error(`Unsupported CCY Pair name ${ccyPair}`);\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/gen/WebCcyPairRateProviderGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from \"@plexus-interop/client\";\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from \"@plexus-interop/client\";\nimport { TransportConnection, UniqueId } from \"@plexus-interop/transport-common\";\nimport { Arrays, Observer } from \"@plexus-interop/common\";\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from \"@plexus-interop/client\";\n\nimport * as plexus from \"./plexus-messages\";\n\n\n\n/**\n * Main client API\n */\nexport interface WebCcyPairRateProviderClient extends GenericClientApi  {\n\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass WebCcyPairRateProviderClientImpl extends GenericClientApiBase implements WebCcyPairRateProviderClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n    ) {\n        super(genericClient);\n    }\n\n\n}\n\n/**\n * Client invocation handler for CcyPairRateService, to be implemented by Client\n */\nexport abstract class CcyPairRateServiceInvocationHandler {\n\n    public abstract onGetRate(invocationContext: MethodInvocationContext, request: plexus.fx.ICcyPair): Promise<plexus.fx.ICcyPairRate>;\n}\n\n/**\n * Client API builder\n */\nexport class WebCcyPairRateProviderClientBuilder {\n\n    private clientDetails: ClientConnectRequest = {\n        applicationId: \"vendor_a.fx.WebCcyPairRateProvider\"\n    };\n\n    private transportConnectionProvider: () => Promise<TransportConnection>;\n\n    private ccyPairRateServiceHandler: CcyPairRateServiceInvocationHandler;\n\n    public withClientDetails(clientId: ClientConnectRequest): WebCcyPairRateProviderClientBuilder {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): WebCcyPairRateProviderClientBuilder {\n        this.clientDetails.applicationInstanceId = appInstanceId;\n        return this;\n    }\n\n    public withAppId(appId: string): WebCcyPairRateProviderClientBuilder {\n        this.clientDetails.applicationId = appId;\n        return this;\n    }\n\n    public withCcyPairRateServiceInvocationsHandler(invocationsHandler: CcyPairRateServiceInvocationHandler): WebCcyPairRateProviderClientBuilder {\n        this.ccyPairRateServiceHandler = invocationsHandler;\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): WebCcyPairRateProviderClientBuilder {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    public connect(): Promise<WebCcyPairRateProviderClient> {\n        return new ContainerAwareClientAPIBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            .withTypeAwareUnaryHandler({\n                serviceInfo: {\n                    serviceId: \"fx.CcyPairRateService\"\n                },\n                methodId: \"GetRate\",\n                handle: this.ccyPairRateServiceHandler.onGetRate.bind(this.ccyPairRateServiceHandler)\n            }, plexus.fx.CcyPair, plexus.fx.CcyPairRate)\n            .connect()\n            .then((genericClient: GenericClientApi) => new WebCcyPairRateProviderClientImpl(\n                genericClient\n));\n    }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/gen/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from 'protobufjs';\n\n/** Namespace fx. */\nexport namespace fx {\n\n    /** Properties of a CcyPair. */\n    interface ICcyPair {\n\n        /** CcyPair ccyPairName */\n        ccyPairName?: (string|null);\n    }\n\n    /** Represents a CcyPair. */\n    class CcyPair implements ICcyPair {\n\n        /**\n         * Constructs a new CcyPair.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: fx.ICcyPair);\n\n        /** CcyPair ccyPairName. */\n        public ccyPairName: string;\n\n        /**\n         * Creates a new CcyPair instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns CcyPair instance\n         */\n        public static create(properties?: fx.ICcyPair): fx.CcyPair;\n\n        /**\n         * Encodes the specified CcyPair message. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @param message CcyPair message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: fx.ICcyPair, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified CcyPair message, length delimited. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @param message CcyPair message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: fx.ICcyPair, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): fx.CcyPair;\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): fx.CcyPair;\n\n        /**\n         * Verifies a CcyPair message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a CcyPair message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns CcyPair\n         */\n        public static fromObject(object: { [k: string]: any }): fx.CcyPair;\n\n        /**\n         * Creates a plain object from a CcyPair message. Also converts values to other types if specified.\n         * @param message CcyPair\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: fx.CcyPair, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this CcyPair to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a CcyPairRate. */\n    interface ICcyPairRate {\n\n        /** CcyPairRate ccyPairName */\n        ccyPairName?: (string|null);\n\n        /** CcyPairRate rate */\n        rate?: (number|null);\n    }\n\n    /** Represents a CcyPairRate. */\n    class CcyPairRate implements ICcyPairRate {\n\n        /**\n         * Constructs a new CcyPairRate.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: fx.ICcyPairRate);\n\n        /** CcyPairRate ccyPairName. */\n        public ccyPairName: string;\n\n        /** CcyPairRate rate. */\n        public rate: number;\n\n        /**\n         * Creates a new CcyPairRate instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns CcyPairRate instance\n         */\n        public static create(properties?: fx.ICcyPairRate): fx.CcyPairRate;\n\n        /**\n         * Encodes the specified CcyPairRate message. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @param message CcyPairRate message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: fx.ICcyPairRate, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified CcyPairRate message, length delimited. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @param message CcyPairRate message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: fx.ICcyPairRate, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): fx.CcyPairRate;\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): fx.CcyPairRate;\n\n        /**\n         * Verifies a CcyPairRate message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a CcyPairRate message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns CcyPairRate\n         */\n        public static fromObject(object: { [k: string]: any }): fx.CcyPairRate;\n\n        /**\n         * Creates a plain object from a CcyPairRate message. Also converts values to other types if specified.\n         * @param message CcyPairRate\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: fx.CcyPairRate, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this CcyPairRate to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Represents a CcyPairRateService */\n    class CcyPairRateService extends $protobuf.rpc.Service {\n\n        /**\n         * Constructs a new CcyPairRateService service.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         */\n        constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n        /**\n         * Creates new CcyPairRateService service using the specified rpc implementation.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         * @returns RPC service. Useful where requests and/or responses are streamed.\n         */\n        public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CcyPairRateService;\n\n        /**\n         * Calls GetRate.\n         * @param request CcyPair message or plain object\n         * @param callback Node-style callback called with the error, if any, and CcyPairRate\n         */\n        public getRate(request: fx.ICcyPair, callback: fx.CcyPairRateService.GetRateCallback): void;\n\n        /**\n         * Calls GetRate.\n         * @param request CcyPair message or plain object\n         * @returns Promise\n         */\n        public getRate(request: fx.ICcyPair): Promise<fx.CcyPairRate>;\n    }\n\n    namespace CcyPairRateService {\n\n        /**\n         * Callback as used by {@link fx.CcyPairRateService#getRate}.\n         * @param error Error, if any\n         * @param [response] CcyPairRate\n         */\n        type GetRateCallback = (error: (Error|null), response?: fx.CcyPairRate) => void;\n    }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/gen/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.plexus || ($protobuf.roots.plexus = {});\n\n$root.fx = (function() {\n\n    /**\n     * Namespace fx.\n     * @exports fx\n     * @namespace\n     */\n    var fx = {};\n\n    fx.CcyPair = (function() {\n\n        /**\n         * Properties of a CcyPair.\n         * @memberof fx\n         * @interface ICcyPair\n         * @property {string|null} [ccyPairName] CcyPair ccyPairName\n         */\n\n        /**\n         * Constructs a new CcyPair.\n         * @memberof fx\n         * @classdesc Represents a CcyPair.\n         * @implements ICcyPair\n         * @constructor\n         * @param {fx.ICcyPair=} [properties] Properties to set\n         */\n        function CcyPair(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * CcyPair ccyPairName.\n         * @member {string} ccyPairName\n         * @memberof fx.CcyPair\n         * @instance\n         */\n        CcyPair.prototype.ccyPairName = \"\";\n\n        /**\n         * Creates a new CcyPair instance using the specified properties.\n         * @function create\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair=} [properties] Properties to set\n         * @returns {fx.CcyPair} CcyPair instance\n         */\n        CcyPair.create = function create(properties) {\n            return new CcyPair(properties);\n        };\n\n        /**\n         * Encodes the specified CcyPair message. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @function encode\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair} message CcyPair message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPair.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.ccyPairName);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified CcyPair message, length delimited. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair} message CcyPair message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPair.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer.\n         * @function decode\n         * @memberof fx.CcyPair\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {fx.CcyPair} CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPair.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.fx.CcyPair();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.ccyPairName = reader.string();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof fx.CcyPair\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {fx.CcyPair} CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPair.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a CcyPair message.\n         * @function verify\n         * @memberof fx.CcyPair\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        CcyPair.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                if (!$util.isString(message.ccyPairName))\n                    return \"ccyPairName: string expected\";\n            return null;\n        };\n\n        /**\n         * Creates a CcyPair message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof fx.CcyPair\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {fx.CcyPair} CcyPair\n         */\n        CcyPair.fromObject = function fromObject(object) {\n            if (object instanceof $root.fx.CcyPair)\n                return object;\n            var message = new $root.fx.CcyPair();\n            if (object.ccyPairName != null)\n                message.ccyPairName = String(object.ccyPairName);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a CcyPair message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.CcyPair} message CcyPair\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        CcyPair.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults)\n                object.ccyPairName = \"\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                object.ccyPairName = message.ccyPairName;\n            return object;\n        };\n\n        /**\n         * Converts this CcyPair to JSON.\n         * @function toJSON\n         * @memberof fx.CcyPair\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        CcyPair.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return CcyPair;\n    })();\n\n    fx.CcyPairRate = (function() {\n\n        /**\n         * Properties of a CcyPairRate.\n         * @memberof fx\n         * @interface ICcyPairRate\n         * @property {string|null} [ccyPairName] CcyPairRate ccyPairName\n         * @property {number|null} [rate] CcyPairRate rate\n         */\n\n        /**\n         * Constructs a new CcyPairRate.\n         * @memberof fx\n         * @classdesc Represents a CcyPairRate.\n         * @implements ICcyPairRate\n         * @constructor\n         * @param {fx.ICcyPairRate=} [properties] Properties to set\n         */\n        function CcyPairRate(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * CcyPairRate ccyPairName.\n         * @member {string} ccyPairName\n         * @memberof fx.CcyPairRate\n         * @instance\n         */\n        CcyPairRate.prototype.ccyPairName = \"\";\n\n        /**\n         * CcyPairRate rate.\n         * @member {number} rate\n         * @memberof fx.CcyPairRate\n         * @instance\n         */\n        CcyPairRate.prototype.rate = 0;\n\n        /**\n         * Creates a new CcyPairRate instance using the specified properties.\n         * @function create\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate=} [properties] Properties to set\n         * @returns {fx.CcyPairRate} CcyPairRate instance\n         */\n        CcyPairRate.create = function create(properties) {\n            return new CcyPairRate(properties);\n        };\n\n        /**\n         * Encodes the specified CcyPairRate message. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @function encode\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate} message CcyPairRate message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPairRate.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.ccyPairName);\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                writer.uint32(/* id 2, wireType 1 =*/17).double(message.rate);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified CcyPairRate message, length delimited. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate} message CcyPairRate message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPairRate.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer.\n         * @function decode\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {fx.CcyPairRate} CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPairRate.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.fx.CcyPairRate();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.ccyPairName = reader.string();\n                    break;\n                case 2:\n                    message.rate = reader.double();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {fx.CcyPairRate} CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPairRate.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a CcyPairRate message.\n         * @function verify\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        CcyPairRate.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                if (!$util.isString(message.ccyPairName))\n                    return \"ccyPairName: string expected\";\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                if (typeof message.rate !== \"number\")\n                    return \"rate: number expected\";\n            return null;\n        };\n\n        /**\n         * Creates a CcyPairRate message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {fx.CcyPairRate} CcyPairRate\n         */\n        CcyPairRate.fromObject = function fromObject(object) {\n            if (object instanceof $root.fx.CcyPairRate)\n                return object;\n            var message = new $root.fx.CcyPairRate();\n            if (object.ccyPairName != null)\n                message.ccyPairName = String(object.ccyPairName);\n            if (object.rate != null)\n                message.rate = Number(object.rate);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a CcyPairRate message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.CcyPairRate} message CcyPairRate\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        CcyPairRate.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.ccyPairName = \"\";\n                object.rate = 0;\n            }\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                object.ccyPairName = message.ccyPairName;\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                object.rate = options.json && !isFinite(message.rate) ? String(message.rate) : message.rate;\n            return object;\n        };\n\n        /**\n         * Converts this CcyPairRate to JSON.\n         * @function toJSON\n         * @memberof fx.CcyPairRate\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        CcyPairRate.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return CcyPairRate;\n    })();\n\n    fx.CcyPairRateService = (function() {\n\n        /**\n         * Constructs a new CcyPairRateService service.\n         * @memberof fx\n         * @classdesc Represents a CcyPairRateService\n         * @extends $protobuf.rpc.Service\n         * @constructor\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         */\n        function CcyPairRateService(rpcImpl, requestDelimited, responseDelimited) {\n            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n        }\n\n        (CcyPairRateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CcyPairRateService;\n\n        /**\n         * Creates new CcyPairRateService service using the specified rpc implementation.\n         * @function create\n         * @memberof fx.CcyPairRateService\n         * @static\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         * @returns {CcyPairRateService} RPC service. Useful where requests and/or responses are streamed.\n         */\n        CcyPairRateService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n            return new this(rpcImpl, requestDelimited, responseDelimited);\n        };\n\n        /**\n         * Callback as used by {@link fx.CcyPairRateService#getRate}.\n         * @memberof fx.CcyPairRateService\n         * @typedef GetRateCallback\n         * @type {function}\n         * @param {Error|null} error Error, if any\n         * @param {fx.CcyPairRate} [response] CcyPairRate\n         */\n\n        /**\n         * Calls GetRate.\n         * @function getRate\n         * @memberof fx.CcyPairRateService\n         * @instance\n         * @param {fx.ICcyPair} request CcyPair message or plain object\n         * @param {fx.CcyPairRateService.GetRateCallback} callback Node-style callback called with the error, if any, and CcyPairRate\n         * @returns {undefined}\n         * @variation 1\n         */\n        CcyPairRateService.prototype.getRate = function getRate(request, callback) {\n            return this.rpcCall(getRate, $root.fx.CcyPair, $root.fx.CcyPairRate, request, callback);\n        };\n\n        /**\n         * Calls GetRate.\n         * @function getRate\n         * @memberof fx.CcyPairRateService\n         * @instance\n         * @param {fx.ICcyPair} request CcyPair message or plain object\n         * @returns {Promise<fx.CcyPairRate>} Promise\n         * @variation 2\n         */\n\n        return CcyPairRateService;\n    })();\n\n    return fx;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ndeclare var window: any;\nimport { WebCcyPairRateProviderClientBuilder } from './gen/WebCcyPairRateProviderGeneratedClient';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport * as plexus from './gen/plexus-messages';\nimport { LoggerFactory, LogLevel } from '@plexus-interop/common';\nimport { RateService } from './RateService';\n\nLoggerFactory.setLogLevel(LogLevel.TRACE);\n\n// Read launch arguments, provided by Electron Launcher\ndeclare var window: any;\nconst electron = window.require('electron');\nconst remote = electron.remote;\nconst electronWindow: any = remote.getCurrentWindow();\n\nconst webSocketUrl = remote.getCurrentWindow().plexusBrokerWsUrl;\nconst instanceId = remote.getCurrentWindow().plexusAppInstanceId;\n\n// enable dev tools\ndocument.addEventListener('keydown', function (e) {\n    if (e.which === 123) {\n        // F12\n        electronWindow.toggleDevTools();\n    } else if (e.which === 116) {\n        // F5\n        location.reload();\n    }\n});\n\nconst outEl = document.getElementById('out');\nconst log = (msg: string) => {\n    console.log(msg);\n    outEl.innerText = outEl.innerText + '\\n' + msg;\n};\n\nconst rateService = new RateService();\n\nnew WebCcyPairRateProviderClientBuilder()\n    .withClientDetails({\n        applicationId: 'vendor_a.fx.WebCcyPairRateProvider',\n        applicationInstanceId: instanceId\n    })\n    .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket(webSocketUrl)).connect())\n    .withCcyPairRateServiceInvocationsHandler({\n        onGetRate: async (context, ccyPair: plexus.fx.ICcyPair) => {\n            log(`Received request for ${ccyPair.ccyPairName}'s Rate`);\n            return rateService.getRate(ccyPair.ccyPairName);\n        }\n    })\n    .connect()\n    .then(() => log('Connected to Broker'))\n    .catch(e => console.error('Connection failure', e)); "
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/src/views/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <title>CCY Rate Provider</title>\n</head>\n<body>\n<h4>CCY Rate Provider</h4>\n<hr>\n<code id=\"out\"></code>\n<script src=\"app.bundle.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "web/packages/ccy-pair-rate-provider/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"outDir\": \"dist/main\",\n    \"rootDir\": \".\",\n    \"moduleResolution\": \"node\",\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"pretty\": true,\n    \"lib\": [\n      \"es6\",\n      \"dom\"\n    ],\n    \"types\": [\n      \"long\", \"node\"\n    ]\n  },\n  \"include\": [\n    \"src/**/*.ts\",\n    \"tests/**/*.ts\"\n  ],\n  \"exclude\": [\n    \"node_modules/**\"\n  ]\n}"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/gen-client.cmd",
    "content": "java -jar ../../../bin/win-x86/sdk/plexusgen.jar --type=ts --baseDir=../../../samples/quick-start/registry --input=web_ccy_pair_rate_viewer.interop --out=./src/gen --protoc=./node_modules/.bin/pbts.cmd"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/ccy-pair-rate-viewer\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Quick start Rate Viewer App\",\n  \"main\": \"index.js\",\n  \"private\": true,\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"protobufjs\": \"6.11.3\"\n  },\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"compile\": \"tsc -p tsconfig.json\",\n    \"copy-assets\": \"copyfiles src/gen/* dist/main && copyfiles -f src/views/* dist\",\n    \"package\": \"browserify ./dist/main/src/index.js --outfile ./dist/app.bundle.js\",\n    \"build\": \"npm run compile && npm run copy-assets && npm run package\",\n    \"postbuild\": \"copyfiles ./dist/* -f ../../../bin/win-x86/samples/quick-start/apps/WebCcyPairRateViewer\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@types/node\": \"^7.0.5\",\n    \"browserify\": \"^14.5.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"electron\": \"1.8.8\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"typescript\": \"3.7.2\"\n  }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/src/gen/WebCcyPairRateViewerGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from \"@plexus-interop/client\";\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from \"@plexus-interop/client\";\nimport { TransportConnection, UniqueId } from \"@plexus-interop/transport-common\";\nimport { Arrays, Observer } from \"@plexus-interop/common\";\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from \"@plexus-interop/client\";\n\nimport * as plexus from \"./plexus-messages\";\n\n/**\n *  Proxy interface of CcyPairRateService service, to be consumed by Client API\n */\nexport abstract class CcyPairRateServiceProxy {\n\n    public abstract getRate(request: plexus.fx.ICcyPair): Promise<plexus.fx.ICcyPairRate>;\n\n}\n\n/**\n *  Internal Proxy implementation for CcyPairRateService service\n */\nexport class CcyPairRateServiceProxyImpl implements CcyPairRateServiceProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public getRate(request: plexus.fx.ICcyPair): Promise<plexus.fx.ICcyPairRate> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: \"GetRate\",\n            serviceId: \"fx.CcyPairRateService\"\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.fx.CcyPair, plexus.fx.CcyPairRate);\n        });\n    }\n\n}\n\n/**\n * Main client API\n */\nexport interface WebCcyPairRateViewerClient extends GenericClientApi  {\n\n    getCcyPairRateServiceProxy(): CcyPairRateServiceProxy;\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass WebCcyPairRateViewerClientImpl extends GenericClientApiBase implements WebCcyPairRateViewerClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n        private readonly ccyPairRateServiceProxy: CcyPairRateServiceProxy\n    ) {\n        super(genericClient);\n    }\n\n    public getCcyPairRateServiceProxy(): CcyPairRateServiceProxy {\n        return this.ccyPairRateServiceProxy;\n    }\n\n}\n\n\n/**\n * Client API builder\n */\nexport class WebCcyPairRateViewerClientBuilder {\n\n    private clientDetails: ClientConnectRequest = {\n        applicationId: \"vendor_b.fx.WebCcyPairRateViewer\"\n    };\n\n    private transportConnectionProvider: () => Promise<TransportConnection>;\n\n\n    public withClientDetails(clientId: ClientConnectRequest): WebCcyPairRateViewerClientBuilder {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): WebCcyPairRateViewerClientBuilder {\n        this.clientDetails.applicationInstanceId = appInstanceId;\n        return this;\n    }\n\n    public withAppId(appId: string): WebCcyPairRateViewerClientBuilder {\n        this.clientDetails.applicationId = appId;\n        return this;\n    }\n\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): WebCcyPairRateViewerClientBuilder {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    public connect(): Promise<WebCcyPairRateViewerClient> {\n        return new ContainerAwareClientAPIBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            .connect()\n            .then((genericClient: GenericClientApi) => new WebCcyPairRateViewerClientImpl(\n                genericClient,\n                new CcyPairRateServiceProxyImpl(genericClient)\n                ));\n    }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/src/gen/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from 'protobufjs';\n\n/** Namespace fx. */\nexport namespace fx {\n\n    /** Properties of a CcyPair. */\n    interface ICcyPair {\n\n        /** CcyPair ccyPairName */\n        ccyPairName?: (string|null);\n    }\n\n    /** Represents a CcyPair. */\n    class CcyPair implements ICcyPair {\n\n        /**\n         * Constructs a new CcyPair.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: fx.ICcyPair);\n\n        /** CcyPair ccyPairName. */\n        public ccyPairName: string;\n\n        /**\n         * Creates a new CcyPair instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns CcyPair instance\n         */\n        public static create(properties?: fx.ICcyPair): fx.CcyPair;\n\n        /**\n         * Encodes the specified CcyPair message. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @param message CcyPair message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: fx.ICcyPair, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified CcyPair message, length delimited. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @param message CcyPair message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: fx.ICcyPair, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): fx.CcyPair;\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): fx.CcyPair;\n\n        /**\n         * Verifies a CcyPair message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a CcyPair message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns CcyPair\n         */\n        public static fromObject(object: { [k: string]: any }): fx.CcyPair;\n\n        /**\n         * Creates a plain object from a CcyPair message. Also converts values to other types if specified.\n         * @param message CcyPair\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: fx.CcyPair, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this CcyPair to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a CcyPairRate. */\n    interface ICcyPairRate {\n\n        /** CcyPairRate ccyPairName */\n        ccyPairName?: (string|null);\n\n        /** CcyPairRate rate */\n        rate?: (number|null);\n    }\n\n    /** Represents a CcyPairRate. */\n    class CcyPairRate implements ICcyPairRate {\n\n        /**\n         * Constructs a new CcyPairRate.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: fx.ICcyPairRate);\n\n        /** CcyPairRate ccyPairName. */\n        public ccyPairName: string;\n\n        /** CcyPairRate rate. */\n        public rate: number;\n\n        /**\n         * Creates a new CcyPairRate instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns CcyPairRate instance\n         */\n        public static create(properties?: fx.ICcyPairRate): fx.CcyPairRate;\n\n        /**\n         * Encodes the specified CcyPairRate message. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @param message CcyPairRate message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: fx.ICcyPairRate, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified CcyPairRate message, length delimited. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @param message CcyPairRate message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: fx.ICcyPairRate, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): fx.CcyPairRate;\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): fx.CcyPairRate;\n\n        /**\n         * Verifies a CcyPairRate message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a CcyPairRate message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns CcyPairRate\n         */\n        public static fromObject(object: { [k: string]: any }): fx.CcyPairRate;\n\n        /**\n         * Creates a plain object from a CcyPairRate message. Also converts values to other types if specified.\n         * @param message CcyPairRate\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: fx.CcyPairRate, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this CcyPairRate to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Represents a CcyPairRateService */\n    class CcyPairRateService extends $protobuf.rpc.Service {\n\n        /**\n         * Constructs a new CcyPairRateService service.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         */\n        constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n        /**\n         * Creates new CcyPairRateService service using the specified rpc implementation.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         * @returns RPC service. Useful where requests and/or responses are streamed.\n         */\n        public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CcyPairRateService;\n\n        /**\n         * Calls GetRate.\n         * @param request CcyPair message or plain object\n         * @param callback Node-style callback called with the error, if any, and CcyPairRate\n         */\n        public getRate(request: fx.ICcyPair, callback: fx.CcyPairRateService.GetRateCallback): void;\n\n        /**\n         * Calls GetRate.\n         * @param request CcyPair message or plain object\n         * @returns Promise\n         */\n        public getRate(request: fx.ICcyPair): Promise<fx.CcyPairRate>;\n    }\n\n    namespace CcyPairRateService {\n\n        /**\n         * Callback as used by {@link fx.CcyPairRateService#getRate}.\n         * @param error Error, if any\n         * @param [response] CcyPairRate\n         */\n        type GetRateCallback = (error: (Error|null), response?: fx.CcyPairRate) => void;\n    }\n}\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/src/gen/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.plexus || ($protobuf.roots.plexus = {});\n\n$root.fx = (function() {\n\n    /**\n     * Namespace fx.\n     * @exports fx\n     * @namespace\n     */\n    var fx = {};\n\n    fx.CcyPair = (function() {\n\n        /**\n         * Properties of a CcyPair.\n         * @memberof fx\n         * @interface ICcyPair\n         * @property {string|null} [ccyPairName] CcyPair ccyPairName\n         */\n\n        /**\n         * Constructs a new CcyPair.\n         * @memberof fx\n         * @classdesc Represents a CcyPair.\n         * @implements ICcyPair\n         * @constructor\n         * @param {fx.ICcyPair=} [properties] Properties to set\n         */\n        function CcyPair(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * CcyPair ccyPairName.\n         * @member {string} ccyPairName\n         * @memberof fx.CcyPair\n         * @instance\n         */\n        CcyPair.prototype.ccyPairName = \"\";\n\n        /**\n         * Creates a new CcyPair instance using the specified properties.\n         * @function create\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair=} [properties] Properties to set\n         * @returns {fx.CcyPair} CcyPair instance\n         */\n        CcyPair.create = function create(properties) {\n            return new CcyPair(properties);\n        };\n\n        /**\n         * Encodes the specified CcyPair message. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @function encode\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair} message CcyPair message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPair.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.ccyPairName);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified CcyPair message, length delimited. Does not implicitly {@link fx.CcyPair.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.ICcyPair} message CcyPair message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPair.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer.\n         * @function decode\n         * @memberof fx.CcyPair\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {fx.CcyPair} CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPair.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.fx.CcyPair();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.ccyPairName = reader.string();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a CcyPair message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof fx.CcyPair\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {fx.CcyPair} CcyPair\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPair.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a CcyPair message.\n         * @function verify\n         * @memberof fx.CcyPair\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        CcyPair.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                if (!$util.isString(message.ccyPairName))\n                    return \"ccyPairName: string expected\";\n            return null;\n        };\n\n        /**\n         * Creates a CcyPair message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof fx.CcyPair\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {fx.CcyPair} CcyPair\n         */\n        CcyPair.fromObject = function fromObject(object) {\n            if (object instanceof $root.fx.CcyPair)\n                return object;\n            var message = new $root.fx.CcyPair();\n            if (object.ccyPairName != null)\n                message.ccyPairName = String(object.ccyPairName);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a CcyPair message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof fx.CcyPair\n         * @static\n         * @param {fx.CcyPair} message CcyPair\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        CcyPair.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults)\n                object.ccyPairName = \"\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                object.ccyPairName = message.ccyPairName;\n            return object;\n        };\n\n        /**\n         * Converts this CcyPair to JSON.\n         * @function toJSON\n         * @memberof fx.CcyPair\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        CcyPair.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return CcyPair;\n    })();\n\n    fx.CcyPairRate = (function() {\n\n        /**\n         * Properties of a CcyPairRate.\n         * @memberof fx\n         * @interface ICcyPairRate\n         * @property {string|null} [ccyPairName] CcyPairRate ccyPairName\n         * @property {number|null} [rate] CcyPairRate rate\n         */\n\n        /**\n         * Constructs a new CcyPairRate.\n         * @memberof fx\n         * @classdesc Represents a CcyPairRate.\n         * @implements ICcyPairRate\n         * @constructor\n         * @param {fx.ICcyPairRate=} [properties] Properties to set\n         */\n        function CcyPairRate(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * CcyPairRate ccyPairName.\n         * @member {string} ccyPairName\n         * @memberof fx.CcyPairRate\n         * @instance\n         */\n        CcyPairRate.prototype.ccyPairName = \"\";\n\n        /**\n         * CcyPairRate rate.\n         * @member {number} rate\n         * @memberof fx.CcyPairRate\n         * @instance\n         */\n        CcyPairRate.prototype.rate = 0;\n\n        /**\n         * Creates a new CcyPairRate instance using the specified properties.\n         * @function create\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate=} [properties] Properties to set\n         * @returns {fx.CcyPairRate} CcyPairRate instance\n         */\n        CcyPairRate.create = function create(properties) {\n            return new CcyPairRate(properties);\n        };\n\n        /**\n         * Encodes the specified CcyPairRate message. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @function encode\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate} message CcyPairRate message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPairRate.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.ccyPairName);\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                writer.uint32(/* id 2, wireType 1 =*/17).double(message.rate);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified CcyPairRate message, length delimited. Does not implicitly {@link fx.CcyPairRate.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.ICcyPairRate} message CcyPairRate message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        CcyPairRate.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer.\n         * @function decode\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {fx.CcyPairRate} CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPairRate.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.fx.CcyPairRate();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.ccyPairName = reader.string();\n                    break;\n                case 2:\n                    message.rate = reader.double();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a CcyPairRate message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {fx.CcyPairRate} CcyPairRate\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        CcyPairRate.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a CcyPairRate message.\n         * @function verify\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        CcyPairRate.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                if (!$util.isString(message.ccyPairName))\n                    return \"ccyPairName: string expected\";\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                if (typeof message.rate !== \"number\")\n                    return \"rate: number expected\";\n            return null;\n        };\n\n        /**\n         * Creates a CcyPairRate message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {fx.CcyPairRate} CcyPairRate\n         */\n        CcyPairRate.fromObject = function fromObject(object) {\n            if (object instanceof $root.fx.CcyPairRate)\n                return object;\n            var message = new $root.fx.CcyPairRate();\n            if (object.ccyPairName != null)\n                message.ccyPairName = String(object.ccyPairName);\n            if (object.rate != null)\n                message.rate = Number(object.rate);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a CcyPairRate message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof fx.CcyPairRate\n         * @static\n         * @param {fx.CcyPairRate} message CcyPairRate\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        CcyPairRate.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.ccyPairName = \"\";\n                object.rate = 0;\n            }\n            if (message.ccyPairName != null && message.hasOwnProperty(\"ccyPairName\"))\n                object.ccyPairName = message.ccyPairName;\n            if (message.rate != null && message.hasOwnProperty(\"rate\"))\n                object.rate = options.json && !isFinite(message.rate) ? String(message.rate) : message.rate;\n            return object;\n        };\n\n        /**\n         * Converts this CcyPairRate to JSON.\n         * @function toJSON\n         * @memberof fx.CcyPairRate\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        CcyPairRate.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return CcyPairRate;\n    })();\n\n    fx.CcyPairRateService = (function() {\n\n        /**\n         * Constructs a new CcyPairRateService service.\n         * @memberof fx\n         * @classdesc Represents a CcyPairRateService\n         * @extends $protobuf.rpc.Service\n         * @constructor\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         */\n        function CcyPairRateService(rpcImpl, requestDelimited, responseDelimited) {\n            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n        }\n\n        (CcyPairRateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CcyPairRateService;\n\n        /**\n         * Creates new CcyPairRateService service using the specified rpc implementation.\n         * @function create\n         * @memberof fx.CcyPairRateService\n         * @static\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         * @returns {CcyPairRateService} RPC service. Useful where requests and/or responses are streamed.\n         */\n        CcyPairRateService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n            return new this(rpcImpl, requestDelimited, responseDelimited);\n        };\n\n        /**\n         * Callback as used by {@link fx.CcyPairRateService#getRate}.\n         * @memberof fx.CcyPairRateService\n         * @typedef GetRateCallback\n         * @type {function}\n         * @param {Error|null} error Error, if any\n         * @param {fx.CcyPairRate} [response] CcyPairRate\n         */\n\n        /**\n         * Calls GetRate.\n         * @function getRate\n         * @memberof fx.CcyPairRateService\n         * @instance\n         * @param {fx.ICcyPair} request CcyPair message or plain object\n         * @param {fx.CcyPairRateService.GetRateCallback} callback Node-style callback called with the error, if any, and CcyPairRate\n         * @returns {undefined}\n         * @variation 1\n         */\n        CcyPairRateService.prototype.getRate = function getRate(request, callback) {\n            return this.rpcCall(getRate, $root.fx.CcyPair, $root.fx.CcyPairRate, request, callback);\n        };\n\n        /**\n         * Calls GetRate.\n         * @function getRate\n         * @memberof fx.CcyPairRateService\n         * @instance\n         * @param {fx.ICcyPair} request CcyPair message or plain object\n         * @returns {Promise<fx.CcyPairRate>} Promise\n         * @variation 2\n         */\n\n        return CcyPairRateService;\n    })();\n\n    return fx;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ndeclare var window: any;\nimport { WebCcyPairRateViewerClientBuilder, WebCcyPairRateViewerClient } from './gen/WebCcyPairRateViewerGeneratedClient';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport { LoggerFactory, LogLevel } from '@plexus-interop/common';\n\n// Read launch arguments, provided by Electron Launcher\nLoggerFactory.setLogLevel(LogLevel.TRACE);\nconst electron = window.require('electron');\nconst remote = electron.remote;\nconst electronWindow: any = remote.getCurrentWindow();\n\nconst webSocketUrl = remote.getCurrentWindow().plexusBrokerWsUrl;\nconst instanceId = remote.getCurrentWindow().plexusAppInstanceId;\n// enable dev tools\ndocument.addEventListener('keydown', function (e) {\n    if (e.which === 123) {\n        // F12\n        electronWindow.toggleDevTools();\n    } else if (e.which === 116) {\n        // F5\n        location.reload();\n    }\n});\n\nconst outEl = document.getElementById('out');\n\nconst log = (msg: string) => {\n    console.log(msg);\n    outEl.innerText = outEl.innerText + '\\n' + msg;\n};\n\nwindow.getRate = () => log('Not connected to Broker');\n\nnew WebCcyPairRateViewerClientBuilder()\n    .withClientDetails({\n        applicationId: 'vendor_b.fx.WebCcyPairRateViewer',\n        applicationInstanceId: instanceId\n    })\n    .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket(webSocketUrl)).connect())\n    .connect()\n    .then(async (rateViewerClient: WebCcyPairRateViewerClient) => {\n        log('Connected to Broker');\n        window.getRate = async () => {\n            const ccyPair = (document.getElementById('ccyPair') as HTMLInputElement).value;\n            log(`Sending request for ${ccyPair}`);\n            const ccyPairRate = await rateViewerClient.getCcyPairRateServiceProxy().getRate({ccyPairName: ccyPair});\n            log(`Received rate ${ccyPairRate.ccyPairName} - ${ccyPairRate.rate}`);\n        };\n    });\n"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/src/views/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <title>CCY Rate Viewer</title>\n</head>\n<body>\n<h4>CCY Rate Viewer</h4>\n<hr>\n<form>\n    CCY Pair: <input type=\"text\" id=\"ccyPair\"><button type=\"button\" onclick=\"getRate();\">Get Rate</button>\n</form>\n<code id=\"out\"></code>\n\n<script src=\"app.bundle.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "web/packages/ccy-pair-rate-viewer/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"outDir\": \"dist/main\",\n    \"rootDir\": \".\",\n    \"moduleResolution\": \"node\",\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"pretty\": true,\n    \"lib\": [\n      \"es6\",\n      \"dom\"\n    ],\n    \"types\": [\n      \"long\", \"node\"\n    ]\n  },\n  \"include\": [\n    \"src/**/*.ts\",\n    \"tests/**/*.ts\"\n  ],\n  \"exclude\": [\n    \"node_modules/**\"\n  ]\n}"
  },
  {
    "path": "web/packages/cli/.gitignore",
    "content": "*.received.*"
  },
  {
    "path": "web/packages/cli/.npmignore",
    "content": "\nnode_modules\ncoverage\n.vscode\n*.log\ndist/jre\ndist/protoc\ndist/gen"
  },
  {
    "path": "web/packages/cli/.vscode/launch.json",
    "content": "{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"node\",\n            \"request\": \"launch\",\n            \"name\": \"Jest CLI Tests\",\n            \"program\": \"${workspaceFolder}\\\\..\\\\..\\\\node_modules\\\\jest\\\\bin\\\\jest.js\",\n            \"args\": [\n                \"-i\"\n            ],\n            \"outFiles\": [\n                \"${workspaceFolder}/dist/**/*\"\n            ],\n            \"preLaunchTask\": \"build:main\"\n        }\n    ]\n}"
  },
  {
    "path": "web/packages/cli/.vscode/tasks.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=733558\n    // for the documentation about the tasks.json format\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"label\": \"build:main\",\n            \"type\": \"npm\",\n            \"script\": \"build:main\",\n            \"problemMatcher\": []\n        }\n    ]\n}"
  },
  {
    "path": "web/packages/cli/dev-examples.md",
    "content": "\n# Gen Proto files\n\n```\nnode plexus.js gen-proto -b ../../../samples/greeting/registry -i '*.interop'  -v true\n```\n\n# Gen Typescript client\n\n```\nnode plexus.js gen-ts -b ../../../samples/greeting/registry -i greeting_client.interop\n```\n\n# Gen CSharp client\n\n```\nnode plexus.js gen-csharp -b -b ../../../samples/greeting/registry -i greeting_client.interop\n```\n\n# Validate Metadata\n\n```\nnode plexus.js validate -b ../../../samples/greeting/registry\n```\n\n"
  },
  {
    "path": "web/packages/cli/install.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst path = require('path');\nlet install = null;\ntry {\n    install = require(path.join(__dirname, 'dist/main/src/install')).install;    \n} catch (error) {\n    console.warn(`Unable to load dist/main/src/install module`, error);\n}\nif (install) {\n    install()\n        .then(() => {\n            console.log('Plexus CLI installation completed');\n        })\n        .catch(e => {\n            console.warn('Plexus CLI installation completed with errors', e);            \n        });\n}"
  },
  {
    "path": "web/packages/cli/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/cli\",\n  \"version\": \"0.1.0\",\n  \"main\": \"plexus.js\",\n  \"description\": \"Plexus Interop CLI tools\",\n  \"license\": \"Apache-2.0\",\n  \"preferGlobal\": true,\n  \"bin\": {\n    \"plexus\": \"./plexus.js\"\n  },\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist/main && trash dist/lib && npm run copy-assets && npm run rename-lib\",\n    \"copy-assets\": \"copyfiles -f ../../../dsl/gen/cli/build/libs/cli-*-all.jar dist/lib\",\n    \"rename-lib\": \"renamer --find cli-.*-all.jar --regex --replace plexusgen.jar dist/lib/* && trash dist/lib/cli-.*-all.jar\",\n    \"build\": \"yarn build:main\",\n    \"postinstall\": \"node ./install.js\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"pretest\": \"trash dist/gen\",\n    \"test\": \"if-env PLEXUS_CLI_TESTS_ENABLED=true && npm run cli-test || echo 'CLI tests disabled'\",\n    \"cli-test\": \"node ./install.js && yarn unit\"\n  },\n  \"dependencies\": {\n    \"commander\": \"2.15.1\",\n    \"progress\": \"2.0.0\",\n    \"protobufjs\": \"6.11.3\",\n    \"request\": \"2.75.0\",\n    \"fs-extra\": \"5.0.0\",\n    \"adm-zip\": \"0.4.11\",\n    \"tar-fs\": \"1.16.2\",\n    \"tar\": \"4.4.1\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"@types/fs-extra\": \"5.0.1\",\n    \"chai\": \"^4.1.0\",\n    \"if-env\": \"1.0.0\",\n    \"jest\": \"^23.5.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"renamer\": \"^0.6.1\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"ts-mockito\": \"2.0.2\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/cli/plexus.js",
    "content": "#!/usr/bin/env node\n/* WARNING: Do not use automatic license update for this file.\nNode.js ignore shebang only if it is the very first line of the file.\nIt won't work even if there's an empty line or comment line before it.\n*/\n/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst main = require('./dist/main/src/index').main;\nconst version = require('./package.json').version;\nmain(process.argv, version);"
  },
  {
    "path": "web/packages/cli/src/commands/BaseCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Command } from './Command';\nimport { Option, getFlags } from './Option';\nimport * as commander from 'commander';\n\nexport abstract class BaseCommand implements Command {\n\n    public abstract name: () => string;\n\n    public abstract action(opts: any): Promise<void>;\n\n    public usageExamples = () => ` $ plexus ${this.name()} ${this.optionsExampleArgs().join(' ')}`;\n\n    public generalDescription = () => '';\n\n    public options: () => Option[] = () => [];\n\n    public optionArgs = (\n        optValues: any,\n        separator?: string,\n        nameConverter: (k: string) => string = k => k): string[] => {\n        return this.options().reduce<string[]>((seed, option) => {\n            const value = optValues[option.longName];\n            if (!value) {\n                return seed;\n            }\n            const name = `--${nameConverter(option.longName)}`;\n            if (option.isFlag) {\n                return seed.concat(`${name}`);\n            } else {\n                const optionArgs = !!separator ? [`${name}${separator}${value}`] : [name, value];\n                return seed.concat(optionArgs);\n            }\n        }, []);\n    }\n\n    public optionsExampleArgs = () => {\n        return this.options()\n            .filter(o => o.exampleValue || o.isFlag)\n            .reduce<string[]>((seed, option) => {\n                if (option.isFlag) {\n                    return seed.concat(`-${option.shortName}`);\n                } else {\n                    return seed.concat([`-${option.shortName}`, option.exampleValue as string]);\n                }\n            }, []);\n    }\n\n    public isVerbose(opts: any): boolean {\n        return !!opts && !!opts.verbose && opts.verbose !== 'false';\n    }\n\n    public log(msg: string, ...args: any[]): void {\n        console.log(`[${this.name()}] ${msg}`, args);\n    }\n\n    public register(builder: commander.CommanderStatic): void {\n        let commandBuilder = builder.command(this.name())\n            .description(this.generalDescription());\n        this.options().forEach(o => commandBuilder.option(getFlags(o), o.description, o.defaultValue));\n        commandBuilder = commandBuilder.action(opts => {\n            // need to do it manually :(\n            // https://github.com/tj/commander.js/issues/44\n            this.log('Validating input args');\n            const errors = this.validateRequiredOpts(this.options(), opts);\n            if (errors.length > 0) {\n                this.fail(errors.join('\\n'));\n            }\n            this.log('Starting execution');\n            if (opts.verbose === 'true') {\n                this.log(`Passed options: ${this.optionValuesToString(opts)}`);\n            }\n            this.action(opts)\n                .then(() => this.log('Completed successfully'))\n                .catch(e => this.fail(e));\n        });\n        const examples = this.usageExamples();\n        if (examples) {\n            commandBuilder.on('--help', () => {\n                console.log('');\n                console.log('  Examples:');\n                console.log('');\n                console.log(examples);\n                console.log('');\n            });\n        }\n    }\n\n    public fail(error: any): void {\n        this.log('Finished with error', error);\n        process.exit(1);\n    }\n\n    public optionValuesToString(opts: any): string {\n        return this.options().reduce<string>((seed, option) => `${seed} ${option.longName}=${opts[option.longName]}`, '');\n    }\n\n    public validateRequiredOpts(options: Option[], commanderOpts: any): string[] {\n        if (options) {\n            return options\n                .filter(o => !!o.isRequired && !commanderOpts[o.longName])\n                .map(o => `'${getFlags(o)}' option is required`);\n        } else {\n            return [];\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/cli/src/commands/BaseJavaGenCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseCommand } from './BaseCommand';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { simpleSpawn } from '../common/process';\n\nexport abstract class BaseJavaGenCommand extends BaseCommand {\n\n    public abstract plexusGenArgs: (opts: any) => string[];\n\n    public async action(opts: any): Promise<void> {\n        const javaExecPath = await getJavaExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        return simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.plexusGenArgs(opts)], this.isVerbose(opts));\n    }\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/Command.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as program from 'commander';\n\nexport interface Command {\n\n    register(builder: program.CommanderStatic): void;\n\n}"
  },
  {
    "path": "web/packages/cli/src/commands/DefaultOptions.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Option } from './Option';\nimport * as path from 'path';\n\nexport function targetBaseDir(): Option {\n    return {\n        shortName: 'tb',\n        longName: 'targetBaseDir',\n        exampleValue: 'target/folder',\n        description: 'target metadata base directory',\n        isRequired: true,        \n        defaultValue: process.cwd()\n    };\n}\n\nexport function baseDir(): Option {\n    return {\n        shortName: 'b',\n        longName: 'baseDir',\n        exampleValue: 'metadata',\n        description: 'plexus metadata base directory',\n        isRequired: true,        \n        defaultValue: process.cwd()\n    };\n}\n\nexport function excludePattern(): Option {\n    return {\n        shortName: 'e',\n        longName: 'exclude',\n        exampleValue: '.*options.*',\n        description: 'exclude pattern (regexp) to filter *.proto files',\n        isRequired: false,        \n        defaultValue: ''\n    };\n}\n\nexport function generalEntryPoint(): Option {\n    return {\n        shortName: 'i',\n        longName: 'input',\n        exampleValue: 'plexus_application.interop',\n        isRequired: true,        \n        description: 'entry point file'\n    };\n}\n\nexport function plexusEntryPoint(): Option {\n    return {\n        shortName: 'i',\n        longName: 'input',\n        exampleValue: 'plexus_application.interop',\n        isRequired: true,        \n        description: 'file containing Plexus Component\\'s entry point, e.g. rate_provider.interop'\n    };\n}\n\nexport function out(defaultValue: string = path.join(process.cwd(), 'gen')): Option {\n    return {\n        shortName: 'o',\n        longName: 'out',\n        exampleValue: 'src/gen',\n        description: 'output directory',\n        isRequired: true,\n        defaultValue\n    };\n}\n\nexport function outFile(): Option {\n    return {\n        shortName: 'o',\n        longName: 'out',\n        exampleValue: 'plexus.out.log',\n        description: 'output file',\n        isRequired: false\n    };\n}\n\nexport function namespace(defaultValue: string = 'plexus'): Option {\n    return {\n        shortName: 'n',\n        longName: 'namespace',\n        exampleValue: 'plexus',\n        isRequired: true,        \n        description: 'namespace',\n        defaultValue\n    };\n}\n\nexport function verbose(): Option {\n    return {\n        shortName: 'v',\n        longName: 'verbose',\n        isFlag: true,\n        description: 'print verbose output'\n    };\n}"
  },
  {
    "path": "web/packages/cli/src/commands/GenCSharpCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { baseDir, out, plexusEntryPoint, namespace, verbose } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { BaseCommand } from './BaseCommand';\nimport { simpleSpawn } from '../common/process';\nimport { getProtocExecPath } from '../common/protoc';\n\nexport class GenCSharpCommand extends BaseCommand {\n    \n    public clientGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=csharp', ...this.optionArgs(opts)];\n    }\n\n    public name = () => 'gen-csharp';\n\n    public generalDescription = () => 'generate C# client and messages definitions for specified entry point';\n\n    public options: () => Option[] = () => [baseDir(), out('Generated'), plexusEntryPoint(), namespace('Plexus.Interop.Testing.Generated'), verbose()];\n\n    public async action(opts: any): Promise<void> {\n\n        this.log('Generating interop client');\n        const javaExecPath = await getJavaExecPath();\n        const protocExecPath = getProtocExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        await simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.clientGenArgs(opts), `--protoc=${protocExecPath}`], this.isVerbose(opts));\n        \n    }\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/GenJsonCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseJavaGenCommand } from './BaseJavaGenCommand';\nimport { baseDir, out, verbose, excludePattern } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getPbJsExecPath } from '../common/protoJs';\n\nexport class GenJsonCommand extends BaseJavaGenCommand {\n    \n    public plexusGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=json_meta', ...this.optionArgs(opts), `--protoc=${getPbJsExecPath()}`];\n    }\n\n    public generalDescription = () => 'generate metadata in JSON format';\n\n    public name = () => 'gen-json-meta';\n\n    public options: () => Option[] = () => [baseDir(), out(), verbose(), excludePattern()];\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/GenProtoCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseJavaGenCommand } from './BaseJavaGenCommand';\nimport { baseDir, out, plexusEntryPoint, verbose } from './DefaultOptions';\nimport { Option } from './Option';\n\nexport class GenProtoCommand extends BaseJavaGenCommand {\n    \n    public plexusGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=proto', '--descriptors', ...this.optionArgs(opts)];\n    }\n\n    public generalDescription = () => 'generate proto definitions for specified entry point';\n\n    public name = () => 'gen-proto';\n\n    public options: () => Option[] = () => [baseDir(), out(), plexusEntryPoint(), verbose()];\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/GenTsCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { baseDir, out, plexusEntryPoint, namespace, verbose, excludePattern } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { BaseCommand } from './BaseCommand';\nimport { simpleSpawn } from '../common/process';\nimport { genJsStaticModule, genTsStaticModule } from '../common/protoJs';\nimport * as path from 'path';\nimport { removeSync, mkdirsSync, listFiles } from '../common/files';\nimport { GenProtoCommand } from './GenProtoCommand';\n\nexport class GenTsCommand extends BaseCommand {\n\n    public readonly protoRegexp: RegExp = /.+\\.proto$/;\n    public readonly descriptorPathRegexp: RegExp = /.*google[\\/\\\\]+protobuf[\\/\\\\]+descriptor.proto|.*interop[\\/\\\\]+options.proto$/;\n    \n    public clientGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=ts', ...this.optionArgs(opts)];\n    }\n\n    public name = () => 'gen-ts';\n\n    public generalDescription = () => 'generate Typescript client and messages definitions for specified entry point';\n\n    public options: () => Option[] = () => [baseDir(), out(), plexusEntryPoint(), namespace(), verbose(), excludePattern()];\n\n    public async action(opts: any): Promise<void> {\n        \n        this.log('Generating proto definitions');\n        const protoFilesDir = path.join(opts.out, 'tmp');\n        mkdirsSync(protoFilesDir);\n        const protoGenCommand = new GenProtoCommand();\n        await protoGenCommand.action({\n            ...opts,\n            out: protoFilesDir\n        });\n        const excludePatternString: string = opts.excludePattern;\n        this.log('Generating proto messages JS definitions');\n        const jsFilePath =  path.join(opts.out, 'plexus-messages.js');\n        const protoFiles = (await listFiles(protoFilesDir, this.protoRegexp))\n            .filter(f => !this.isProtoDescriptorPath(f))\n            .filter(f => !excludePatternString || excludePatternString.length === 0 || !new RegExp(excludePatternString).test(f));\n        await genJsStaticModule(jsFilePath, protoFiles, opts.namespace);\n\n        this.log('Deleting proto definitions');\n        removeSync(protoFilesDir);\n\n        this.log('Generating proto messages TS definitions');\n        const tsFileName = 'plexus-messages.d.ts';\n        await genTsStaticModule(path.join(opts.out, tsFileName), jsFilePath);\n\n        this.log('Generating interop client');\n        const javaExecPath = await getJavaExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        await simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.clientGenArgs(opts)], opts.verbose === 'true');\n        \n    }\n\n    public isProtoDescriptorPath(path: string): boolean {\n        return this.descriptorPathRegexp.test(path);\n    }\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/ListMetaFilesCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseJavaGenCommand } from './BaseJavaGenCommand';\nimport { baseDir, outFile, verbose, generalEntryPoint } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { simpleSpawn } from '../common/process';\n\nexport class ListMetaFilesCommand extends BaseJavaGenCommand {\n\n    public plexusGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=list-meta', ...this.optionArgs(opts, '=', name => name === 'out' ? 'outFile' : name)];\n    }\n\n    public generalDescription = () => 'list metadata files';\n\n    public name = () => 'list-meta';\n\n    public options: () => Option[] = () => [baseDir(), outFile(), generalEntryPoint(), verbose()];\n\n    public async action(opts: any): Promise<void> {\n        const javaExecPath = await getJavaExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        await simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.plexusGenArgs(opts)], true);\n    }\n}"
  },
  {
    "path": "web/packages/cli/src/commands/Option.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Option {\n    shortName: string;\n    longName: string;\n    exampleValue?: string;\n    description?: string;\n    isFlag?: boolean;\n    isRequired?: boolean;\n    defaultValue?: any;\n}\n\nexport function getFlags(o: Option): string {\n    return !!o.isRequired ? `-${o.shortName}, --${o.longName} <${o.longName}>`\n            : !!o.isFlag ? `-${o.shortName}, --${o.longName}` \n                : `-${o.shortName}, --${o.longName} [${o.longName}]`;\n}"
  },
  {
    "path": "web/packages/cli/src/commands/ValidateMetadataCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseJavaGenCommand } from './BaseJavaGenCommand';\nimport { baseDir, outFile, verbose } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { simpleSpawn } from '../common/process';\n\nexport class ValidateMetadataCommand extends BaseJavaGenCommand {\n\n    public plexusGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=validate', ...this.optionArgs(opts, '=', name => name === 'out' ? 'outFile' : name)];\n    }\n\n    public generalDescription = () => 'validate metadata';\n\n    public name = () => 'validate';\n\n    public options: () => Option[] = () => [baseDir(), outFile(), verbose()];\n\n    public async action(opts: any): Promise<void> {\n        const javaExecPath = await getJavaExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        await simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.plexusGenArgs(opts)], true);\n        this.log('No validation errors found');\n    }\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/ValidateMetadataPatchCommand.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseJavaGenCommand } from './BaseJavaGenCommand';\nimport { baseDir, verbose, targetBaseDir } from './DefaultOptions';\nimport { Option } from './Option';\nimport { getJavaExecPath, getJavaGenLibPath } from '../common/java';\nimport { simpleSpawn } from '../common/process';\n\nexport class ValidateMetadataPatchCommand extends BaseJavaGenCommand {\n\n    public plexusGenArgs: (opts: any) => string[] = opts => {\n        return ['--type=validate-patch', ...this.optionArgs(opts)];\n    }\n\n    public generalDescription = () => 'validate metadata update';\n\n    public name = () => 'validate-patch';\n\n    public options: () => Option[] = () => [baseDir(), targetBaseDir(), verbose()];\n\n    public async action(opts: any): Promise<void> {\n        const javaExecPath = await getJavaExecPath();\n        const javaLibPath = getJavaGenLibPath();\n        await simpleSpawn(javaExecPath, ['-jar', javaLibPath, ...this.plexusGenArgs(opts)], true);\n        this.log('No validation errors found');\n    }\n\n}\n"
  },
  {
    "path": "web/packages/cli/src/commands/commands.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Command } from 'src/commands/Command';\nimport { GenTsCommand } from './GenTsCommand';\nimport { GenJsonCommand } from './GenJsonCommand';\nimport { GenProtoCommand } from './GenProtoCommand';\nimport { GenCSharpCommand } from './GenCSharpCommand';\nimport { ValidateMetadataCommand } from './ValidateMetadataCommand';\nimport { ValidateMetadataPatchCommand } from './ValidateMetadataPatchCommand';\nimport { ListMetaFilesCommand } from './ListMetaFilesCommand';\n\nexport function commands(): Command[] {\n    return [\n        new GenTsCommand(), \n        new GenJsonCommand(), \n        new GenProtoCommand(), \n        new GenCSharpCommand(), \n        new ValidateMetadataCommand(),\n        new ValidateMetadataPatchCommand(),\n        new ListMetaFilesCommand()\n    ];\n}\n\nexport function printGeneralHelp(): void {\n    console.log('');    \n    console.log('  Help for specific command:  plexus [command] --help');\n    console.log('');\n}"
  },
  {
    "path": "web/packages/cli/src/commands/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Command';\nexport * from './commands';\nexport * from './Option';"
  },
  {
    "path": "web/packages/cli/src/common/download.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { removeSync, mkdirsSync, unzipSync } from './files';\nimport { printProgress } from './progress';\nimport * as zlib from 'zlib';\nimport * as tar from 'tar-fs';\nimport * as request from 'request';\nimport * as path from 'path';\nimport * as fs from 'fs';\n\nexport function downloadPackage(url: string, downloadDir: string, title: string = 'Package', headers: any = {}): Promise<string> {\n    return new Promise<string>((resolve, reject) => {\n        try {\n            const isZip = url.endsWith('.zip');\n            const isTarGz = url.endsWith('.tar.gz');\n            const fileName = url.split('/').pop() as string;\n            console.log(`Downloading ${title} from: `, url);\n            console.log('Target dir: ', downloadDir);\n            removeSync(downloadDir);\n            mkdirsSync(downloadDir);\n            const responsePipe = request\n                .get({\n                    url,\n                    rejectUnauthorized: false,\n                    agent: false,\n                    headers\n                })\n                .on('response', (response: any) => printProgress(response, `Downloading ${title}`))\n                .on('error', (error: any) => {\n                    console.error(`${title} download failed`, error);\n                    reject(error);\n                });\n            if (isTarGz) {\n                responsePipe\n                    .pipe(zlib.createUnzip())\n                    .pipe(tar.extract(downloadDir))\n                    .on('end', () => {\n                        console.log(`${title} download finished`);\n                        resolve(downloadDir);\n                    });\n            } else {\n                responsePipe\n                    .pipe(fs.createWriteStream(path.join(downloadDir, fileName)))\n                    .on('close', () => {\n                        console.log(`${title} download finished`);\n                        if (isZip) {\n                            const zipPath = path.join(downloadDir, fileName);\n                            unzipSync(zipPath, downloadDir);\n                        }\n                        resolve(downloadDir);\n                    });\n            }\n        } catch (error) {\n            console.error('Unexpected error', error);\n            reject(error);\n        }\n    });\n}"
  },
  {
    "path": "web/packages/cli/src/common/files.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as fs from 'fs-extra';\nimport * as path from 'path';\nimport * as AdmZip from 'adm-zip';\n\nexport function getDistDir(): string {\n    return path.resolve(getBaseDir(), 'dist');\n}\n\nexport function getBaseDir(): string {\n    return path.join(__dirname, '..', '..', '..', '..');\n}\n\nexport function getDirectories(dirPath: string): string[] {\n    return fs.readdirSync(dirPath).filter(\n        file => fs.statSync(path.join(dirPath, file)).isDirectory()\n    );\n}\n\nexport function removeSync(file: string): void {\n    fs.removeSync(file);\n}\n\nexport function mkdirsSync(dir: string): void {\n    fs.mkdirsSync(dir);\n}\n\nexport function existsSync(path: string): boolean {\n    return fs.existsSync(path);\n}\n\nexport function exists(path: string): Promise<boolean> {\n    return new Promise<boolean>((resolve, reject) => {\n        fs.exists(path, exists => {\n            resolve(exists);\n        });\n    });\n}\n\nexport async function listFiles(baseDir: string, pattern: RegExp): Promise<string[]> {\n    const result: string[] = [];\n    iterateFiles(baseDir, pattern, f => result.push(f));\n    return result;\n}\n\nexport function readTextFile(filePath: string): Promise<string> {\n    return fs.readFile(filePath, 'utf8');\n}\n\nexport function iterateFiles(baseDir: string, pattern: RegExp, callback: (file: string) => void, recursive: boolean = true): void {\n    if (!fs.existsSync(baseDir)) {\n        return;\n    }\n    const files = fs.readdirSync(baseDir);\n    files.forEach(f => {\n        const fileName = path.join(baseDir, f);\n        if (isDirectory(fileName, false)) {\n            iterateFiles(fileName, pattern, callback);\n        } else if (pattern.test(fileName)) {\n            callback(fileName);\n        }\n    });\n}\n\nexport function unzipSync(zipPath: string, dir: string, removeZip: boolean = true): void {\n    console.log(`Extracting ${zipPath} to ${dir}`);\n    const zipArchive = new AdmZip(zipPath);\n    zipArchive.extractAllTo(dir, true);\n    console.log(`Extracted zip to ${dir}`);\n    if (removeZip) {\n        console.log(`Clearing zip ${zipPath}`);\n        removeSync(zipPath);\n    }\n}\n\nfunction isDirectory(path: string, failOnPermissonError: boolean = true): boolean {\n    try {\n        return fs.lstatSync(path).isDirectory();\n    } catch (error) {\n        if (!failOnPermissonError && error.code === 'EPERM') {\n            return false;\n        } else {\n            throw error;\n        }\n    }\n}\n\nexport function copyFile(source: string, target: string): Promise<void> {\n    return fs.copy(source, target);\n}"
  },
  {
    "path": "web/packages/cli/src/common/java.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as path from 'path';\nimport * as os from 'os';\nimport { getDirectories, getDistDir, exists } from './files';\nimport { downloadPackage } from './download';\n\nexport function downloadJre(): Promise<string> {\n    const url = getJreDownloadUrl();\n    const downloadDir = getJreDownloadDir();\n    const title = 'JRE';\n    return downloadPackage(url, downloadDir, title, {\n        connection: 'keep-alive',\n        Cookie: 'gpw_e24=http://www.oracle.com/; oraclelicense=accept-securebackup-cookie'\n    });\n}\n\nexport async function javaExecProvided(): Promise<string> {\n    const execPath = await getJavaExecPath();\n    const execExists = await exists(execPath);\n    if (execExists) {\n        return execPath;\n    } else {\n        throw new Error(`Do not exist ${execPath}`);\n    }\n}\n\nexport function getJreDownloadUrl(): string {\n    const platform = `${os.platform()}-${os.arch()}`;\n    return process.env[`PLEXUS_JRE_DOWNLOAD_URL_${platform.toUpperCase()}`]\n        || process.env.PLEXUS_JRE_DOWNLOAD_URL\n        || getDefaultDownloadUrl(platform);\n}\n\nfunction getDefaultDownloadUrl(platform: string): string {\n    switch (platform) {\n        case 'win32-ia32':\n        case 'win32-x32':\n            return 'http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jre-8u161-windows-i586.tar.gz';\n        case 'win32-x64':\n            return 'http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jre-8u161-windows-x64.tar.gz';\n        default:\n            throw new Error(`${platform} is not supported`);\n    }\n}\n\nexport function getJreBaseDir(downloadDir: string): string {\n    const childs = getDirectories(downloadDir);\n    if (childs.length === 0) {\n        throw new Error('No JRE found');\n    }\n    return path.join(downloadDir, childs[0]);\n}\n\nexport async function getJavaExecPath(): Promise<string> {\n    if (process.env.PLEXUS_CLI_JAVA_EXE_PATH) {\n        console.log(`Using Java executable from env variable ${process.env.PLEXUS_CLI_JAVA_EXE_PATH}`);\n        return process.env.PLEXUS_CLI_JAVA_EXE_PATH as string;\n    }\n    const baseDir = getJreBaseDir(getJreDownloadDir());\n    return path.join(baseDir, ...getExePath());\n}\n\nfunction getExePath(): string[] {\n    return os.platform() === 'win32' ? ['bin', 'java.exe'] : ['bin', 'java'];\n}\n\nconst getJreDownloadDir = () => path.join(getDistDir(), 'jre');\n\nexport const getJavaGenLibPath = () => path.join(getDistDir(), 'lib', 'plexusgen.jar');"
  },
  {
    "path": "web/packages/cli/src/common/process.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { spawn } from 'child_process';\n\nexport function simpleSpawn(execPath: string, args: string[] = [], printOutput: boolean = false): Promise<void> {\n    return new Promise<void>((resolve, reject) => {\n        const errorsBuffer: string[] = [];\n        const child = spawn(execPath, args, {\n            detached: true\n        });\n        child.stdout.on('data', data => {\n            if (printOutput) {\n                console.log(`${data}`);\n            }\n        });\n        child.stderr.on('data', data => {\n            if (printOutput) {\n                console.error(`${data}`);\n            } else {\n                errorsBuffer.push(`${data}`);\n            }\n        });\n        child.on('exit', (code, signal) => {\n            if (code !== 0) {\n                if (errorsBuffer.length > 0) {\n                    console.error(errorsBuffer.join('\\n'));\n                }\n                reject(new Error(`Child process completed with error code: ${code}, please use --verbose flag to see whole output`));\n            } else {\n                resolve();\n            }\n        });\n        child.on('error', error => {\n            console.error('Process finished with error', error);\n            reject(error);\n        });\n    });\n}"
  },
  {
    "path": "web/packages/cli/src/common/progress.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as ProgressBar from 'progress';\n\nexport function printProgress(response: any, text: string): void {\n    text = text || 'Downloading';\n    const length = parseInt(response.headers['content-length'], 10);\n    const progress = new ProgressBar(`${text} [:bar] :percent :etas`, {\n        complete: '=',\n        incomplete: '.',\n        width: 80,\n        total: length\n    });\n    response.on('data', (chunk: any) => progress.tick(chunk.length));\n}\n"
  },
  {
    "path": "web/packages/cli/src/common/protoJs.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pbjs, pbts } from 'protobufjs/cli';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { getBaseDir } from '../common/files';\n\nexport function genJsStaticModule(outFilePath: string, protoFiles: string[], namespace: string): Promise<void> {\n    return new Promise<void>((resolve, reject) => {\n        pbjs.main(['--force-long', '--no-delimited', '--sparse', '-t', 'static-module', '-r', namespace, '-w', 'commonjs', '-o', outFilePath, ...protoFiles], (error, output) => {\n            if (error) {\n                reject(error);\n            } else {\n                resolve();\n            }\n            return {};\n        });\n    });\n}\n\nexport function getPbJsExecPath(): string {\n    return path.resolve(getBaseDir(), 'node_modules', '.bin', os.platform() === 'win32' ? 'pbjs.cmd' : 'pbjs');\n}\n\nexport function genTsStaticModule(outFilePath: string, jsGeneratedFilePath: string): Promise<void> {\n    return new Promise<void>((resolve, reject) => {\n        pbts.main(['--force-long', '-o', outFilePath, jsGeneratedFilePath], (error, output) => {\n            if (error) {\n                reject(error);\n            } else {\n                resolve();\n            }\n            return {};\n        });\n    });\n}\n\n"
  },
  {
    "path": "web/packages/cli/src/common/protoc.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as path from 'path';\nimport * as os from 'os';\nimport { getDistDir, iterateFiles, mkdirsSync, copyFile, removeSync, exists } from './files';\nimport { downloadPackage } from './download';\n\nconst getDownloadDir = () => path.join(getDistDir(), 'protoc');\n\nexport async function downloadProtoc(): Promise<string> {\n    const url = getProtocDownloadUrl();\n    const downloadDir = getDownloadDir();\n    const title = 'Protoc';\n    await downloadPackage(url, downloadDir, title);\n    if (url.endsWith('.exe')) {\n        // direct file link to exe file, move it to bin/proto.exe\n        const downloadedExe = await new Promise<string>((resolve, reject) => {\n            let temp = null;\n            iterateFiles(downloadDir, /protoc.*\\.exe/g, f => temp = f, false);\n            if (temp) {\n                resolve(temp);\n            } else {\n                reject(new Error('Protoc EXE not found'));\n            }\n        });\n        console.log('Downloaded exe file', downloadedExe); \n        mkdirsSync(path.join(downloadDir, 'bin'));\n        const targetFile = path.join(downloadDir, 'bin', 'protoc.exe');\n        console.log('Copying to', targetFile);        \n        await copyFile(downloadedExe, targetFile);\n        console.log(`Clearing ${downloadedExe}`);\n        removeSync(downloadedExe);\n    }\n    return downloadDir;\n}\n\nexport async function protocExecProvided(): Promise<string> {\n    const execPath = getProtocExecPath();\n    const execExists = await exists(execPath);\n    if (execExists) {\n        return execPath;\n    } else {\n        throw new Error(`Do not exist ${execPath}`);\n    }\n}\n\nexport function getProtocExecPath(): string {\n    if (process.env.PLEXUS_CLI_PROTOC_EXE_PATH) {\n        console.log(`Using protoc from env variable ${process.env.PLEXUS_CLI_PROTOC_EXE_PATH}`);\n        return process.env.PLEXUS_CLI_PROTOC_EXE_PATH as string;\n    }\n    const baseDir = getDownloadDir();\n    return path.join(baseDir, ...getExePath());\n}\n\nexport function getProtocDownloadUrl(): string {\n    const platform = `${os.platform()}-${os.arch()}`;\n    return process.env[`PLEXUS_PROTOC_DOWNLOAD_URL_${platform.toUpperCase()}`]\n        || process.env.PLEXUS_PROTOC_DOWNLOAD_URL\n        || getDefaultDownloadUrl(platform);\n}\n\nfunction getExePath(): string[] {\n    return os.platform() === 'win32' ? ['bin', 'protoc.exe'] : ['bin', 'protoc'];\n}\n\nfunction getDefaultDownloadUrl(platform: string): string {\n    switch (platform) {\n        case 'win32-ia32':\n        case 'win32-x32':\n        case 'win32-x64':\n            return 'https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-win32.zip';\n        default:\n            throw new Error(`${platform} is not supported`);\n    }\n}\n"
  },
  {
    "path": "web/packages/cli/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as program from 'commander';\nimport { commands } from './commands';\nimport { printGeneralHelp } from './commands/commands';\n\nexport function main(args: string[], version: string): void {\n    program.on('--help', printGeneralHelp);\n    commands().forEach(c => c.register(program));\n    program\n        .version(version)\n        .parse(args);\n}"
  },
  {
    "path": "web/packages/cli/src/install.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { downloadProtoc, protocExecProvided } from './common/protoc';\nimport { downloadJre, javaExecProvided } from './common/java';\n// to execute 'warmp up' of protobufjs cli at this point rather than on first execution\nimport 'protobufjs/cli';\n\nexport function install(): Promise<void[]> {\n    return Promise.all([installJre(), installProtoc()]);\n}\n\nasync function installProtoc(): Promise<void> {\n    // tslint:disable-next-line:no-string-literal\n    if (process.env.PLEXUS_CLI_SKIP_PROTOC_DOWNLOAD === 'true') {\n        console.log('protoc download skipped');\n    } else {\n        try {\n            const provided = await protocExecProvided();\n            console.log(`protoc executable already provided: ${provided}`);\n        } catch (error) {\n            console.log('Failed to locate Protoc Executable, going to download', error.message);\n            await downloadProtoc();\n        }\n    }\n}\n\nasync function installJre(): Promise<void> {\n    // tslint:disable-next-line:no-string-literal\n    if (process.env.PLEXUS_CLI_SKIP_JRE_DOWNLOAD === 'true') {\n        console.log('JRE download skipped');\n    } else {\n        try {\n            const provided = await javaExecProvided();\n            console.log(`Java executable already provided: ${provided}`);\n        } catch (error) {\n            console.log('Failed to locate Java Executable, going to download', error.message);\n            await downloadJre();\n        }\n    }\n}"
  },
  {
    "path": "web/packages/cli/src/typings.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ndeclare module 'progress';\ndeclare module 'rmdir';\ndeclare module 'tar-fs';\ndeclare module 'request';\ndeclare module 'adm-zip';\ndeclare module 'mkdirp';"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-cs-client.approved.txt",
    "content": "// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_client.interop\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace plexus {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\t\t\t\t\t\n\tpublic partial interface IGreetingClient: IClient {\n\t\tGreetingClient.IGreetingServiceProxy GreetingService { get; }\n\t}\n\t\n\tpublic sealed partial class GreetingClient: ClientBase, IGreetingClient {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingClient\";\n\t\t\n\t\tprivate static ClientOptions CreateClientOptions(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null) {\n\t\t\tClientOptionsBuilder builder = new ClientOptionsBuilder().WithApplicationId(Id).WithDefaultConfiguration();\n\t\t\tif (setup != null) {\n\t\t\t\tbuilder = setup(builder);\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\treturn builder.Build();\t\t\t\t\t\n\t\t}\n\t\t\n\t\tpublic GreetingClient(Func<ClientOptionsBuilder, ClientOptionsBuilder> setup = null): base(CreateClientOptions(setup)) \n\t\t{ \n\t\t\tGreetingService = new GreetingClient.GreetingServiceProxy(this.CallInvoker);\n\t\t}\n\t\t\n\t\tpublic partial interface IGreetingServiceProxy:\n\t\t\tglobal::plexus.GreetingService.IUnaryProxy,\n\t\t\tglobal::plexus.GreetingService.IServerStreamingProxy,\n\t\t\tglobal::plexus.GreetingService.IClientStreamingProxy,\n\t\t\tglobal::plexus.GreetingService.IDuplexStreamingProxy\n\t\t{ }\n\t\t\n\t\tpublic sealed partial class GreetingServiceProxy: IGreetingServiceProxy {\n\t\t\t\n\t\t\tpublic static global::plexus.GreetingService.Descriptor Descriptor = global::plexus.GreetingService.DefaultDescriptor;\n\t\t\t\n\t\t\tprivate readonly IClientCallInvoker _callInvoker;\n\t\t\t\t\t\t\t\t\t\n\t\t\tpublic GreetingServiceProxy(IClientCallInvoker callInvoker) {\n\t\t\t\t_callInvoker = callInvoker;\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\tpublic IUnaryMethodCall<global::plexus.GreetingResponse> Unary(global::plexus.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.UnaryMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IServerStreamingMethodCall<global::plexus.GreetingResponse> ServerStreaming(global::plexus.GreetingRequest request) {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ServerStreamingMethod, request);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IClientStreamingMethodCall<global::plexus.GreetingRequest, global::plexus.GreetingResponse> ClientStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.ClientStreamingMethod);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDuplexStreamingMethodCall<global::plexus.GreetingRequest, global::plexus.GreetingResponse> DuplexStreaming() {\n\t\t\t\treturn _callInvoker.Call(Descriptor.DuplexStreamingMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IGreetingServiceProxy GreetingService { get; private set; }\n\t}\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-cs-messages.approved.txt",
    "content": "// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/samples/greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace plexus {\n\n  /// <summary>Holder for reflection information generated from interop/samples/greeting_service.proto</summary>\n  public static partial class GreetingServiceReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/samples/greeting_service.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static GreetingServiceReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"CiZpbnRlcm9wL3NhbXBsZXMvZ3JlZXRpbmdfc2VydmljZS5wcm90bxIPaW50\",\n            \"ZXJvcC5zYW1wbGVzGhVpbnRlcm9wL29wdGlvbnMucHJvdG8iRAoPR3JlZXRp\",\n            \"bmdSZXF1ZXN0EgwKBG5hbWUYASABKAk6I5LbBB9pbnRlcm9wLnNhbXBsZXMu\",\n            \"R3JlZXRpbmdSZXF1ZXN0IkoKEEdyZWV0aW5nUmVzcG9uc2USEAoIZ3JlZXRp\",\n            \"bmcYASABKAk6JJLbBCBpbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdSZXNwb25z\",\n            \"ZTKUAwoPR3JlZXRpbmdTZXJ2aWNlEkwKBVVuYXJ5EiAuaW50ZXJvcC5zYW1w\",\n            \"bGVzLkdyZWV0aW5nUmVxdWVzdBohLmludGVyb3Auc2FtcGxlcy5HcmVldGlu\",\n            \"Z1Jlc3BvbnNlElgKD1NlcnZlclN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZTABElgKD0NsaWVudFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBEloKD0R1cGxleFN0cmVhbWluZxIgLmludGVyb3Auc2FtcGxl\",\n            \"cy5HcmVldGluZ1JlcXVlc3QaIS5pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdS\",\n            \"ZXNwb25zZSgBMAEaI5LbBB9pbnRlcm9wLnNhbXBsZXMuR3JlZXRpbmdTZXJ2\",\n            \"aWNlQgmqAgZwbGV4dXNiBnByb3RvMw==\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { global::plexus.OptionsReflection.Descriptor, },\n          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {\n            new pbr::GeneratedClrTypeInfo(typeof(global::plexus.GreetingRequest), global::plexus.GreetingRequest.Parser, new[]{ \"Name\" }, null, null, null),\n            new pbr::GeneratedClrTypeInfo(typeof(global::plexus.GreetingResponse), global::plexus.GreetingResponse.Parser, new[]{ \"Greeting\" }, null, null, null)\n          }));\n    }\n    #endregion\n\n  }\n  #region Messages\n  public sealed partial class GreetingRequest : pb::IMessage<GreetingRequest> {\n    private static readonly pb::MessageParser<GreetingRequest> _parser = new pb::MessageParser<GreetingRequest>(() => new GreetingRequest());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingRequest> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::plexus.GreetingServiceReflection.Descriptor.MessageTypes[0]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest(GreetingRequest other) : this() {\n      name_ = other.name_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingRequest Clone() {\n      return new GreetingRequest(this);\n    }\n\n    /// <summary>Field number for the \"name\" field.</summary>\n    public const int NameFieldNumber = 1;\n    private string name_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Name {\n      get { return name_; }\n      set {\n        name_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingRequest);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingRequest other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Name != other.Name) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Name.Length != 0) hash ^= Name.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Name.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Name);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Name.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingRequest other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Name.Length != 0) {\n        Name = other.Name;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Name = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  public sealed partial class GreetingResponse : pb::IMessage<GreetingResponse> {\n    private static readonly pb::MessageParser<GreetingResponse> _parser = new pb::MessageParser<GreetingResponse>(() => new GreetingResponse());\n    private pb::UnknownFieldSet _unknownFields;\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pb::MessageParser<GreetingResponse> Parser { get { return _parser; } }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public static pbr::MessageDescriptor Descriptor {\n      get { return global::plexus.GreetingServiceReflection.Descriptor.MessageTypes[1]; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    pbr::MessageDescriptor pb::IMessage.Descriptor {\n      get { return Descriptor; }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse() {\n      OnConstruction();\n    }\n\n    partial void OnConstruction();\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse(GreetingResponse other) : this() {\n      greeting_ = other.greeting_;\n      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public GreetingResponse Clone() {\n      return new GreetingResponse(this);\n    }\n\n    /// <summary>Field number for the \"greeting\" field.</summary>\n    public const int GreetingFieldNumber = 1;\n    private string greeting_ = \"\";\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public string Greeting {\n      get { return greeting_; }\n      set {\n        greeting_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override bool Equals(object other) {\n      return Equals(other as GreetingResponse);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public bool Equals(GreetingResponse other) {\n      if (ReferenceEquals(other, null)) {\n        return false;\n      }\n      if (ReferenceEquals(other, this)) {\n        return true;\n      }\n      if (Greeting != other.Greeting) return false;\n      return Equals(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override int GetHashCode() {\n      int hash = 1;\n      if (Greeting.Length != 0) hash ^= Greeting.GetHashCode();\n      if (_unknownFields != null) {\n        hash ^= _unknownFields.GetHashCode();\n      }\n      return hash;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public override string ToString() {\n      return pb::JsonFormatter.ToDiagnosticString(this);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void WriteTo(pb::CodedOutputStream output) {\n      if (Greeting.Length != 0) {\n        output.WriteRawTag(10);\n        output.WriteString(Greeting);\n      }\n      if (_unknownFields != null) {\n        _unknownFields.WriteTo(output);\n      }\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public int CalculateSize() {\n      int size = 0;\n      if (Greeting.Length != 0) {\n        size += 1 + pb::CodedOutputStream.ComputeStringSize(Greeting);\n      }\n      if (_unknownFields != null) {\n        size += _unknownFields.CalculateSize();\n      }\n      return size;\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(GreetingResponse other) {\n      if (other == null) {\n        return;\n      }\n      if (other.Greeting.Length != 0) {\n        Greeting = other.Greeting;\n      }\n      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n    }\n\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n    public void MergeFrom(pb::CodedInputStream input) {\n      uint tag;\n      while ((tag = input.ReadTag()) != 0) {\n        switch(tag) {\n          default:\n            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n            break;\n          case 10: {\n            Greeting = input.ReadString();\n            break;\n          }\n        }\n      }\n    }\n\n  }\n\n  #endregion\n\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-cs-options.approved.txt",
    "content": "// <auto-generated>\n//     Generated by the protocol buffer compiler.  DO NOT EDIT!\n//     source: interop/options.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\n\nusing pb = global::Google.Protobuf;\nusing pbc = global::Google.Protobuf.Collections;\nusing pbr = global::Google.Protobuf.Reflection;\nusing scg = global::System.Collections.Generic;\nnamespace plexus {\n\n  /// <summary>Holder for reflection information generated from interop/options.proto</summary>\n  public static partial class OptionsReflection {\n\n    #region Descriptor\n    /// <summary>File descriptor for interop/options.proto</summary>\n    public static pbr::FileDescriptor Descriptor {\n      get { return descriptor; }\n    }\n    private static pbr::FileDescriptor descriptor;\n\n    static OptionsReflection() {\n      byte[] descriptorData = global::System.Convert.FromBase64String(\n          string.Concat(\n            \"ChVpbnRlcm9wL29wdGlvbnMucHJvdG8SB2ludGVyb3AaIGdvb2dsZS9wcm90\",\n            \"b2J1Zi9kZXNjcmlwdG9yLnByb3RvOjQKCm1lc3NhZ2VfaWQSHy5nb29nbGUu\",\n            \"cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsksgASgJOjQKCnNlcnZpY2VfaWQS\",\n            \"Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMYsksgASgJOjIKCW1l\",\n            \"dGhvZF9pZBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLJLIAEo\",\n            \"CUIJqgIGcGxleHVzYgZwcm90bzM=\"));\n      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n          new pbr::FileDescriptor[] { pbr::FileDescriptor.DescriptorProtoFileDescriptor, },\n          new pbr::GeneratedClrTypeInfo(null, null));\n    }\n    #endregion\n\n  }\n}\n\n#endregion Designer generated code\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-cs-service.approved.txt",
    "content": "// <auto-generated>\n// \tGenerated by the Plexus Interop compiler.  DO NOT EDIT!\n// \tsource: interop\\samples\\greeting_service.proto\n// </auto-generated>\n#pragma warning disable 1591, 0612, 3021\n#region Designer generated code\nnamespace plexus {\n\t\n\tusing System;\n\tusing global::Plexus;\n\tusing global::Plexus.Channels;\n\tusing global::Plexus.Interop;\n\tusing global::System.Threading.Tasks;\n\t\t\t\t\t\n\tpublic static partial class GreetingService {\n\t\t\n\t\tpublic const string Id = \"interop.samples.GreetingService\";\t\t\t\n\t\tpublic const string UnaryMethodId = \"Unary\";\n\t\tpublic const string ServerStreamingMethodId = \"ServerStreaming\";\n\t\tpublic const string ClientStreamingMethodId = \"ClientStreaming\";\n\t\tpublic const string DuplexStreamingMethodId = \"DuplexStreaming\";\n\t\t\n\t\tpublic static readonly GreetingService.Descriptor DefaultDescriptor = CreateDescriptor();\n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor() {\n\t\t\treturn new GreetingService.Descriptor();\n\t\t} \n\t\t\n\t\tpublic static GreetingService.Descriptor CreateDescriptor(string alias) {\n\t\t\treturn new GreetingService.Descriptor(alias);\n\t\t}\t\t\t\t\n\t\n\t\tpublic partial interface IUnaryProxy {\n\t\t\tIUnaryMethodCall<global::plexus.GreetingResponse> Unary(global::plexus.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingProxy {\n\t\t\tIServerStreamingMethodCall<global::plexus.GreetingResponse> ServerStreaming(global::plexus.GreetingRequest request);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingProxy {\n\t\t\tIClientStreamingMethodCall<global::plexus.GreetingRequest, global::plexus.GreetingResponse> ClientStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingProxy {\n\t\t\tIDuplexStreamingMethodCall<global::plexus.GreetingRequest, global::plexus.GreetingResponse> DuplexStreaming();\n\t\t}\n\t\t\n\t\tpublic partial interface IUnaryImpl {\n\t\t\tTask<global::plexus.GreetingResponse> Unary(global::plexus.GreetingRequest request, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IServerStreamingImpl {\n\t\t\tTask ServerStreaming(global::plexus.GreetingRequest request, IWritableChannel<global::plexus.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IClientStreamingImpl {\n\t\t\tTask<global::plexus.GreetingResponse> ClientStreaming(IReadableChannel<global::plexus.GreetingRequest> requestStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic partial interface IDuplexStreamingImpl {\n\t\t\tTask DuplexStreaming(IReadableChannel<global::plexus.GreetingRequest> requestStream, IWritableChannel<global::plexus.GreetingResponse> responseStream, MethodCallContext context);\n\t\t}\n\t\t\n\t\tpublic sealed partial class Descriptor {\n\t\t\n\t\t\tpublic UnaryMethod<global::plexus.GreetingRequest, global::plexus.GreetingResponse> UnaryMethod {get; private set; }\n\t\t\tpublic ServerStreamingMethod<global::plexus.GreetingRequest, global::plexus.GreetingResponse> ServerStreamingMethod {get; private set; }\n\t\t\tpublic ClientStreamingMethod<global::plexus.GreetingRequest, global::plexus.GreetingResponse> ClientStreamingMethod {get; private set; }\n\t\t\tpublic DuplexStreamingMethod<global::plexus.GreetingRequest, global::plexus.GreetingResponse> DuplexStreamingMethod {get; private set; }\n\t\t\t\n\t\t\tpublic Descriptor() {\t\t\t\t\n\t\t\t\tUnaryMethod = Method.Unary<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, DuplexStreamingMethodId);\n\t\t\t}\n\t\t\n\t\t\tpublic Descriptor(string alias) {\n\t\t\t\tUnaryMethod = Method.Unary<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, alias, UnaryMethodId);\n\t\t\t\tServerStreamingMethod = Method.ServerStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, alias, ServerStreamingMethodId);\n\t\t\t\tClientStreamingMethod = Method.ClientStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, alias, ClientStreamingMethodId);\n\t\t\t\tDuplexStreamingMethod = Method.DuplexStreaming<global::plexus.GreetingRequest, global::plexus.GreetingResponse>(Id, alias, DuplexStreamingMethodId);\n\t\t\t}\n\t\t}\n\t}\n\t\t\t\t\t\n}\n#endregion Designer generated code\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-json.approved.txt",
    "content": "{\n\t\"messages\": {\n\t  \"nested\": {\n\t    \"google\": {\n\t      \"nested\": {\n\t        \"protobuf\": {\n\t          \"options\": {\n\t            \"go_package\": \"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor\",\n\t            \"java_package\": \"com.google.protobuf\",\n\t            \"java_outer_classname\": \"DescriptorProtos\",\n\t            \"csharp_namespace\": \"Google.Protobuf.Reflection\",\n\t            \"objc_class_prefix\": \"GPB\",\n\t            \"optimize_for\": \"SPEED\"\n\t          },\n\t          \"nested\": {\n\t            \"FileDescriptorSet\": {\n\t              \"fields\": {\n\t                \"file\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FileDescriptorProto\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"FileDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"package\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"dependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"publicDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"weakDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 11,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"messageType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 5\n\t                },\n\t                \"service\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ServiceDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 7\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FileOptions\",\n\t                  \"id\": 8\n\t                },\n\t                \"sourceCodeInfo\": {\n\t                  \"type\": \"SourceCodeInfo\",\n\t                  \"id\": 9\n\t                },\n\t                \"syntax\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 12\n\t                }\n\t              }\n\t            },\n\t            \"DescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"field\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"nestedType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 3\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"extensionRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ExtensionRange\",\n\t                  \"id\": 5\n\t                },\n\t                \"oneofDecl\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"OneofDescriptorProto\",\n\t                  \"id\": 8\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MessageOptions\",\n\t                  \"id\": 7\n\t                },\n\t                \"reservedRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ReservedRange\",\n\t                  \"id\": 9\n\t                },\n\t                \"reservedName\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"ExtensionRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"options\": {\n\t                      \"type\": \"ExtensionRangeOptions\",\n\t                      \"id\": 3\n\t                    }\n\t                  }\n\t                },\n\t                \"ReservedRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"ExtensionRangeOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 3\n\t                },\n\t                \"label\": {\n\t                  \"type\": \"Label\",\n\t                  \"id\": 4\n\t                },\n\t                \"type\": {\n\t                  \"type\": \"Type\",\n\t                  \"id\": 5\n\t                },\n\t                \"typeName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 6\n\t                },\n\t                \"extendee\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"defaultValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 7\n\t                },\n\t                \"oneofIndex\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 9\n\t                },\n\t                \"jsonName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FieldOptions\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Type\": {\n\t                  \"values\": {\n\t                    \"TYPE_DOUBLE\": 1,\n\t                    \"TYPE_FLOAT\": 2,\n\t                    \"TYPE_INT64\": 3,\n\t                    \"TYPE_UINT64\": 4,\n\t                    \"TYPE_INT32\": 5,\n\t                    \"TYPE_FIXED64\": 6,\n\t                    \"TYPE_FIXED32\": 7,\n\t                    \"TYPE_BOOL\": 8,\n\t                    \"TYPE_STRING\": 9,\n\t                    \"TYPE_GROUP\": 10,\n\t                    \"TYPE_MESSAGE\": 11,\n\t                    \"TYPE_BYTES\": 12,\n\t                    \"TYPE_UINT32\": 13,\n\t                    \"TYPE_ENUM\": 14,\n\t                    \"TYPE_SFIXED32\": 15,\n\t                    \"TYPE_SFIXED64\": 16,\n\t                    \"TYPE_SINT32\": 17,\n\t                    \"TYPE_SINT64\": 18\n\t                  }\n\t                },\n\t                \"Label\": {\n\t                  \"values\": {\n\t                    \"LABEL_OPTIONAL\": 1,\n\t                    \"LABEL_REQUIRED\": 2,\n\t                    \"LABEL_REPEATED\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"OneofOptions\",\n\t                  \"id\": 2\n\t                }\n\t              }\n\t            },\n\t            \"EnumDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"value\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumValueDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"EnumValueDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumValueOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"ServiceDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"method\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"MethodDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"ServiceOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"MethodDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"inputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"outputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MethodOptions\",\n\t                  \"id\": 4\n\t                },\n\t                \"clientStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"serverStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"FileOptions\": {\n\t              \"fields\": {\n\t                \"javaPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"javaOuterClassname\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                },\n\t                \"javaMultipleFiles\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenerateEqualsAndHash\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 20,\n\t                  \"options\": {\n\t                    \"deprecated\": true\n\t                  }\n\t                },\n\t                \"javaStringCheckUtf8\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 27,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"optimizeFor\": {\n\t                  \"type\": \"OptimizeMode\",\n\t                  \"id\": 9,\n\t                  \"options\": {\n\t                    \"default\": \"SPEED\"\n\t                  }\n\t                },\n\t                \"goPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 11\n\t                },\n\t                \"ccGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 16,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 17,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"pyGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 18,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"phpGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 19,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 23,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"ccEnableArenas\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 31,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"objcClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 36\n\t                },\n\t                \"csharpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 37\n\t                },\n\t                \"swiftPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 39\n\t                },\n\t                \"phpClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 40\n\t                },\n\t                \"phpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 41\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  38,\n\t                  38\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"OptimizeMode\": {\n\t                  \"values\": {\n\t                    \"SPEED\": 1,\n\t                    \"CODE_SIZE\": 2,\n\t                    \"LITE_RUNTIME\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"MessageOptions\": {\n\t              \"fields\": {\n\t                \"messageSetWireFormat\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"noStandardDescriptorAccessor\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"mapEntry\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 7\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  8,\n\t                  8\n\t                ],\n\t                [\n\t                  9,\n\t                  9\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldOptions\": {\n\t              \"fields\": {\n\t                \"ctype\": {\n\t                  \"type\": \"CType\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": \"STRING\"\n\t                  }\n\t                },\n\t                \"packed\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"jstype\": {\n\t                  \"type\": \"JSType\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": \"JS_NORMAL\"\n\t                  }\n\t                },\n\t                \"lazy\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"weak\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  4,\n\t                  4\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"CType\": {\n\t                  \"values\": {\n\t                    \"STRING\": 0,\n\t                    \"CORD\": 1,\n\t                    \"STRING_PIECE\": 2\n\t                  }\n\t                },\n\t                \"JSType\": {\n\t                  \"values\": {\n\t                    \"JS_NORMAL\": 0,\n\t                    \"JS_STRING\": 1,\n\t                    \"JS_NUMBER\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumOptions\": {\n\t              \"fields\": {\n\t                \"allowAlias\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  5,\n\t                  5\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumValueOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"ServiceOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"MethodOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"idempotencyLevel\": {\n\t                  \"type\": \"IdempotencyLevel\",\n\t                  \"id\": 34,\n\t                  \"options\": {\n\t                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"IdempotencyLevel\": {\n\t                  \"values\": {\n\t                    \"IDEMPOTENCY_UNKNOWN\": 0,\n\t                    \"NO_SIDE_EFFECTS\": 1,\n\t                    \"IDEMPOTENT\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"UninterpretedOption\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"NamePart\",\n\t                  \"id\": 2\n\t                },\n\t                \"identifierValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"positiveIntValue\": {\n\t                  \"type\": \"uint64\",\n\t                  \"id\": 4\n\t                },\n\t                \"negativeIntValue\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 5\n\t                },\n\t                \"doubleValue\": {\n\t                  \"type\": \"double\",\n\t                  \"id\": 6\n\t                },\n\t                \"stringValue\": {\n\t                  \"type\": \"bytes\",\n\t                  \"id\": 7\n\t                },\n\t                \"aggregateValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"NamePart\": {\n\t                  \"fields\": {\n\t                    \"namePart\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"isExtension\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"bool\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"SourceCodeInfo\": {\n\t              \"fields\": {\n\t                \"location\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Location\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Location\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"span\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"leadingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"trailingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"leadingDetachedComments\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 6\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GeneratedCodeInfo\": {\n\t              \"fields\": {\n\t                \"annotation\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Annotation\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Annotation\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"sourceFile\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"begin\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 4\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"interop\": {\n\t      \"options\": {\n\t        \"csharp_namespace\": \"plexus\"\n\t      },\n\t      \"nested\": {\n\t        \"AppLauncherService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLauncherService\"\n\t          },\n\t          \"methods\": {\n\t            \"Launch\": {\n\t              \"requestType\": \"AppLaunchRequest\",\n\t              \"responseType\": \"AppLaunchResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchParamsJson\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"suggestedAppInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 4\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchReferrer\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchReferrer\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"messageId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MessageOptions\"\n\t        },\n\t        \"serviceId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.ServiceOptions\"\n\t        },\n\t        \"methodId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MethodOptions\"\n\t        },\n\t        \"samples\": {\n\t          \"options\": {\n\t            \"csharp_namespace\": \"plexus\"\n\t          },\n\t          \"nested\": {\n\t            \"GreetingService\": {\n\t              \"options\": {\n\t                \"(.interop.service_id)\": \"interop.samples.GreetingService\"\n\t              },\n\t              \"methods\": {\n\t                \"Unary\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"responseType\": \"GreetingResponse\"\n\t                },\n\t                \"ServerStreaming\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"responseType\": \"GreetingResponse\",\n\t                  \"responseStream\": true\n\t                },\n\t                \"ClientStreaming\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"GreetingResponse\"\n\t                },\n\t                \"DuplexStreaming\": {\n\t                  \"requestType\": \"GreetingRequest\",\n\t                  \"requestStream\": true,\n\t                  \"responseType\": \"GreetingResponse\",\n\t                  \"responseStream\": true\n\t                }\n\t              }\n\t            },\n\t            \"GreetingRequest\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.samples.GreetingRequest\"\n\t              },\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"GreetingResponse\": {\n\t              \"options\": {\n\t                \"(.interop.message_id)\": \"interop.samples.GreetingResponse\"\n\t              },\n\t              \"fields\": {\n\t                \"greeting\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            }\n\t          }\n\t        },\n\t        \"ApplicationOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedServiceOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedServiceOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedMethodOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"uint32\",\n\t              \"id\": 3\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedMethodOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ApplicationLaunchOnCallMode\": {\n\t          \"options\": {\n\t            \"allow_alias\": true\n\t          },\n\t          \"values\": {\n\t            \"IF_NOT_LAUNCHED\": 0,\n\t            \"DEFAULT\": 0,\n\t            \"ALWAYS\": 1,\n\t            \"ENABLED\": 1,\n\t            \"NEVER\": 2,\n\t            \"DISABLED\": 2\n\t          }\n\t        },\n\t        \"UniqueId\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.UniqueId\"\n\t          },\n\t          \"fields\": {\n\t            \"lo\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 1\n\t            },\n\t            \"hi\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchMode\": {\n\t          \"values\": {\n\t            \"SINGLE_INSTANCE\": 0,\n\t            \"MULTI_INSTANCE\": 1\n\t          }\n\t        }\n\t      }\n\t    }\n\t  }\n\t}\n\t,\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLauncherService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"interop.samples.GreetingRequest\",\n\t\t\t\t\t\"response\": \"interop.samples.GreetingResponse\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.samples.GreetingService\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"interop.ElectronAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingClient\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"interop.samples.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.GreetingServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greeting from .NET app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greetings from .NET app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.samples.GreetingClient\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Greeting service implemented by .NET app\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.samples.WebGreetingServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.samples.GreetingService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Greeting from Electron Web app\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.samples.GreetingClient\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-ts-client.approved.txt",
    "content": "import { InternalGenericClientApi, ClientApiBuilder, MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as plexus from './plexus-messages';\n\n/**\n *  Proxy interface of GreetingService service, to be consumed by Client API\n */\nexport abstract class GreetingServiceProxy {\n\n    public abstract unary(request: plexus.interop.samples.IGreetingRequest): Promise<plexus.interop.samples.IGreetingResponse>;\n    \n    public abstract serverStreaming(request: plexus.interop.samples.IGreetingRequest, responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<InvocationClient>;\n    \n    public abstract clientStreaming(responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<StreamingInvocationClient<plexus.interop.samples.IGreetingRequest>>;\n    \n    public abstract duplexStreaming(responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<StreamingInvocationClient<plexus.interop.samples.IGreetingRequest>>;\n\n}\n\n/**\n *  Internal Proxy implementation for GreetingService service\n */\nexport class GreetingServiceProxyImpl implements GreetingServiceProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public unary(request: plexus.interop.samples.IGreetingRequest): Promise<plexus.interop.samples.IGreetingResponse> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'Unary',\n            serviceId: 'interop.samples.GreetingService'\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.interop.samples.GreetingRequest, plexus.interop.samples.GreetingResponse);\n        });\n    }\n    \n    public serverStreaming(request: plexus.interop.samples.IGreetingRequest, responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<InvocationClient> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ServerStreaming',\n            serviceId: 'interop.samples.GreetingService'\n        };\n        return this.genericClient.sendServerStreamingRequest(\n            invocationInfo,\n            request,\n            responseObserver,\n            plexus.interop.samples.GreetingRequest, plexus.interop.samples.GreetingResponse\n        );\n    }\n    \n    public clientStreaming(responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<StreamingInvocationClient<plexus.interop.samples.IGreetingRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ClientStreaming',\n            serviceId: 'interop.samples.GreetingService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.interop.samples.GreetingRequest, plexus.interop.samples.GreetingResponse);\n    }\n    \n    public duplexStreaming(responseObserver: InvocationObserver<plexus.interop.samples.IGreetingResponse>): Promise<StreamingInvocationClient<plexus.interop.samples.IGreetingRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'DuplexStreaming',\n            serviceId: 'interop.samples.GreetingService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.interop.samples.GreetingRequest, plexus.interop.samples.GreetingResponse);\n    }\n\n}\n\n/**\n * Main client API\n */\nexport interface GreetingClientClient extends GenericClientApi  {\n\n    getGreetingServiceProxy(): GreetingServiceProxy;\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass GreetingClientClientImpl extends GenericClientApiBase implements GreetingClientClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n        private readonly greetingServiceProxy: GreetingServiceProxy\n    ) {\n        super(genericClient);\n    }\n\n    public getGreetingServiceProxy(): GreetingServiceProxy {\n        return this.greetingServiceProxy;\n    }\n\n}\n\n\n/**\n * Client API builder\n */\nexport class GreetingClientClientBuilder implements ClientApiBuilder<GreetingClientClient, GreetingClientClientBuilder> {\n\n    protected genericBuilder: GenericClientApiBuilder =\n        new ContainerAwareClientAPIBuilder()\n            .withApplicationId('interop.samples.GreetingClient');\n\n\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): GreetingClientClientBuilder {\n        this.genericBuilder.withClientApiDecorator(clientApiDecorator);\n        return this;\n    }\n\n    public withClientExtension(extension: (builder: ClientApiBuilder<GreetingClientClient, GreetingClientClientBuilder>) => void): GreetingClientClientBuilder {\n        extension(this);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): GreetingClientClientBuilder {\n        this.genericBuilder.withTransportConnectionProvider(provider);\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): GreetingClientClientBuilder {\n        this.genericBuilder.withAppInstanceId(appInstanceId);\n        return this;\n    }\n\n    public withAppId(appId: string): GreetingClientClientBuilder {\n        this.genericBuilder.withApplicationId(appId);\n        return this;\n    }\n\n    public connect(): Promise<GreetingClientClient> {\n        return this.genericBuilder\n            .connect()\n            .then(genericClient => new GreetingClientClientImpl(\n                genericClient,\n                new GreetingServiceProxyImpl(genericClient)\n                ));\n    }\n}\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-ts-definitions.approved.txt",
    "content": "import * as $protobuf from \"protobufjs\";\n\n/** Namespace interop. */\nexport namespace interop {\n\n    /** Namespace samples. */\n    namespace samples {\n\n        /** Represents a GreetingService */\n        class GreetingService extends $protobuf.rpc.Service {\n\n            /**\n             * Constructs a new GreetingService service.\n             * @param rpcImpl RPC implementation\n             * @param [requestDelimited=false] Whether requests are length-delimited\n             * @param [responseDelimited=false] Whether responses are length-delimited\n             */\n            constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n            /**\n             * Creates new GreetingService service using the specified rpc implementation.\n             * @param rpcImpl RPC implementation\n             * @param [requestDelimited=false] Whether requests are length-delimited\n             * @param [responseDelimited=false] Whether responses are length-delimited\n             * @returns RPC service. Useful where requests and/or responses are streamed.\n             */\n            public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GreetingService;\n\n            /**\n             * Calls Unary.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public unary(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.UnaryCallback): void;\n\n            /**\n             * Calls Unary.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public unary(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls ServerStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public serverStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.ServerStreamingCallback): void;\n\n            /**\n             * Calls ServerStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public serverStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls ClientStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public clientStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.ClientStreamingCallback): void;\n\n            /**\n             * Calls ClientStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public clientStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls DuplexStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public duplexStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.DuplexStreamingCallback): void;\n\n            /**\n             * Calls DuplexStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public duplexStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n        }\n\n        namespace GreetingService {\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#unary}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type UnaryCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#serverStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type ServerStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#clientStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type ClientStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#duplexStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type DuplexStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n        }\n\n        /** Properties of a GreetingRequest. */\n        interface IGreetingRequest {\n\n            /** GreetingRequest name */\n            name?: (string|null);\n        }\n\n        /** Represents a GreetingRequest. */\n        class GreetingRequest implements IGreetingRequest {\n\n            /**\n             * Constructs a new GreetingRequest.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: interop.samples.IGreetingRequest);\n\n            /** GreetingRequest name. */\n            public name: string;\n\n            /**\n             * Creates a new GreetingRequest instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns GreetingRequest instance\n             */\n            public static create(properties?: interop.samples.IGreetingRequest): interop.samples.GreetingRequest;\n\n            /**\n             * Encodes the specified GreetingRequest message. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @param message GreetingRequest message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: interop.samples.IGreetingRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.samples.GreetingRequest;\n\n            /**\n             * Verifies a GreetingRequest message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a GreetingRequest message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns GreetingRequest\n             */\n            public static fromObject(object: { [k: string]: any }): interop.samples.GreetingRequest;\n\n            /**\n             * Creates a plain object from a GreetingRequest message. Also converts values to other types if specified.\n             * @param message GreetingRequest\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: interop.samples.GreetingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this GreetingRequest to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a GreetingResponse. */\n        interface IGreetingResponse {\n\n            /** GreetingResponse greeting */\n            greeting?: (string|null);\n        }\n\n        /** Represents a GreetingResponse. */\n        class GreetingResponse implements IGreetingResponse {\n\n            /**\n             * Constructs a new GreetingResponse.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: interop.samples.IGreetingResponse);\n\n            /** GreetingResponse greeting. */\n            public greeting: string;\n\n            /**\n             * Creates a new GreetingResponse instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns GreetingResponse instance\n             */\n            public static create(properties?: interop.samples.IGreetingResponse): interop.samples.GreetingResponse;\n\n            /**\n             * Encodes the specified GreetingResponse message. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @param message GreetingResponse message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: interop.samples.IGreetingResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.samples.GreetingResponse;\n\n            /**\n             * Verifies a GreetingResponse message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a GreetingResponse message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns GreetingResponse\n             */\n            public static fromObject(object: { [k: string]: any }): interop.samples.GreetingResponse;\n\n            /**\n             * Creates a plain object from a GreetingResponse message. Also converts values to other types if specified.\n             * @param message GreetingResponse\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: interop.samples.GreetingResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this GreetingResponse to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n    }\n}\n"
  },
  {
    "path": "web/packages/cli/tests/approved/generated-ts-messages.approved.txt",
    "content": "/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.plexus || ($protobuf.roots.plexus = {});\n\n$root.interop = (function() {\n\n    /**\n     * Namespace interop.\n     * @exports interop\n     * @namespace\n     */\n    var interop = {};\n\n    interop.samples = (function() {\n\n        /**\n         * Namespace samples.\n         * @memberof interop\n         * @namespace\n         */\n        var samples = {};\n\n        samples.GreetingService = (function() {\n\n            /**\n             * Constructs a new GreetingService service.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingService\n             * @extends $protobuf.rpc.Service\n             * @constructor\n             * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n             * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n             * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n             */\n            function GreetingService(rpcImpl, requestDelimited, responseDelimited) {\n                $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n            }\n\n            (GreetingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GreetingService;\n\n            /**\n             * Creates new GreetingService service using the specified rpc implementation.\n             * @function create\n             * @memberof interop.samples.GreetingService\n             * @static\n             * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n             * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n             * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n             * @returns {GreetingService} RPC service. Useful where requests and/or responses are streamed.\n             */\n            GreetingService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n                return new this(rpcImpl, requestDelimited, responseDelimited);\n            };\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#unary}.\n             * @memberof interop.samples.GreetingService\n             * @typedef UnaryCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls Unary.\n             * @function unary\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.UnaryCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.unary = function unary(request, callback) {\n                return this.rpcCall(unary, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls Unary.\n             * @function unary\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#serverStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef ServerStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls ServerStreaming.\n             * @function serverStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.ServerStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.serverStreaming = function serverStreaming(request, callback) {\n                return this.rpcCall(serverStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls ServerStreaming.\n             * @function serverStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#clientStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef ClientStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls ClientStreaming.\n             * @function clientStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.ClientStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.clientStreaming = function clientStreaming(request, callback) {\n                return this.rpcCall(clientStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls ClientStreaming.\n             * @function clientStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#duplexStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef DuplexStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls DuplexStreaming.\n             * @function duplexStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.DuplexStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.duplexStreaming = function duplexStreaming(request, callback) {\n                return this.rpcCall(duplexStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls DuplexStreaming.\n             * @function duplexStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            return GreetingService;\n        })();\n\n        samples.GreetingRequest = (function() {\n\n            /**\n             * Properties of a GreetingRequest.\n             * @memberof interop.samples\n             * @interface IGreetingRequest\n             * @property {string|null} [name] GreetingRequest name\n             */\n\n            /**\n             * Constructs a new GreetingRequest.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingRequest.\n             * @implements IGreetingRequest\n             * @constructor\n             * @param {interop.samples.IGreetingRequest=} [properties] Properties to set\n             */\n            function GreetingRequest(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GreetingRequest name.\n             * @member {string} name\n             * @memberof interop.samples.GreetingRequest\n             * @instance\n             */\n            GreetingRequest.prototype.name = \"\";\n\n            /**\n             * Creates a new GreetingRequest instance using the specified properties.\n             * @function create\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.IGreetingRequest=} [properties] Properties to set\n             * @returns {interop.samples.GreetingRequest} GreetingRequest instance\n             */\n            GreetingRequest.create = function create(properties) {\n                return new GreetingRequest(properties);\n            };\n\n            /**\n             * Encodes the specified GreetingRequest message. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @function encode\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.IGreetingRequest} message GreetingRequest message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingRequest.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                return writer;\n            };\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer.\n             * @function decode\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {interop.samples.GreetingRequest} GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingRequest.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.samples.GreetingRequest();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Verifies a GreetingRequest message.\n             * @function verify\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GreetingRequest.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a GreetingRequest message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {interop.samples.GreetingRequest} GreetingRequest\n             */\n            GreetingRequest.fromObject = function fromObject(object) {\n                if (object instanceof $root.interop.samples.GreetingRequest)\n                    return object;\n                var message = new $root.interop.samples.GreetingRequest();\n                if (object.name != null)\n                    message.name = String(object.name);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GreetingRequest message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.GreetingRequest} message GreetingRequest\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GreetingRequest.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.name = \"\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                return object;\n            };\n\n            /**\n             * Converts this GreetingRequest to JSON.\n             * @function toJSON\n             * @memberof interop.samples.GreetingRequest\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GreetingRequest.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return GreetingRequest;\n        })();\n\n        samples.GreetingResponse = (function() {\n\n            /**\n             * Properties of a GreetingResponse.\n             * @memberof interop.samples\n             * @interface IGreetingResponse\n             * @property {string|null} [greeting] GreetingResponse greeting\n             */\n\n            /**\n             * Constructs a new GreetingResponse.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingResponse.\n             * @implements IGreetingResponse\n             * @constructor\n             * @param {interop.samples.IGreetingResponse=} [properties] Properties to set\n             */\n            function GreetingResponse(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GreetingResponse greeting.\n             * @member {string} greeting\n             * @memberof interop.samples.GreetingResponse\n             * @instance\n             */\n            GreetingResponse.prototype.greeting = \"\";\n\n            /**\n             * Creates a new GreetingResponse instance using the specified properties.\n             * @function create\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.IGreetingResponse=} [properties] Properties to set\n             * @returns {interop.samples.GreetingResponse} GreetingResponse instance\n             */\n            GreetingResponse.create = function create(properties) {\n                return new GreetingResponse(properties);\n            };\n\n            /**\n             * Encodes the specified GreetingResponse message. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @function encode\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.IGreetingResponse} message GreetingResponse message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingResponse.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.greeting);\n                return writer;\n            };\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer.\n             * @function decode\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {interop.samples.GreetingResponse} GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingResponse.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.samples.GreetingResponse();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.greeting = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Verifies a GreetingResponse message.\n             * @function verify\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GreetingResponse.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    if (!$util.isString(message.greeting))\n                        return \"greeting: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a GreetingResponse message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {interop.samples.GreetingResponse} GreetingResponse\n             */\n            GreetingResponse.fromObject = function fromObject(object) {\n                if (object instanceof $root.interop.samples.GreetingResponse)\n                    return object;\n                var message = new $root.interop.samples.GreetingResponse();\n                if (object.greeting != null)\n                    message.greeting = String(object.greeting);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GreetingResponse message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.GreetingResponse} message GreetingResponse\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GreetingResponse.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.greeting = \"\";\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    object.greeting = message.greeting;\n                return object;\n            };\n\n            /**\n             * Converts this GreetingResponse to JSON.\n             * @function toJSON\n             * @memberof interop.samples.GreetingResponse\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GreetingResponse.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return GreetingResponse;\n        })();\n\n        return samples;\n    })();\n\n    return interop;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/cli/tests/commands/BaseCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenJsonCommand } from '../../src/commands/GenJsonCommand';\nimport { BaseCommand } from '../../src/commands/BaseCommand';\nimport { baseDir } from '../../src/commands/DefaultOptions';\n\ndescribe('BaseCommand', () => {\n\n    it('Generates example from defined options', () => {\n        const command: BaseCommand = new GenJsonCommand();\n        expect(command.usageExamples()).toBe(' $ plexus gen-json-meta -b metadata -o src/gen -v -e .*options.*');\n    });\n\n    it('Parses verbose flag correctly', () => {\n\n        const command: BaseCommand = new GenJsonCommand();\n\n        expect(command.isVerbose({})).toBe(false);\n        expect(command.isVerbose(null)).toBe(false);\n        expect(command.isVerbose({ verbose: 'false' })).toBe(false);\n\n        expect(command.isVerbose({ verbose: true })).toBe(true);\n        expect(command.isVerbose({ verbose: 'true' })).toBe(true);\n\n    });\n\n    it('Generates option args', () => {\n        const command: BaseCommand = new GenJsonCommand();\n        const args = command.optionArgs({\n            baseDir: 'baseDir',\n            out: 'out'\n        }, '=');\n        expect(args.join(' ')).toBe('--baseDir=baseDir --out=out');\n    });\n\n    it('Fails validation if required option not provided', () => {\n        const command: BaseCommand = new GenJsonCommand();\n        expect(command.validateRequiredOpts([baseDir()], {}).length).toBe(1);\n    });\n\n    it('Passes validation if required option provided', () => {\n        const command: BaseCommand = new GenJsonCommand();\n        expect(command.validateRequiredOpts([baseDir()], {\n            baseDir: 'value'\n        }).length).toBe(0);\n    });\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/GenCSharpCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { prepareOutDir, getTestBaseDir, getTestClientInput, getApprovalsBaseDir, filesEqual } from './setup';\nimport * as path from 'path';\nimport { GenCSharpCommand } from '../../src/commands/GenCSharpCommand';\n\ndescribe('C# Client generation CLI', () => {\n\n    it('Generates C# client and messages definitions', async () => {\n        \n        const testName = 'generated-cs-client';\n        const genCommand = new GenCSharpCommand();\n        const outDir = prepareOutDir(testName);\n        \n        await genCommand.action({\n            out: outDir,\n            baseDir: getTestBaseDir(),\n            input: getTestClientInput(),\n            namespace: 'plexus'\n        });\n\n        expect(await filesEqual(\n            path.join(outDir, 'interop/samples/GreetingClient.app.g.cs'), \n            path.join(getApprovalsBaseDir(), 'generated-cs-client.approved.txt'))).toBeTruthy();\n\n        expect(await filesEqual(\n            path.join(outDir, 'interop/samples/GreetingService.msg.g.cs'), \n            path.join(getApprovalsBaseDir(), 'generated-cs-messages.approved.txt'))).toBeTruthy();\n\n        expect(await filesEqual(\n            path.join(outDir, 'interop/samples/GreetingService.svc.g.cs'), \n            path.join(getApprovalsBaseDir(), 'generated-cs-service.approved.txt'))).toBeTruthy();\n\n        expect(await filesEqual(\n            path.join(outDir, 'interop/Options.msg.g.cs'), \n            path.join(getApprovalsBaseDir(), 'generated-cs-options.approved.txt'))).toBeTruthy();\n\n    }, 15000);\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/GenJsonCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getApprovalsBaseDir, prepareOutDir, getTestBaseDir, filesEqual } from './setup';\nimport { GenJsonCommand } from '../../src/commands/GenJsonCommand';\nimport * as path from 'path';\n\ndescribe('Metadata JSON generation CLI', () => {\n\n    it('Generates JSON with all metadata', async () => {\n\n        const testName = 'generated-json';\n        const genCommand = new GenJsonCommand();\n        const outDir = prepareOutDir(testName);\n        \n        await genCommand.action({\n            out: outDir,\n            baseDir: getTestBaseDir()\n        });\n\n        expect(await filesEqual(\n            path.join(outDir, 'interop.json'), \n            path.join(getApprovalsBaseDir(), 'generated-json.approved.txt'))).toBeTruthy();\n\n    }, 15000);\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/GetTsCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getApprovalsBaseDir, prepareOutDir, getTestBaseDir, getTestClientInput, filesEqual } from './setup';\nimport * as path from 'path';\nimport { GenTsCommand } from '../../src/commands/GenTsCommand';\n\ndescribe('Typescript Client generation CLI', () => {\n\n    it('Generates Client and messages definitions', async () => {\n        \n        const testName = 'generated-ts-client';\n        const genCommand = new GenTsCommand();\n        const outDir = prepareOutDir(testName);\n        \n        await genCommand.action({\n            out: outDir,\n            baseDir: getTestBaseDir(),\n            input: getTestClientInput(),\n            namespace: 'plexus'\n        });\n\n        expect(await filesEqual(\n            path.join(outDir, 'GreetingClientGeneratedClient.ts'), \n            path.join(getApprovalsBaseDir(), 'generated-ts-client.approved.txt'))).toBeTruthy();\n\n        expect(await filesEqual(\n            path.join(outDir, 'plexus-messages.js'), \n            path.join(getApprovalsBaseDir(), 'generated-ts-messages.approved.txt'))).toBeTruthy();\n\n        expect(await filesEqual(\n            path.join(outDir, 'plexus-messages.d.ts'), \n            path.join(getApprovalsBaseDir(), 'generated-ts-definitions.approved.txt'))).toBeTruthy();\n\n    }, 15000);\n\n    it('Handles different proto files', () => {\n        const genCommand = new GenTsCommand();\n        expect(genCommand.protoRegexp.test('src/authservice.proto')).toBeTruthy();\n        expect(genCommand.protoRegexp.test('authservice.proto')).toBeTruthy();\n        expect(genCommand.protoRegexp.test('AuthService_v1.proto')).toBeTruthy();\n        expect(genCommand.protoRegexp.test('src/auth_service.proto')).toBeTruthy();\n    });\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/ListMetaFilesCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { prepareOutDir, getTestBaseDir, getInvalidTestBaseDir } from './setup';\nimport * as path from 'path';\nimport { ListMetaFilesCommand } from '../../src/commands/ListMetaFilesCommand';\nimport { readTextFile } from '../../src/common/files';\n\ndescribe('List metadata files CLI command', () => {\n\n    it('Generates files based on proto file', async () => {\n\n        const testName = 'generated-file-list-proto';\n        const genCommand = new ListMetaFilesCommand();\n        const outDir = prepareOutDir(testName);\n        \n\n        console.log(getInvalidTestBaseDir());\n        \n        await genCommand.action({\n            out: outDir + '/files.json',\n            baseDir: getInvalidTestBaseDir(),\n            input: 'services.proto'\n        });\n\n        expect(await readTextFile(path.join(outDir, 'files.json'))).toMatch('messages');\n\n    }, 15000);\n\n    it('Generates files based on interop file', async () => {\n\n        const testName = 'generated-file-list-interop';\n        const genCommand = new ListMetaFilesCommand();\n        const outDir = prepareOutDir(testName);\n        \n        await genCommand.action({\n            out: outDir + '/files.json',\n            baseDir: getTestBaseDir(),\n            input: 'greeting_client.interop'\n        });\n\n        expect(await readTextFile(path.join(outDir, 'files.json'))).toMatch('greeting_service');\n\n    }, 15000);\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/ValidateMetadataCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { prepareOutDir, getInvalidTestBaseDir } from './setup';\nimport * as path from 'path';\nimport { ValidateMetadataCommand } from '../../src/commands/ValidateMetadataCommand';\nimport { readTextFile } from '../../src/common/files';\n\ndescribe('Metadata Validation CLI', () => {\n\n    it('Validates metadata and prints error to file', async () => {\n\n        const testName = 'generated-json';\n        const genCommand = new ValidateMetadataCommand();\n        const outDir = prepareOutDir(testName);\n        const outFile = path.join(outDir, 'plexus.errors.log');\n        \n        try {\n            await genCommand.action({\n                out: outFile,\n                baseDir: getInvalidTestBaseDir()\n            });   \n            fail('Should finish with error'); \n        } catch (error) {\n            // expect to fail\n        }\n\n        const firstContent = await readTextFile(outFile);\n\n        expect(firstContent)\n            .toContain('Couldn\\'t resolve reference to Service \\'com.db.plexus.interop.dsl.gen.test.services.ExampleService_NotExists\\'');\n\n    }, 15000);\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/ValidateMetatadaPatchCommand.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTestBaseDir } from './setup';\nimport { ValidateMetadataPatchCommand } from '../../src/commands/ValidateMetadataPatchCommand';\n\ndescribe('Metadata Patch Validation', () => {\n\n    it('Doesn\\'t fail on valid update', async () => {\n\n        const genCommand = new ValidateMetadataPatchCommand();\n        \n        await genCommand.action({\n            baseDir: getTestBaseDir(),\n            targetBaseDir: getTestBaseDir()\n        });   \n\n    }, 15000);\n\n});"
  },
  {
    "path": "web/packages/cli/tests/commands/setup.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as path from 'path';\nimport { getBaseDir, readTextFile } from '../../src/common/files';\nimport { mkdirsSync } from 'fs-extra';\n\nexport function getTestBaseDir(): string {\n    return path.resolve(getBaseDir(), '../../../samples/greeting/registry');\n}\n\nexport function getInvalidTestBaseDir(): string {\n    return path.resolve(getBaseDir(), '../../../dsl/gen/test/src/main/resources');\n}\n\nexport function getTestClientInput(): string {\n    return 'greeting_client.interop';\n}\n\nexport function getApprovalsBaseDir(): string {\n    return path.join(getBaseDir(), 'tests/approved');\n}\n\nexport function prepareOutDir(testName: string): string {\n    const outDir = path.join(getBaseDir(), 'dist/gen', testName);\n    mkdirsSync(outDir);\n    return outDir;\n}\n\nexport async function filesEqual(first: string, second: string): Promise<boolean> {\n    const firstContent = await readTextFile(first);\n    const secondContent = await readTextFile(second);\n    return unifyWhiteSpaces(firstContent) === unifyWhiteSpaces(secondContent);\n}\n\nexport function unifyWhiteSpaces(s: string): string {\n    return s.replace(/\\s+/g, ' ');\n}"
  },
  {
    "path": "web/packages/cli/tests/files.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getDistDir } from '../src/common/files';\n\ndescribe('File utilities', () => {\n\n    it('Returns dist folder', () => {\n        expect(getDistDir()).toMatch(/.+[\\\\\\/]{1}dist/g);\n    });\n\n});"
  },
  {
    "path": "web/packages/cli/tests/protoJs.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getPbJsExecPath } from '../src/common/protoJs';\nimport { existsSync } from '../src/common/files';\n\ndescribe('ProtoJS compiler utilities', () => {\n\n    it('It correctly locates pbjs exec path', () => {\n        const execPath = getPbJsExecPath();\n        console.log(execPath);\n        expect(existsSync(execPath)).toBeTruthy();\n        expect(execPath.includes('pbjs')).toBeTruthy();\n    });    \n\n});"
  },
  {
    "path": "web/packages/cli/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noUnusedLocals\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/cli/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\",\n    \"rules\": {\n        \"quotemark\": [\n            true,\n            \"single\"\n        ],\n        \"no-console\": [false]\n    }\n}"
  },
  {
    "path": "web/packages/client/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/client/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/client\",\n  \"version\": \"0.1.0\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"Client for Plexus Interop\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"watch\": \"tsc -w\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"test\": \"jest --coverage --forceExit\",\n    \"gen-client-js\": \"pbjs --force-long -t static-module -r client -w commonjs -o src/gen/internal-client-protocol.js ../../../protocol/Plexus.Interop.proto\",\n    \"gen-client-ts\": \"pbts --force-long -o src/gen/internal-client-protocol.d.ts src/gen/internal-client-protocol.js\",\n    \"gen-client-protocol\": \"npm run gen-client-js && npm run gen-client-ts\"\n  },\n  \"dependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"protobufjs\": \"6.11.3\",\n    \"@types/loglevel\": \"^1.4.29\",\n    \"@types/long\": \"^4.0.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/client-api\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/io\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"loglevel\": \"^1.4.1\",\n    \"long\": \"^4.0.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\",\n    \"typescript-collections\": \"1.2.3\"\n  },\n  \"devDependencies\": {\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"babel-register\": \"^6.23.0\",\n    \"browserify\": \"^14.5.0\",\n    \"chai\": \"^4.1.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"glob\": \"^7.1.2\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"jest-cli\": \"^23.0.0\",\n    \"karma\": \"^1.7.1\",\n    \"minimist\": \"^1.2.0\",\n    \"mocha\": \"^3.5.0\",\n    \"path\": \"^0.12.7\",\n    \"sinon\": \"^2.4.1\",\n    \"trash-cli\": \"^1.4.0\",\n    \"ts-mockito\": \"2.0.2\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"watchify\": \"^3.9.0\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/client/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/client/src/client/ClientDtoUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientError, InvocationMetaInfo, InvocationRequestInfo } from '@plexus-interop/protocol';\nimport { isString } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { ProvidedMethodReference } from '@plexus-interop/client-api';\n\nexport class ClientDtoUtils {\n\n    public static targetInvocationHash(metaInfo: InvocationRequestInfo): string {\n        const alias = !!metaInfo.serviceAlias ? metaInfo.serviceAlias : 'default';\n        return `${metaInfo.serviceId}.${alias}.${metaInfo.methodId}`;\n    }\n\n    public static providedMethodToInvocationInfo(providedMethod: ProvidedMethodReference): InvocationMetaInfo {\n        if (providedMethod.providedService) {\n            return {\n                serviceId: providedMethod.providedService.serviceId || undefined,\n                serviceAlias: providedMethod.providedService.serviceAlias || undefined,\n                methodId: providedMethod.methodId || undefined,\n                applicationId: providedMethod.providedService.applicationId || undefined,\n                connectionId: providedMethod.providedService.connectionId as UniqueId,\n                applicationInstanceId: providedMethod.providedService.applicationInstanceId as UniqueId\n            };\n        } else {\n            return {\n                methodId: providedMethod.methodId || undefined\n            };\n        }\n    }\n\n    public static toError(error: any): ClientError {\n        if (isString(error)) {\n            return new ClientError(error);\n        }\n        const message = error.message && isString(error.message) ? error.message : 'Unknown';\n        const details = error.stack && isString(error.stack) ? error.stack : (error.details && isString(error.details) ? error.details : 'Unknown');\n        return new ClientError(message, details);\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/AnonymousSubscription.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface AnonymousSubscription {\n    unsubscribe(): void;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/BaseInvocationClientImpl.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InvocationClient } from './InvocationClient';\nimport { Invocation } from '../generic/Invocation';\nimport { clientProtocol as plexus, SuccessCompletion, ClientError, CancelledCompletion, ErrorCompletion } from '@plexus-interop/protocol';\nimport { Logger } from '@plexus-interop/common';\n\nexport abstract class BaseInvocationClientImpl implements InvocationClient {\n\n    constructor(protected invocation: Invocation, protected log: Logger) { }\n\n    public async error(clientError: ClientError): Promise<void> {\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Client reported error, closing invocation`, JSON.stringify(clientError));\n        }\n        await this.close(new ErrorCompletion(clientError));\n    }\n\n    public async cancel(): Promise<void> {\n        this.log.debug(`Client cancelled operation, closing invocation`);\n        await this.close(new CancelledCompletion());\n    }\n\n    protected async close(completion: plexus.ICompletion = new SuccessCompletion()): Promise<void> {\n        await this.invocation.close(completion);\n    }\n}"
  },
  {
    "path": "web/packages/client/src/client/api/DelegateInvocationObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DelegateChannelObserver } from '@plexus-interop/transport-common';\nimport { InvocationObserver, InvocationChannelObserver } from '../generic';\nimport { AnonymousSubscription } from '@plexus-interop/common';\n\nexport class DelegateInvocationObserver<T> extends DelegateChannelObserver<T> implements InvocationChannelObserver<AnonymousSubscription, T> {\n    \n    public constructor(\n        private readonly base: InvocationObserver<T>, \n        subscriptionHandler: (subscription: AnonymousSubscription) => void, \n        startFailedHandler?: (error: any) => void) {\n        \n        super(base, subscriptionHandler, startFailedHandler);\n        \n    }\n\n    public streamCompleted(): void {\n        this.base.streamCompleted();\n    }\n}"
  },
  {
    "path": "web/packages/client/src/client/api/InvocationClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientError } from '@plexus-interop/protocol';\n\nexport interface InvocationClient {\n\n    error(clientError: ClientError): Promise<void>;\n\n    cancel(): Promise<void>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/LoggingInvocationObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger } from '@plexus-interop/common';\nimport { InvocationObserver } from '../generic';\n\nexport class LoggingInvocationObserver implements InvocationObserver<ArrayBuffer> {\n\n    constructor(private readonly baseObserver: InvocationObserver<ArrayBuffer>, private readonly log: Logger) { }\n\n    public streamCompleted(): void {\n        this.log.trace('Stream completed');\n        this.baseObserver.streamCompleted();\n    }\n\n    public next(payload: ArrayBuffer): void {\n        this.log.trace(`Response payload of ${payload.byteLength} received`);\n        this.baseObserver.next(payload);\n    }\n\n    public error(e: any): void {\n        this.log.error(`Error received`, e);\n        this.baseObserver.error(e);\n    }\n\n    public complete(): void {\n        this.log.trace(`Completion received`);\n        this.baseObserver.complete();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/ValueHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ValueHandler<T> {\n    value: (value: T) => void;\n    error: (err: any) => void;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/container/ConnectionDetails.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WsConnectionDetails } from './WsConnectionDetails';\n\nexport interface ConnectionDetails {\n    ws: WsConnectionDetails;\n    appInstanceId?: string;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/container/ConnectionDetailsService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionDetails } from './ConnectionDetails';\n\nexport interface ConnectionDetailsService {\n    getConnectionDetails(): Promise<ConnectionDetails>;\n    getMetadataUrl(): Promise<string>;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/container/ContainerAwareClientAPIBuilder.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClientApiBuilder, GenericClientApi } from '../generic';\nimport { ConnectionDetailsService } from './ConnectionDetailsService';\nimport { getBaseWsUrl } from './WsConnectionDetails';\nimport { DefaultConnectionDetailsService } from './DefaultConnectionDetailsService';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\n\nexport class ContainerAwareClientAPIBuilder extends GenericClientApiBuilder {\n\n    public constructor(private readonly connectionDetailsService: ConnectionDetailsService = new DefaultConnectionDetailsService()) {\n        super();\n    }\n\n    public async connect(): Promise<GenericClientApi> {\n        if (!this.applicationInstanceId || !this.transportConnectionProvider) {\n            try {\n                const details = await this.connectionDetailsService.getConnectionDetails();\n                if (!this.applicationInstanceId && details.appInstanceId) {\n                    this.log.info('Using App instance ID from container');\n                    this.applicationInstanceId = UniqueId.fromString(details.appInstanceId);\n                }\n                if (!this.transportConnectionProvider && (details.ws && details.ws.port)) {\n                    this.log.info('Transport connection provider from container');\n                    this.transportConnectionProvider = () => new WebSocketConnectionFactory(new WebSocket(getBaseWsUrl(details.ws))).connect();\n                }\n            } catch (e) {\n                this.log.info('Failed to discover container connection details', e);\n            }\n        }\n        return super.connect();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/container/DefaultConnectionDetailsService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionDetailsService } from './ConnectionDetailsService';\nimport { ConnectionDetails } from './ConnectionDetails';\nimport { getBaseWsUrl } from './WsConnectionDetails';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\n\nexport class DefaultConnectionDetailsService implements ConnectionDetailsService {\n\n    private readonly log: Logger = LoggerFactory.getLogger('DefaultConnectionDetailsService');\n\n    public constructor(private readonly connectionDetailsFactory?: () => Promise<ConnectionDetails>) {\n    }\n\n    public getConnectionDetails(): Promise<ConnectionDetails> {\n        return this.getConnectionDetailsFactory()();\n    }\n\n    public getMetadataUrl(): Promise<string> {\n        return this.getConnectionDetails()\n            .then(details => this.getDefaultUrl(getBaseWsUrl(details.ws)));\n    }\n\n    public getDefaultUrl(baseUrl: string): string {\n        return `${baseUrl}/metadata/interop`;\n    }\n\n    private getConnectionDetailsFactory(): () => Promise<ConnectionDetails> {\n        if (this.connectionDetailsFactory) {\n            return this.connectionDetailsFactory;\n        }\n        const globalObj = self as any;\n        if (globalObj.plexus && globalObj.plexus.getConnectionDetails) {\n            this.log.info('Detected connection details service, provided by container');\n            return globalObj.plexus.getConnectionDetails;\n        }\n        throw new Error('Container is not providing \\'self.plexus.getConnectionDetails(): Promise<ConnectionDetails>\\' API');\n    }\n}"
  },
  {
    "path": "web/packages/client/src/client/api/container/WsConnectionDetails.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface WsConnectionDetails {\n    port: number;\n    wssPort?: number;\n}\n\nexport function getBaseWsUrl(details: WsConnectionDetails): string {\n    return details.wssPort\n        ? `wss://127.0.0.1:${details.wssPort}`\n        : `ws://127.0.0.1:${details.port}`;\n}\n"
  },
  {
    "path": "web/packages/client/src/client/api/container/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './ContainerAwareClientAPIBuilder';\nexport * from './DefaultConnectionDetailsService';\n"
  },
  {
    "path": "web/packages/client/src/client/api/generic/ClientApiBuilder.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InternalGenericClientApi } from './internal';\nimport { GenericClientApi } from './GenericClientApi';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\n\nexport interface ClientApiBuilder<ClientType, BuilderType extends ClientApiBuilder<ClientType, any>> {\n    connect(): Promise<ClientType>;\n    withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): BuilderType;\n    withClientExtension(extension: (builder: ClientApiBuilder<ClientType, BuilderType>) => void): BuilderType;\n    withTransportConnectionProvider(provider: () => Promise<TransportConnection>): BuilderType;\n    withAppInstanceId(appInstanceId: UniqueId): BuilderType;\n    withAppId(appId: string): BuilderType;\n}\n"
  },
  {
    "path": "web/packages/client/src/client/api/generic/GenericClientApi.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ServiceDiscoveryRequest } from '@plexus-interop/client-api';\nimport { ServiceDiscoveryResponse } from '@plexus-interop/client-api';\nimport { StreamingInvocationClient } from './handlers/streaming/StreamingInvocationClient';\nimport { InvocationClient } from './../InvocationClient';\nimport { ValueHandler } from './../ValueHandler';\nimport { InvocationRequestInfo } from '@plexus-interop/protocol';\nimport { Completion } from '@plexus-interop/client-api';\nimport { MethodDiscoveryRequest } from '@plexus-interop/client-api';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\nimport { GenericRequest } from '@plexus-interop/client-api';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { InvocationObserver } from '../../generic';\n\nexport enum Feature {\n    SEND_UNARY = 'SEND_UNARY',\n    SEND_RAW_UNARY = 'SEND_RAW_UNARY',\n    SEND_BIDI_STREAM = 'SEND_BIDI_STREAM',\n    SEND_RAW_BIDI_STREAM = 'SEND_RAW_BIDI_STREAM',\n    SEND_SERVER_STREAM = 'SEND_SERVER_STREAM',\n    SEND_RAW_SERVER_STREAM = 'SEND_RAW_SERVER_STREAM',\n    DISCOVER_SERVICE = 'DISCOVER_SERVICE',\n    DISCOVER_METHOD = 'DISCOVER_METHOD'\n}\n\nexport interface GenericClientApi {\n\n    getApplicationId(): string;\n\n    getApplicationInstanceId(): UniqueId;\n\n    getConnectionId(): UniqueId;\n\n    sendUnaryRequest(invocationInfo: GenericRequest, request: any, responseHandler: ValueHandler<any>, requestType: any, responseType: any): Promise<InvocationClient>;\n\n    sendRawUnaryRequest(invocationInfo: GenericRequest, request: ArrayBuffer, responseHandler: ValueHandler<ArrayBuffer>): Promise<InvocationClient>;\n\n    sendBidirectionalStreamingRequest(invocationInfo: GenericRequest, responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<StreamingInvocationClient<any>>;\n\n    sendRawBidirectionalStreamingRequest(invocationInfo: GenericRequest, responseObserver: InvocationObserver<ArrayBuffer>): Promise<StreamingInvocationClient<ArrayBuffer>>;\n\n    sendServerStreamingRequest(invocationInfo: GenericRequest, request: any, responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<InvocationClient>;\n\n    sendRawServerStreamingRequest(\n        invocationInfo: InvocationRequestInfo,\n        request: ArrayBuffer,\n        responseObserver: InvocationObserver<ArrayBuffer>): Promise<InvocationClient>;\n\n    discoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse>;\n\n    discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse>;\n\n    disconnect(completion?: Completion): Promise<void>;\n\n    supported(apiFeature: Feature): boolean;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/GenericClientApiBase.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClientApi, Feature } from './GenericClientApi';\nimport { UniqueId, InvocationRequestInfo, Completion } from '@plexus-interop/protocol';\nimport { GenericRequest, ServiceDiscoveryRequest, MethodDiscoveryRequest, MethodDiscoveryResponse, ServiceDiscoveryResponse } from '@plexus-interop/client-api';\nimport { ValueHandler, InvocationClient } from '../';\nimport { StreamingInvocationClient } from './handlers/streaming/StreamingInvocationClient';\nimport { InvocationObserver } from '../../generic';\n\n/**\n * Base class for all generated clients\n *\n */\nexport abstract class GenericClientApiBase implements GenericClientApi {\n\n    public constructor(protected readonly client: GenericClientApi) { }\n\n    public getApplicationId(): string {\n        return this.client.getApplicationId();\n    }\n\n    public getApplicationInstanceId(): UniqueId {\n        return this.client.getApplicationInstanceId();\n    }\n\n    public supported(apiFeature: Feature): boolean {\n        return this.client.supported(apiFeature);\n    }\n\n    public getConnectionId(): UniqueId {\n        return this.client.getConnectionId();\n    }\n\n    public sendUnaryRequest(invocationInfo: GenericRequest, request: any, responseHandler: ValueHandler<any>, requestType: any, responseType: any): Promise<InvocationClient> {\n        return this.client.sendUnaryRequest(invocationInfo, request, responseHandler, requestType, responseType);\n    }\n\n    public sendRawUnaryRequest(invocationInfo: GenericRequest, request: ArrayBuffer, responseHandler: ValueHandler<ArrayBuffer>): Promise<InvocationClient> {\n        return this.client.sendRawUnaryRequest(invocationInfo, request, responseHandler);\n    }\n\n    public sendBidirectionalStreamingRequest(invocationInfo: GenericRequest, responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<StreamingInvocationClient<any>> {\n        return this.client.sendBidirectionalStreamingRequest(invocationInfo, responseObserver, requestType, responseType);\n    }\n\n    public sendRawBidirectionalStreamingRequest(invocationInfo: GenericRequest, responseObserver: InvocationObserver<ArrayBuffer>): Promise<StreamingInvocationClient<ArrayBuffer>> {\n        return this.client.sendRawBidirectionalStreamingRequest(invocationInfo, responseObserver);\n    }\n\n    public sendServerStreamingRequest(invocationInfo: GenericRequest, request: any, responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<InvocationClient> {\n        return this.client.sendServerStreamingRequest(invocationInfo, request, responseObserver, requestType, responseType);\n    }\n\n    public sendRawServerStreamingRequest(invocationInfo: InvocationRequestInfo, request: ArrayBuffer, responseObserver: InvocationObserver<ArrayBuffer>): Promise<InvocationClient> {\n        return this.client.sendRawServerStreamingRequest(invocationInfo, request, responseObserver);\n    }\n\n    public discoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse> {\n        return this.client.discoverService(discoveryRequest);\n    }\n\n    public discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse> {\n        return this.client.discoverMethod(discoveryRequest);\n    }\n\n    public disconnect(completion?: Completion | undefined): Promise<void> {\n        return this.client.disconnect(completion);\n    }\n\n}\n"
  },
  {
    "path": "web/packages/client/src/client/api/generic/GenericClientApiBuilder.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClientApi } from './GenericClientApi';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { GenericClientFactory } from '../../generic/GenericClientFactory';\nimport { ClientConnectRequest } from '@plexus-interop/client-api';\nimport { GenericClientApiImpl } from './GenericClientApiImpl';\nimport { GenericInvocationsHost } from './GenericInvocationsHost';\nimport { Logger, LoggerFactory, retriable, defaultPromiseRetryConfig } from '@plexus-interop/common';\nimport { InvocationHandlersRegistry } from './handlers/InvocationHandlersRegistry';\nimport { BidiStreamingInvocationHandler } from './handlers/streaming/BidiStreamingInvocationHandler';\nimport { ServerStreamingInvocationHandler } from './handlers/streaming/ServerStreamingInvocationHandler';\nimport { UnaryInvocationHandler } from './handlers/unary/UnaryInvocationHandler';\nimport { InternalGenericClientApi } from './internal/InternalGenericClientApi';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\nimport { ProtoMarshallerProvider } from '@plexus-interop/io/dist/main/src/static';\n\n\n// tslint:disable:member-ordering\nexport class GenericClientApiBuilder {\n\n    protected log: Logger = LoggerFactory.getLogger('GenericClientApiBuilder');\n\n    protected applicationId: string;\n    protected applicationInstanceId?: UniqueId;\n    protected handlersRegistry: InvocationHandlersRegistry;\n    protected transportConnectionProvider: () => Promise<TransportConnection>;\n    protected clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi> = async client => client;\n\n    private onDisconnect?: () => Promise<void>;\n\n    constructor(protected marshallerProvider: BinaryMarshallerProvider = new ProtoMarshallerProvider()) {\n        this.handlersRegistry = new InvocationHandlersRegistry(this.marshallerProvider);\n    }\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): GenericClientApiBuilder {\n        this.clientApiDecorator = clientApiDecorator;\n        return this;\n    }\n\n    public withApplicationId(appId: string): GenericClientApiBuilder {\n        this.applicationId = appId;\n        return this;\n    }\n\n    public withAppInstanceId(instanceId: UniqueId): GenericClientApiBuilder {\n        this.applicationInstanceId = instanceId;\n        return this;\n    }\n\n    public withClientDetails(clientId: ClientConnectRequest): GenericClientApiBuilder {\n        this.applicationId = clientId.applicationId;\n        this.applicationInstanceId = clientId.applicationInstanceId;\n        return this;\n    }\n\n    public withBidiStreamingHandler(handler: BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>): GenericClientApiBuilder {\n        this.handlersRegistry.registerBidiStreamingGenericHandler(handler);\n        return this;\n    }\n\n    public withTypeAwareBidiStreamingHandler(handler: BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>, requestType: any, responseType: any): GenericClientApiBuilder {\n        this.handlersRegistry.registerBidiStreamingHandler(handler, requestType, responseType);\n        return this;\n    }\n\n    public withServerStreamingHandler(handler: ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>): GenericClientApiBuilder {\n        this.handlersRegistry.registerServerStreamingGenericHandler(handler);\n        return this;\n    }\n\n    public withTypeAwareServerStreamingHandler(handler: ServerStreamingInvocationHandler<any, any>, requestType: any, responseType: any): GenericClientApiBuilder {\n        this.handlersRegistry.registerServerStreamingHandler(handler, requestType, responseType);\n        return this;\n    }\n\n    public withUnaryHandler(handler: UnaryInvocationHandler<ArrayBuffer, ArrayBuffer>): GenericClientApiBuilder {\n        this.handlersRegistry.registerUnaryGenericHandler(handler);\n        return this;\n    }\n\n    public withTypeAwareUnaryHandler(handler: UnaryInvocationHandler<any, any>, requestType: any, responseType: any): GenericClientApiBuilder {\n        this.handlersRegistry.registerUnaryHandler(handler, requestType, responseType);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): GenericClientApiBuilder {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    public withDisconnectCallback(onDisconnect: () => Promise<void>): void {\n        this.onDisconnect = onDisconnect;\n    }\n\n    public connect(): Promise<GenericClientApi> {\n        if (!this.applicationInstanceId) {\n            this.applicationInstanceId = UniqueId.generateNew();\n        }\n        const appInfo = {\n            applicationId: this.applicationId,\n            applicationInstanceId: this.applicationInstanceId\n        };\n        const connectionRetryConfig = {\n            ...defaultPromiseRetryConfig,\n            errorHandler: (connectError: any) => {\n                this.log.warn(`Failed to get connection, will retry in ${defaultPromiseRetryConfig.retryTimeoutInMillis}ms`, connectError);\n            }\n        };\n        const connectionProviderWithRetries = retriable(() => this.transportConnectionProvider(), connectionRetryConfig);\n        return this.validateState()\n            .then(connectionProviderWithRetries)\n            .then(connection => {\n                this.log.info('Connection established');\n                return new GenericClientFactory(connection, this.onDisconnect).createClient(appInfo);\n            })\n            .then(genericClient => {\n                const actionsHost = new GenericInvocationsHost(genericClient, this.handlersRegistry);\n                return actionsHost.start()\n                    .then(() => new GenericClientApiImpl(genericClient, this.marshallerProvider, this.handlersRegistry))\n                    .then(client => this.clientApiDecorator(client));\n            })\n            .catch(error => {\n                this.log.error('Unable to create client', error);\n                throw error;\n            });\n    }\n\n    private async validateState(): Promise<void> {\n        if (!this.marshallerProvider) {\n            throw 'Marshaller Provider is not defined';\n        }\n        if (!this.transportConnectionProvider) {\n            throw 'Transport Connection Provider is not defined';\n        }\n        if (!this.applicationId || !this.applicationInstanceId) {\n            throw 'Application ID is not defined';\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/GenericClientApiImpl.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Feature } from './GenericClientApi';\nimport { GenericClient } from '../../../client/generic/GenericClient';\nimport { ServiceDiscoveryRequest, MethodInvocationContext } from '@plexus-interop/client-api';\nimport { ServiceDiscoveryResponse } from '@plexus-interop/client-api';\nimport { ClientDtoUtils } from './../../ClientDtoUtils';\nimport { StreamingInvocationClient } from './handlers/streaming/StreamingInvocationClient';\nimport { StreamingInvocationClientInternal } from './handlers/streaming/StreamingInvocationClientInternal';\nimport { StreamingInvocationClientImpl } from './handlers/streaming/StreamingInvocationClientImpl';\nimport { InvocationClient } from './../InvocationClient';\nimport { ValueHandler } from './../ValueHandler';\nimport { ClientError } from '@plexus-interop/protocol';\nimport { InvocationRequestInfo } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory, Arrays, onceVoid } from '@plexus-interop/common';\nimport { Completion } from '@plexus-interop/client-api';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { ProvidedMethodReference, ActionReference } from '@plexus-interop/client-api';\nimport { Invocation } from '../../generic/Invocation';\nimport { MethodDiscoveryRequest } from '@plexus-interop/client-api';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\nimport { GenericRequest } from '@plexus-interop/client-api';\nimport { InvocationObserver } from '../../generic';\nimport { DelegateInvocationObserver } from '../../api/DelegateInvocationObserver';\nimport { LoggingInvocationObserver } from '../LoggingInvocationObserver';\nimport { InternalGenericClientApi } from './internal/InternalGenericClientApi';\nimport { InvocationExecutor } from './InvocationExecutor';\nimport { InvocationHandlersRegistry } from './handlers/InvocationHandlersRegistry';\n\nexport class GenericClientApiImpl implements InternalGenericClientApi {\n\n    private readonly log: Logger = LoggerFactory.getLogger('GenericClientApi');\n\n    constructor(\n        protected readonly genericClient: GenericClient,\n        protected readonly marshallerProvider: BinaryMarshallerProvider,\n        protected readonly handlersRegistry: InvocationHandlersRegistry\n    ) { }\n\n    public supported(feature: Feature): boolean {\n        return true;\n    }\n\n    public getApplicationId(): string {\n        return this.genericClient.getApplicationId();\n    }\n\n    public getApplicationInstanceId(): UniqueId {\n        return this.genericClient.getApplicationInstanceId();\n    }\n\n    public getConnectionId(): UniqueId {\n        return this.genericClient.getConnectionId();\n    }\n\n    public getMarshallerProvider(): BinaryMarshallerProvider {\n        return this.marshallerProvider;\n    }\n\n    public discoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse> {\n        this.log.debug('Service Discovery request');\n        return this.genericClient.discoverService(discoveryRequest);\n    }\n\n    public discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse> {\n        this.log.debug('Method Discovery request');\n        return this.genericClient.discoverMethod(discoveryRequest);\n    }\n\n    public sendRawUnaryRequest(genericRequest: GenericRequest, request: ArrayBuffer, responseHandler: ValueHandler<ArrayBuffer>): Promise<InvocationClient> {\n        return this.sendUnaryRequestInternal(\n            this.toInvocationHash(genericRequest),\n            this.requestInvocation(genericRequest),\n            request, responseHandler\n        );\n    }\n\n    public async sendUnaryRequest(genericRequest: GenericRequest, request: any, responseHandler: ValueHandler<any>, requestType: any, responseType: any): Promise<InvocationClient> {\n        const requestMarshaller = this.marshallerProvider.getMarshaller(requestType);\n        const responseMarshaller = this.marshallerProvider.getMarshaller(responseType);\n        return this.sendRawUnaryRequest(genericRequest,\n            Arrays.toArrayBuffer(requestMarshaller.encode(request)),\n            {\n                value: (responsePayload: ArrayBuffer) => responseHandler.value(responseMarshaller.decode(new Uint8Array(responsePayload))),\n                error: responseHandler.error\n            });\n    }\n\n    public sendRawServerStreamingRequest(\n        genericRequest: GenericRequest,\n        request: ArrayBuffer,\n        responseObserver: InvocationObserver<ArrayBuffer>): Promise<InvocationClient> {\n        return this.sendServerStreamingRequestInternal(\n            this.toInvocationHash(genericRequest),\n            this.requestInvocation(genericRequest),\n            request,\n            responseObserver\n        );\n    }\n\n    public async sendServerStreamingRequest(\n        genericRequest: GenericRequest,\n        request: any,\n        responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<InvocationClient> {\n        const requestMarshaller = this.marshallerProvider.getMarshaller(requestType);\n        const responseMarshaller = this.marshallerProvider.getMarshaller(responseType);\n        const encoded = Arrays.toArrayBuffer(requestMarshaller.encode(request));\n        return this.sendRawServerStreamingRequest(genericRequest, encoded, {\n            next: res => responseObserver.next(responseMarshaller.decode(new Uint8Array(res))),\n            complete: () => responseObserver.complete(),\n            error: e => responseObserver.error(e),\n            streamCompleted: () => responseObserver.streamCompleted()\n        });\n    }\n\n    public sendRawBidirectionalStreamingRequest(request: GenericRequest, responseObserver: InvocationObserver<ArrayBuffer>): Promise<StreamingInvocationClient<ArrayBuffer>> {\n        return this.sendBidirectionalStreamingRequestInternal(\n            this.toInvocationHash(request),\n            this.requestInvocation(request),\n            responseObserver\n        );\n    }\n\n    public async sendBidirectionalStreamingRequest(genericRequest: GenericRequest, responseObserver: InvocationObserver<any>, requestType: any, responseType: any): Promise<StreamingInvocationClient<any>> {\n        const requestMarshaller = this.marshallerProvider.getMarshaller(requestType);\n        const responseMarshaller = this.marshallerProvider.getMarshaller(responseType);\n        const baseClient: StreamingInvocationClient<ArrayBuffer> = await this.sendRawBidirectionalStreamingRequest(genericRequest, {\n            next: (responsePayload: ArrayBuffer) => responseObserver.next(responseMarshaller.decode(new Uint8Array(responsePayload))),\n            error: responseObserver.error.bind(responseObserver),\n            complete: responseObserver.complete.bind(responseObserver),\n            streamCompleted: responseObserver.streamCompleted.bind(responseObserver)\n        }\n        );\n        return {\n            error: baseClient.error.bind(baseClient),\n            cancel: baseClient.cancel.bind(baseClient),\n            next: (request: any) => baseClient.next(Arrays.toArrayBuffer(requestMarshaller.encode(request))),\n            complete: baseClient.complete.bind(baseClient)\n        };\n    }\n\n    public async sendBidirectionalStreamingRequestInternal(strInfo: string, requestInvocation: () => Promise<Invocation>, responseObserver: InvocationObserver<ArrayBuffer>): Promise<StreamingInvocationClientInternal<ArrayBuffer>> {\n        const logger = LoggerFactory.getLogger(`Invocation Request [${strInfo}]`);\n        logger.debug(`Sending request for invocation`);\n        const invocation = await requestInvocation();\n        logger.debug(`Invocation created`);\n        await new Promise((resolve, reject) => {\n            invocation.open(\n                new DelegateInvocationObserver(new LoggingInvocationObserver(responseObserver, logger),\n                    s => resolve(s),\n                    e => reject(e)));\n        });\n        logger.debug('Invocation opened');\n        return new StreamingInvocationClientImpl(invocation, logger);\n    }\n\n    public async sendServerStreamingRequestInternal(\n        strInfo: string,\n        requestInvocation: () => Promise<Invocation>,\n        request: ArrayBuffer,\n        responseObserver: InvocationObserver<ArrayBuffer>): Promise<InvocationClient> {\n        let streamingClient: StreamingInvocationClientInternal<ArrayBuffer> | undefined;\n        const completeHandler = onceVoid(() => {\n            if (streamingClient) {\n                streamingClient\n                    .complete()\n                    .catch(e => responseObserver.error(e));\n            }\n        });\n        // to react on cancel/complete invocation without stream completion\n        const baseCompleteHandler = responseObserver.complete;\n        responseObserver.complete = () => {\n            baseCompleteHandler();\n            completeHandler();\n        };\n        // send client completion on stream completion also, success case\n        const streamCompleteHandler = responseObserver.streamCompleted;\n        responseObserver.streamCompleted = () => {\n            streamCompleteHandler();\n            completeHandler();\n        };\n        streamingClient = await this.sendBidirectionalStreamingRequestInternal(strInfo, requestInvocation, responseObserver);\n        await streamingClient.next(request);\n        streamingClient.sendCompleted();\n        return streamingClient;\n    }\n\n    public async sendUnaryRequestInternal(\n        strInfo: string,\n        requestInvocation: () => Promise<Invocation>,\n        request: ArrayBuffer,\n        responseHandler: ValueHandler<ArrayBuffer>): Promise<InvocationClient> {\n        const responseObserver = this.createUnaryObserver(responseHandler);\n        return this.sendServerStreamingRequestInternal(strInfo, requestInvocation, request, responseObserver);\n    }\n\n    public disconnect(completion?: Completion): Promise<void> {\n        return this.genericClient.disconnect(completion);\n    }\n\n    public invokeUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayload: any): Promise<any> {\n        return new InvocationExecutor(this.handlersRegistry).invokeUnaryHandler(invocationContext, actionReference, requestPayload);\n    }\n\n    public invokeRawUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayloadBuffer: ArrayBuffer): Promise<ArrayBuffer> {\n        return new InvocationExecutor(this.handlersRegistry).invokeRawUnaryHandler(invocationContext, actionReference, requestPayloadBuffer);\n    }\n\n    private isDiscovered(request: InvocationRequestInfo | ProvidedMethodReference): request is ProvidedMethodReference {\n        return !!(request as ProvidedMethodReference).providedService;\n    }\n\n    private toInvocationHash(request: InvocationRequestInfo | ProvidedMethodReference): string {\n        return this.isDiscovered(request) ?\n            ClientDtoUtils.targetInvocationHash(ClientDtoUtils.providedMethodToInvocationInfo(request))\n            : ClientDtoUtils.targetInvocationHash(request);\n    }\n\n    private requestInvocation(request: InvocationRequestInfo | ProvidedMethodReference): () => Promise<Invocation> {\n        return this.isDiscovered(request) ?\n            () => this.genericClient.requestDiscoveredInvocation(request)\n            : () => this.genericClient.requestInvocation(request);\n    }\n\n    private createUnaryObserver(responseHandler: ValueHandler<ArrayBuffer>): InvocationObserver<ArrayBuffer> {\n        let result: ArrayBuffer | null = null;\n        return {\n            next: v => {\n                this.log.trace(`Received value of ${v.byteLength} bytes`);\n                result = v;\n            },\n            streamCompleted: () => this.log.trace('Incoming stream completed'),\n            error: responseHandler.error.bind(responseHandler),\n            complete: () => {\n                if (result === null) {\n                    const errorText = 'No messages received before completion';\n                    this.log.error(errorText);\n                    responseHandler.error(new ClientError(errorText));\n                } else {\n                    responseHandler.value(result);\n                }\n                this.log.debug('Unary operation completed');\n            }\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/GenericInvocationsHost.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClient } from '../../../client/generic/GenericClient';\nimport { Invocation } from '../../../client/generic/Invocation';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { InvocationHandlersRegistry } from './handlers/InvocationHandlersRegistry';\nimport { InvocationExecutor } from './InvocationExecutor';\n\nexport class GenericInvocationsHost {\n\n    private log: Logger = LoggerFactory.getLogger('GenericInvocationHost');\n\n    constructor(\n        private readonly genericClient: GenericClient,\n        private readonly handlersRegistry: InvocationHandlersRegistry\n    ) {\n    }\n\n    public start(): Promise<void> {\n        return this.genericClient.acceptInvocations({\n            next: (invocation: Invocation) => this.handleInvocation(invocation),\n            error: (e) => this.log.error('Error on invocations subscription', e),\n            complete: () => this.log.debug('Invocations subscription completed')\n        })\n            .then(() => this.log.debug('Started to listen invocations'))\n            .catch((e) => {\n                this.log.error('Error on opening invocations subscription', e);\n                throw e;\n            });\n    }\n\n    private handleInvocation(invocation: Invocation): void {\n        new InvocationExecutor(this.handlersRegistry).handleGenericInvocation(invocation);\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/InvocationExecutor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from '../../../client/generic/Invocation';\nimport { Logger, LoggerFactory, AnonymousSubscription } from '@plexus-interop/common';\nimport { StreamingInvocationHost } from './handlers/streaming/StreamingInvocationHost';\nimport { InvocationHandlersRegistry } from './handlers/InvocationHandlersRegistry';\nimport { BaseInvocation } from '../../generic/BaseInvocation';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { ActionReference, MethodInvocationContext } from '@plexus-interop/client-api';\nimport { SuccessCompletion, ClientProtocolHelper, ErrorCompletion, InvocationMetaInfo } from '@plexus-interop/protocol';\n\nexport class InvocationExecutor {\n\n    private log: Logger = LoggerFactory.getLogger('InvocationExecutor');\n\n    constructor(private readonly handlersRegistry: InvocationHandlersRegistry) { }\n\n    public handleGenericInvocation(invocation: Invocation): void {\n        this.log.trace(`Received invocation`);\n        new StreamingInvocationHost(this.handlersRegistry).executeGenericHandler(invocation);\n    }\n\n    public handleInvocation(invocation: BaseInvocation<any, any>): void {\n        this.log.trace(`Received invocation`);\n        new StreamingInvocationHost(this.handlersRegistry).executeTypeAwareHandler(invocation);\n    }\n\n    public invokeRawUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayloadBuffer: ArrayBuffer): Promise<ArrayBuffer> {\n        return this.internalInvokeUnaryHandler(invocationContext, actionReference, requestPayloadBuffer, false);\n    }\n\n    public invokeUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayload: any): Promise<any> {\n        return this.internalInvokeUnaryHandler(invocationContext, actionReference, requestPayload, true);\n    }\n\n    public internalInvokeUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayload: any, isTyped: boolean): Promise<any> {\n        return new Promise<any>((resolve, reject) => {\n            const invocation: BaseInvocation<any, any> = {\n                uuid: () => UniqueId.generateNew(),\n                sendMessage: async response => resolve(response),\n                open: observer => {\n                    observer.started(new AnonymousSubscription());\n                    observer.next(requestPayload);\n                    observer.streamCompleted();\n                    observer.complete();\n                },\n                getMetaInfo: () => {\n                    const metaInfo: InvocationMetaInfo = {\n                        ...actionReference,\n                        consumerApplicationId: invocationContext.consumerApplicationId,\n                        consumerConnectionId: invocationContext.consumerConnectionId\n                    };\n                    return metaInfo;\n                },\n                sendCompleted: async () => { },\n                close: async completion => {\n                    if (!ClientProtocolHelper.isSuccessCompletion(completion || new SuccessCompletion())) {\n                        reject(completion);\n                        return new ErrorCompletion();\n                    } else {\n                        return new SuccessCompletion();\n                    }\n                }\n            };\n            isTyped ? this.handleInvocation(invocation) : this.handleGenericInvocation(invocation);\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/InvocationHandlerConverter.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BidiStreamingInvocationHandler } from './streaming/BidiStreamingInvocationHandler';\n\nexport interface InvocationHandlerConverter<T, Req, Res> {\n    convert(baseHandler: T): BidiStreamingInvocationHandler<Req, Res>;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/InvocationHandlersRegistry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BidiStreamingInvocationHandler, ServerStreamingInvocationHandler } from './streaming';\nimport { ActionReference } from '@plexus-interop/client-api';\nimport { UnaryHandlerConverter, toGenericUnaryHandler } from './unary/converters';\nimport { LoggerFactory, Logger } from '@plexus-interop/common';\nimport { UnaryInvocationHandler } from './unary/UnaryInvocationHandler';\nimport { ServerStreamingConverter, toGenericStreamingHandler, toGenericBidiStreamingHandler } from './streaming/converters';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\n\ntype HandlerActionRef = {\n    serviceInfo: {\n        serviceId: string,\n        serviceAlias?: string\n    },\n    methodId: string\n};\n\n/**\n * Holder for both typed/untyped invocation handlers\n */\nexport class InvocationHandlersRegistry {\n\n    protected log: Logger = LoggerFactory.getLogger('InvocationHandler');\n\n    // tslint:disable-next-line:typedef\n    protected readonly typeAwareHandlers = new Map<string, BidiStreamingInvocationHandler<any, any>>();\n    // tslint:disable-next-line:typedef\n    protected readonly genericHandlers = new Map<string, BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>>();\n\n    public constructor(private readonly marshallerProvider: BinaryMarshallerProvider) { }\n\n    public registerServerStreamingHandler(handler: ServerStreamingInvocationHandler<any, any>, requestType: any, responseType: any): void {\n        this.typeAwareHandlers.set(\n            this.actionHash(this.toActionRef(handler)),\n            new ServerStreamingConverter<any, any>(this.log).convert(handler));\n        this.registerServerStreamingGenericHandler(toGenericStreamingHandler(handler, requestType, responseType, this.marshallerProvider));\n    }\n\n    public registerServerStreamingGenericHandler(handler: ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>): void {\n        this.registerBidiStreamingGenericHandler(new ServerStreamingConverter(this.log).convert(handler));\n    }\n\n    public registerUnaryGenericHandler(handler: UnaryInvocationHandler<ArrayBuffer, ArrayBuffer>): void {\n        this.registerBidiStreamingGenericHandler(new UnaryHandlerConverter<ArrayBuffer, ArrayBuffer>(this.log).convert(handler));\n    }\n\n    public registerUnaryHandler(handler: UnaryInvocationHandler<any, any>, requestType: any, responseType: any): void {\n        this.typeAwareHandlers.set(\n            this.actionHash(this.toActionRef(handler)), \n            new UnaryHandlerConverter<any, any>(this.log).convert(handler));\n        this.registerUnaryGenericHandler(toGenericUnaryHandler(handler, requestType, responseType, this.marshallerProvider));\n    }\n\n    public registerBidiStreamingHandler(handler: BidiStreamingInvocationHandler<any, any>, requestType: any, responseType: any): void {\n        this.registerBidiStreamingGenericHandler(toGenericBidiStreamingHandler(handler, requestType, responseType, this.marshallerProvider));\n    }\n\n    public registerBidiStreamingGenericHandler(handler: BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>): void {\n        this.genericHandlers.set(this.actionHash(this.toActionRef(handler)), handler);\n    }\n\n    public getTypeAwareBidiStreamingHandler(actionRef: ActionReference): BidiStreamingInvocationHandler<any, any> | undefined {\n        return this.typeAwareHandlers.get(this.actionHash(actionRef));\n    }\n\n    public getRawBidiStreamingHandler(actionRef: ActionReference): BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> | undefined {\n        return this.genericHandlers.get(this.actionHash(actionRef));\n    }\n\n    private actionHash(actionRef: ActionReference): string {\n        return `${actionRef.serviceId}.${actionRef.methodId}`;\n    }\n\n    private toActionRef(handlerRef: HandlerActionRef): ActionReference {\n        return {\n            serviceId: handlerRef.serviceInfo.serviceId,\n            serviceAlias: handlerRef.serviceInfo.serviceAlias,\n            methodId: handlerRef.methodId\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './streaming';\nexport * from './unary';\nexport * from './InvocationHandlerConverter';\nexport * from './InvocationHandlersRegistry';"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/BidiStreamingInvocationHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StreamingInvocationClient } from './StreamingInvocationClient';\nimport { MethodInvocationContext, ServiceInfo } from '@plexus-interop/client-api';\nimport { InvocationObserver } from '../../../../';\n\nexport interface BidiStreamingInvocationHandler<Req, Res> {\n\n    serviceInfo: ServiceInfo;\n\n    methodId: string;\n\n    handle(invocationContext: MethodInvocationContext, invocationHostClient: StreamingInvocationClient<Res>): InvocationObserver<Req>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/ServerStreamingInvocationHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StreamingInvocationClient } from './StreamingInvocationClient';\nimport { MethodInvocationContext, ServiceInfo } from '@plexus-interop/client-api';\n\nexport interface ServerStreamingInvocationHandler<Req, Res> {\n\n    serviceInfo: ServiceInfo;\n    \n    methodId: string;\n\n    handle(invocationContext: MethodInvocationContext, requestPayload: Req, invocationHostClient: StreamingInvocationClient<Res>): void;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/StreamingInvocationClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InvocationClient } from '../../../InvocationClient';\n\nexport interface StreamingInvocationClient<T> extends InvocationClient {\n\n    next(value: T): Promise<void>;\n\n    complete(): Promise<void>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/StreamingInvocationClientImpl.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StreamingInvocationClientInternal } from './StreamingInvocationClientInternal';\nimport { ClientError, SuccessCompletion, ClientProtocolHelper } from '@plexus-interop/protocol';\nimport { Invocation } from '../../../../generic/Invocation';\nimport { BaseInvocationClientImpl } from '../../../BaseInvocationClientImpl';\nimport { Logger } from '@plexus-interop/common';\n\nexport class StreamingInvocationClientImpl extends BaseInvocationClientImpl implements StreamingInvocationClientInternal<ArrayBuffer> {\n\n    constructor(invocation: Invocation, log: Logger) {\n        super(invocation, log);\n    }\n\n    public next(value: ArrayBuffer): Promise<void> {\n        this.log.trace(`Sending new message of ${value.byteLength} bytes`);\n        return this.invocation.sendMessage(value);\n    }\n\n    public async complete(): Promise<void> {\n        this.log.trace(`Complete operation requested`);\n        const completion = await this.invocation.close(new SuccessCompletion());\n        if (!ClientProtocolHelper.isSuccessCompletion(completion)) {\n            this.log.error(`Completed with errors`, completion ? completion.error : 'Completion is empty');\n            throw completion && completion.error ? completion.error : new ClientError('Completed with errors');\n        }\n    }\n\n    public async sendCompleted(): Promise<void> {\n        this.log.trace(`Stream completed operation requested`);\n        return this.invocation.sendCompleted();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/StreamingInvocationClientInternal.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StreamingInvocationClient } from './StreamingInvocationClient';\n\nexport interface StreamingInvocationClientInternal<T> extends StreamingInvocationClient<T> {\n\n    sendCompleted(): Promise<void>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/StreamingInvocationHost.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from '../../../../../client/generic/Invocation';\nimport { StreamingInvocationClientImpl } from './StreamingInvocationClientImpl';\nimport { Logger, Observer, LoggerFactory, CancellationToken } from '@plexus-interop/common';\nimport { ClientDtoUtils } from '../../../../ClientDtoUtils';\nimport { MethodInvocationContext, ActionReference } from '@plexus-interop/client-api';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { InvocationObserver } from '../../../../generic/InvocationObserver';\nimport { InvocationHandlersRegistry } from '../InvocationHandlersRegistry';\nimport { BaseInvocation } from '../../../../generic/BaseInvocation';\nimport { ClientProtocolUtils } from '@plexus-interop/protocol';\n\nexport class StreamingInvocationHost {\n\n    private logger: Logger = LoggerFactory.getLogger('StreamingInvocationHost');\n\n    public constructor(\n        private readonly handlersRegistry: InvocationHandlersRegistry) { }\n\n    public executeTypeAwareHandler(invocation: BaseInvocation<any, any>, cancellationToken: CancellationToken = new CancellationToken()): void {\n        this.execute(true, invocation, cancellationToken);\n    }\n\n    public executeGenericHandler(invocation: Invocation, cancellationToken: CancellationToken = new CancellationToken()): void {\n        this.execute(false, invocation, cancellationToken);\n    }\n\n    private execute(\n        isTypeAware: boolean,\n        invocation: BaseInvocation<any, any>,\n        cancellationToken: CancellationToken = new CancellationToken()): void {\n\n        this.logger.debug('Handling invocation started');\n        let baseRequestObserver: null | Observer<any> = null;\n        invocation.open({\n\n            started: () => {\n                this.logger.trace('Invocation opened');\n                const metaInfo = invocation.getMetaInfo();\n                const actionRef: ActionReference = {\n                    serviceAlias: metaInfo.serviceAlias,\n                    methodId: metaInfo.methodId as string,\n                    serviceId: metaInfo.serviceId as string\n                };\n                const hash = ClientDtoUtils.targetInvocationHash(metaInfo);\n                this.logger = LoggerFactory.getLogger(`Invocation Host [${hash}]`);\n                const invocationHandler = isTypeAware ? this.handlersRegistry.getTypeAwareBidiStreamingHandler(actionRef) : this.handlersRegistry.getRawBidiStreamingHandler(actionRef);\n                if (invocationHandler) {\n                    const invocationContext = new MethodInvocationContext(\n                        metaInfo.consumerApplicationId as string,\n                        metaInfo.consumerConnectionId as UniqueId,\n                        cancellationToken);\n                    baseRequestObserver = invocationHandler.handle(invocationContext, new StreamingInvocationClientImpl(invocation, this.logger));\n                } else {\n                    this.logger.error(`No handler found for hash [${hash}]`);\n                }\n            },\n\n            startFailed: e => this.logger.error('Could not open invocation', e),\n\n            next: (requestPayload: any) => {\n                if (!isTypeAware) {\n                    this.logger.trace(`Received message of ${requestPayload.byteLength} bytes`);\n                } else {\n                    this.logger.trace(`Received message object`);\n                }\n                this.handleClientAction(baseRequestObserver, () => (baseRequestObserver as Observer<any>).next(requestPayload));\n            },\n\n            complete: completion => {\n                this.logger.trace('Received remote completion');\n                if (completion && ClientProtocolUtils.isCancelCompletion(completion)) {\n                    cancellationToken.cancel('Invocation completed');\n                }\n                this.handleClientAction(baseRequestObserver, () => (baseRequestObserver as Observer<any>).complete());\n            },\n\n            streamCompleted: () => {\n                this.logger.trace('Received remote stream completion');\n                this.handleClientAction(baseRequestObserver, () => (baseRequestObserver as InvocationObserver<any>).streamCompleted());\n            },\n\n            error: invocationError => {\n                this.logger.error(`Received invocation error, passing to client`, invocationError);\n                cancellationToken.cancel('Invocation error received');\n                this.handleClientAction(baseRequestObserver, () => (baseRequestObserver as Observer<any>).error(invocationError));\n            }\n        });\n    }\n\n    private handleClientAction(nullableClient: any, func: Function): void {\n        if (nullableClient === null) {\n            this.logger.error('Client is not initialized');\n        } else {\n            try {\n                func();\n            } catch (error) {\n                this.logger.error('Internal client\\'s execution error', error);\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/converters.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InvocationHandlerConverter } from '../InvocationHandlerConverter';\nimport { ServerStreamingInvocationHandler } from './ServerStreamingInvocationHandler';\nimport { BidiStreamingInvocationHandler } from './BidiStreamingInvocationHandler';\nimport { StreamingInvocationClient } from './StreamingInvocationClient';\nimport { ClientDtoUtils } from '../../../../ClientDtoUtils';\nimport { Logger, LoggerFactory, Arrays } from '@plexus-interop/common';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\n\nexport class ServerStreamingConverter<Req, Res> implements InvocationHandlerConverter<ServerStreamingInvocationHandler<Req, Res>, Req, Res> {\n\n    public constructor(private readonly log: Logger = LoggerFactory.getLogger('ServerStreamingConverter')) { }\n\n    public convert(baseHandler: ServerStreamingInvocationHandler<Req, Res>): BidiStreamingInvocationHandler<Req, Res> {\n        return {\n            serviceInfo: baseHandler.serviceInfo,\n            methodId: baseHandler.methodId,\n            handle: (invocationContext: MethodInvocationContext, invocationHostClient: StreamingInvocationClient<Res>) => {\n                return {\n                    next: (request) => {\n                        try {\n                            baseHandler.handle(invocationContext, request, invocationHostClient);\n                        } catch (executionError) {\n                            this.log.error('Execution error', executionError);\n                            invocationHostClient.error(ClientDtoUtils.toError(executionError));\n                        }\n                    },\n                    streamCompleted: () => this.log.debug('Messages stream completed'),\n                    error: e => this.log.error('Error received', e),\n                    complete: () => this.log.debug('Invocation completed')\n                };\n            }\n        };\n    }\n}\n\nexport function toGenericStreamingHandler(\n    typedHandler: ServerStreamingInvocationHandler<any, any>,\n    requestType: any,\n    responseType: any,\n    marshallerProvider: BinaryMarshallerProvider): ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> {\n\n    const requestMarshaller = marshallerProvider.getMarshaller(requestType);\n    const responseMarshaller = marshallerProvider.getMarshaller(responseType);\n\n    return {\n        ...typedHandler,\n        handle: (invocationContext: MethodInvocationContext, requestPayload: ArrayBuffer, hostClient: StreamingInvocationClient<ArrayBuffer>) => {\n            const typedPayload = requestMarshaller.decode(new Uint8Array(requestPayload));\n            typedHandler.handle(invocationContext, typedPayload, {\n                next: response => hostClient.next(Arrays.toArrayBuffer(responseMarshaller.encode(response))),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n        }\n    };\n\n}\n\nexport function toGenericBidiStreamingHandler(\n    typedHandler: BidiStreamingInvocationHandler<any, any>,\n    requestType: any,\n    responseType: any,\n    marshallerProvider: BinaryMarshallerProvider): BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> {\n    const requestMarshaller = marshallerProvider.getMarshaller(requestType);\n    const responseMarshaller = marshallerProvider.getMarshaller(responseType);\n    return {\n        ...typedHandler,\n        handle: (invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<ArrayBuffer>) => {\n            const baseObserver = typedHandler.handle(invocationContext, {\n                next: typedResponse => hostClient.next(Arrays.toArrayBuffer(responseMarshaller.encode(typedResponse))),\n                complete: hostClient.complete.bind(hostClient),\n                error: hostClient.error.bind(hostClient),\n                cancel: hostClient.cancel.bind(hostClient)\n            });\n            return {\n                next: (requestPayload: ArrayBuffer) => baseObserver.next(requestMarshaller.decode(new Uint8Array(requestPayload))),\n                complete: baseObserver.complete.bind(baseObserver),\n                error: baseObserver.error.bind(baseObserver),\n                streamCompleted: baseObserver.streamCompleted.bind(baseObserver)\n            };\n        }\n    };\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/streaming/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './BidiStreamingInvocationHandler';\nexport * from './ServerStreamingInvocationHandler';\nexport * from './StreamingInvocationClient';\nexport * from './StreamingInvocationHost';"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/unary/UnaryInvocationHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ServiceInfo, MethodInvocationContext } from '@plexus-interop/client-api';\n \nexport interface UnaryInvocationHandler<Req, Res> {\n\n    serviceInfo: ServiceInfo;\n\n    methodId: string;\n\n    handle(invocationContext: MethodInvocationContext, request: Req): Promise<Res>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/unary/converters.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\nimport { Arrays } from '@plexus-interop/common';\nimport { UnaryInvocationHandler } from './UnaryInvocationHandler';\nimport { BidiStreamingInvocationHandler } from '../streaming/BidiStreamingInvocationHandler';\nimport { StreamingInvocationClient } from '../streaming/StreamingInvocationClient';\nimport { InvocationHandlerConverter } from '../InvocationHandlerConverter';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\nimport { ClientDtoUtils } from '../../../../ClientDtoUtils';\n\nexport function toGenericUnaryHandler(\n    handler: UnaryInvocationHandler<any, any>,\n    requestType: any,\n    responseType: any,\n    marshallerProvider: BinaryMarshallerProvider): UnaryInvocationHandler<ArrayBuffer, ArrayBuffer> {\n\n    const requestMarshaller = marshallerProvider.getMarshaller(requestType);\n    const responseMarshaller = marshallerProvider.getMarshaller(responseType);\n\n    return {\n        ...handler,\n        handle: async (invocationContext, request: ArrayBuffer) => {\n            const payload = requestMarshaller.decode(new Uint8Array(request));\n            const rawResponse = await handler.handle(invocationContext, payload);\n            return Arrays.toArrayBuffer(responseMarshaller.encode(rawResponse));\n        }\n    };\n\n}\n\nexport class UnaryHandlerConverter<Req, Res> implements InvocationHandlerConverter<UnaryInvocationHandler<Req, Res>, Req, Res> {\n\n    public constructor(private readonly log: Logger = LoggerFactory.getLogger('UnaryHandlerConverter')) { }\n\n    public convert(unary: UnaryInvocationHandler<Req, Res>): BidiStreamingInvocationHandler<Req, Res> {\n        return {\n            serviceInfo: unary.serviceInfo,\n            methodId: unary.methodId,\n            handle: (invocationContext: MethodInvocationContext, invocationHostClient: StreamingInvocationClient<Res>) => {\n                return {\n                    next: (request: Req) => {\n                        try {\n                            unary.handle(invocationContext, request).then(async (response) => {\n                                try {\n                                    await invocationHostClient.next(response);\n                                    await invocationHostClient.complete();\n                                } catch (error) {\n                                    this.log.error('Unable to send response', error);\n                                }\n                            }).catch((error) => {\n                                this.log.error('Execution error', error);\n                                invocationHostClient.error(ClientDtoUtils.toError(error));\n                            });\n                        } catch (executionError) {\n                            this.log.error('Execution error', executionError);\n                            invocationHostClient.error(ClientDtoUtils.toError(executionError));\n                        }\n                    },\n                    streamCompleted: () => this.log.debug('Stream completed'),\n                    error: e => this.log.error('Error received', e),\n                    complete: () => this.log.debug('Invocation completed')\n                };\n            }\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/handlers/unary/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './UnaryInvocationHandler';\nexport * from './converters';"
  },
  {
    "path": "web/packages/client/src/client/api/generic/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './ClientApiBuilder';\nexport * from './GenericClientApi';\nexport * from './GenericClientApiImpl';\nexport * from './GenericClientApiBase';\nexport * from './GenericInvocationsHost';\nexport * from './GenericClientApiBuilder';\nexport * from './handlers';\nexport * from './internal';"
  },
  {
    "path": "web/packages/client/src/client/api/generic/internal/InternalActionInvoker.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ActionReference, MethodInvocationContext } from '@plexus-interop/client-api';\n\n/**\n * Invokes registered action handlers on behalf of other app\n */\nexport interface InternalActionInvoker {\n\n    /**\n     * Invokes registered action handler, applying serialization/deserialization logic on request/response\n     * \n     * @param invocationContext Method invocation context\n     * @param actionReference Action reference\n     * @param requestPayload Request Payload (structured object)\n     */\n    invokeUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayload: any): Promise<any>;\n\n    /**\n     * Invokes registered action handler\n     * \n     * @param invocationContext Method invocation context\n     * @param actionReference Action reference\n     * @param requestPayloadBuffer Request payload  \n     */\n    invokeRawUnaryHandler(invocationContext: MethodInvocationContext, actionReference: ActionReference, requestPayloadBuffer: ArrayBuffer): Promise<ArrayBuffer>;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/internal/InternalGenericClientApi.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InternalActionInvoker } from './InternalActionInvoker';\nimport { GenericClientApi } from '..';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\n\n/**\n * Extends public client with additioanal features\n */\nexport interface InternalGenericClientApi extends InternalActionInvoker, GenericClientApi {\n\n    getMarshallerProvider(): BinaryMarshallerProvider;\n}"
  },
  {
    "path": "web/packages/client/src/client/api/generic/internal/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './InternalActionInvoker';\nexport * from './InternalGenericClientApi';"
  },
  {
    "path": "web/packages/client/src/client/api/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './generic';\nexport * from '@plexus-interop/client-api';\nexport * from './InvocationClient';\nexport * from './ValueHandler';\nexport * from '@plexus-interop/io';\nexport * from './DelegateInvocationObserver';\nexport * from './container';"
  },
  {
    "path": "web/packages/client/src/client/generic/AcceptedInvocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from '../../client/generic/Invocation';\nimport { GenericInvocation } from './GenericInvocation';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { AnonymousSubscription } from '../../client/api/AnonymousSubscription';\nimport { clientProtocol as plexus, InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { InvocationChannelObserver } from './InvocationChannelObserver';\n\nexport class AcceptedInvocation implements Invocation {\n\n    constructor(private readonly genericInvocation: GenericInvocation) { }\n\n    public uuid(): UniqueId {\n        return this.genericInvocation.uuid();\n    }\n\n    public sendMessage(data: ArrayBuffer): Promise<void> {\n        return this.genericInvocation.sendMessage(data);\n    }\n\n    public open(observer: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.genericInvocation.acceptInvocation(observer);\n    }\n\n    public close(completion?: plexus.ICompletion): Promise<plexus.ICompletion> {\n        return this.genericInvocation.close(completion);\n    }\n\n    public async sendCompleted(): Promise<void> {\n        return this.genericInvocation.sendCompleted();\n    }\n\n    public getMetaInfo(): InvocationMetaInfo {\n        return this.genericInvocation.getMetaInfo();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/BaseInvocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { AnonymousSubscription } from '@plexus-interop/common';\nimport { InvocationChannelObserver } from './InvocationChannelObserver';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface BaseInvocation<Req, Res> {\n    uuid(): UniqueId;\n    sendMessage(data: Req): Promise<void>;\n    sendCompleted(): Promise<void>;\n    open(observer: InvocationChannelObserver<AnonymousSubscription, Res>): void;\n    close(completion?: plexus.ICompletion): Promise<plexus.ICompletion>;\n    getMetaInfo(): InvocationMetaInfo;\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/GenericClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from './Invocation';\nimport { InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { Observer } from '@plexus-interop/common';\nimport { AnonymousSubscription } from '../api/AnonymousSubscription';\nimport { ServiceDiscoveryRequest } from '@plexus-interop/client-api';\nimport { ServiceDiscoveryResponse } from '@plexus-interop/client-api';\nimport { clientProtocol } from '@plexus-interop/protocol';\nimport { MethodDiscoveryRequest } from '@plexus-interop/client-api';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\nimport { ProvidedMethodReference } from '@plexus-interop/client-api';\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport interface GenericClient {\n\n    getApplicationId(): string;\n\n    getApplicationInstanceId(): UniqueId;\n\n    getConnectionId(): UniqueId;\n\n    requestInvocation(invocationInfo: InvocationMetaInfo): Promise<Invocation>;\n\n    requestDiscoveredInvocation(methodReference: ProvidedMethodReference): Promise<Invocation>;\n\n    acceptInvocations(observer: Observer<Invocation>): Promise<AnonymousSubscription>;\n\n    discoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse>;\n\n    discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse>;\n\n    disconnect(completion?: clientProtocol.ICompletion): Promise<void>;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/GenericClientFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { GenericClient } from './GenericClient';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { GenericClientImpl } from './GenericClientImpl';\nimport { SingleMessageRequest } from './SingleMessageRequst';\nimport { ClientConnectRequest } from '@plexus-interop/client-api';\nimport { clientProtocol as plexus, ClientProtocolHelper, UniqueId } from '@plexus-interop/protocol';\n\nexport class GenericClientFactory {\n\n    private log: Logger = LoggerFactory.getLogger('GenericClientFactory');\n\n    constructor(\n        private readonly transportConnection: TransportConnection,\n        private readonly onDisconnect?: () => Promise<void>) { }\n\n    public async createClient(request: ClientConnectRequest): Promise<GenericClient> {\n        const requestPayload = ClientProtocolHelper.connectRequestPayload(request);\n        this.log.debug('Sending client connect request');\n        return new SingleMessageRequest<plexus.interop.protocol.IConnectResponse>(this.transportConnection, this.log)\n            .execute(requestPayload, (responsePayload) => ClientProtocolHelper.decodeConnectResponse(responsePayload))\n            .then(response => {\n                this.log.info('Client connected');\n                return new GenericClientImpl(\n                    request,\n                    UniqueId.fromProperties(response.connectionId as plexus.IUniqueId),\n                    this.transportConnection,\n                    this.onDisconnect);\n            });\n    }\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/GenericClientImpl.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClient } from './GenericClient';\nimport { Invocation } from '../../client/generic/Invocation';\nimport { GenericInvocation } from './GenericInvocation';\nimport { TransportChannel, TransportConnection } from '@plexus-interop/transport-common';\nimport { AnonymousSubscription, Subscription } from 'rxjs/Subscription';\nimport { RequestedInvocation } from './RequestedInvocation';\nimport { StateMaschine, StateMaschineBase, CancellationToken, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { AcceptedInvocation } from './AcceptedInvocation';\nimport { Observer } from '@plexus-interop/common';\nimport { ClientConnectRequest, ServiceDiscoveryRequest } from '@plexus-interop/client-api';\nimport { ServiceDiscoveryResponse } from '@plexus-interop/client-api';\nimport { SingleMessageRequest } from './SingleMessageRequst';\nimport { ClientProtocolHelper as modelHelper, UniqueId } from '@plexus-interop/protocol';\nimport { clientProtocol as plexus, SuccessCompletion, InvocationRequestInfo } from '@plexus-interop/protocol';\nimport { MethodDiscoveryRequest } from '@plexus-interop/client-api';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\nimport { ProvidedMethodReference } from '@plexus-interop/client-api';\nimport { RequestedDiscoveredInvocation } from './RequestedDiscoveredInvocation';\n\nenum ClientState {\n    CREATED = 'CREATED',\n    LISTEN = 'LISTEN',\n    CLOSED = 'CLOSED'\n}\n\nexport class GenericClientImpl implements GenericClient {\n\n    private readonly state: StateMaschine<ClientState>;\n    private log: Logger;\n    private cancellationToken: CancellationToken = new CancellationToken();\n\n    constructor(\n        private readonly clientInfo: ClientConnectRequest,\n        private readonly connectionId: UniqueId,\n        private readonly transportConnection: TransportConnection,\n        onDisconnect?: () => Promise<void>) {\n        this.log = LoggerFactory.getLogger('GenericClient');\n        this.state = new StateMaschineBase(ClientState.CREATED, [\n            {\n                from: ClientState.CREATED,\n                to: ClientState.LISTEN\n            },\n            {\n                from: ClientState.CREATED,\n                to: ClientState.CLOSED,\n                preHandler: async () => this.cancellationToken.cancel('Closed'),\n                postHandler: onDisconnect\n            },\n            {\n                from: ClientState.LISTEN,\n                to: ClientState.CLOSED,\n                preHandler: async () => this.cancellationToken.cancel('Closed'),\n                postHandler: onDisconnect\n            }\n        ], this.log);\n        this.log.trace('Created');\n    }\n\n    public getApplicationId(): string {\n        return this.clientInfo.applicationId;\n    }\n\n    public getApplicationInstanceId(): UniqueId {\n        return this.clientInfo.applicationInstanceId!;\n    }\n\n    public getConnectionId(): UniqueId {\n        return this.connectionId;\n    }\n\n    public async requestInvocation(invocationInfo: InvocationRequestInfo): Promise<Invocation> {\n        this.log.debug('Invocation requested');\n        const channel: TransportChannel = await this.transportConnection.createChannel();\n        return new RequestedInvocation(new GenericInvocation(channel), invocationInfo);\n    }\n\n    public async requestDiscoveredInvocation(methodReference: ProvidedMethodReference): Promise<Invocation> {\n        this.log.debug('Discovered Invocation requested');\n        const channel: TransportChannel = await this.transportConnection.createChannel();\n        return new RequestedDiscoveredInvocation(new GenericInvocation(channel), methodReference);\n    }\n\n    public async acceptInvocations(observer: Observer<Invocation>): Promise<AnonymousSubscription> {\n        this.log.debug('Accept invocation requested');\n        this.state.throwIfNot(ClientState.CREATED);\n        const channelsObserver: Observer<TransportChannel> = {\n            next: (channel: TransportChannel) => {\n                observer.next(new AcceptedInvocation(new GenericInvocation(channel)));\n            },\n            error: (e) => observer.error(e),\n            complete: () => observer.complete()\n        };\n        this.state.go(ClientState.LISTEN);\n        this.startIncomingChannelsListener(channelsObserver);\n        return new Subscription(() => {\n            this.log.debug('Unsubscribe received');\n            if (this.state.is(ClientState.LISTEN)) {\n                this.state.go(ClientState.CLOSED);\n            }\n        });\n    }\n\n    public discoverService(discoveryRequest: ServiceDiscoveryRequest): Promise<ServiceDiscoveryResponse> {\n        const requestPayload = modelHelper.discoveryServiceRequestPayload(discoveryRequest);\n        return new SingleMessageRequest<plexus.interop.protocol.IServiceDiscoveryResponse>(this.transportConnection, this.log)\n            .execute(requestPayload, (responsePayload) => modelHelper.decodeServiceDiscoveryResponse(responsePayload))\n            .then(response => {\n                this.log.debug(`Discovery Service response received`);\n                return response as ServiceDiscoveryResponse;\n            });\n    }\n\n    public discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse> {\n        const requestPayload = modelHelper.discoveryMethodRequestPayload(discoveryRequest);\n        return new SingleMessageRequest<plexus.interop.protocol.IMethodDiscoveryResponse>(this.transportConnection, this.log)\n            .execute(requestPayload, (responsePayload) => modelHelper.decodeMethodDiscoveryResponse(responsePayload))\n            .then(response => {\n                this.log.debug(`Discovery Method response received`);\n                return response as MethodDiscoveryResponse;\n            });\n    }\n\n    public disconnect(completion: plexus.ICompletion = new SuccessCompletion()): Promise<void> {\n        return this.transportConnection.disconnect(completion);\n    }\n\n    private async startIncomingChannelsListener(observer: Observer<TransportChannel>): Promise<void> {\n        this.log.debug('Started to listen for channels');\n        this.transportConnection.subscribeToChannels({\n            next: channel => {\n                if (this.state.is(ClientState.LISTEN)) {\n                    this.log.debug('Channel received');\n                    observer.next(channel);\n                } else {\n                    this.log.warn(`State is ${this.state.getCurrent()}, skip incoming channel`);\n                }\n            },\n            complete: () => {\n                this.log.debug('Channels subscription completed');\n                if (!this.transportConnection.isConnected() && !this.state.is(ClientState.CLOSED)) {\n                    this.log.info('Transport connection closed, move client to closed');\n                    this.state.go(ClientState.CLOSED);\n                }\n                observer.complete();\n            },\n            error: e => {\n                this.log.error('Error while receiving channel', e);\n                if (!this.state.is(ClientState.CLOSED)) {\n                    this.state.go(ClientState.CLOSED);\n                }\n            }\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/GenericInvocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId, Channel } from '@plexus-interop/transport-common';\nimport { clientProtocol as plexus, SuccessCompletion, ErrorCompletion, ClientError, ClientProtocolUtils, InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { ClientProtocolHelper as modelHelper, ClientProtocolHelper } from '@plexus-interop/protocol';\nimport { InvocationState } from './InvocationState';\nimport { Subscription, AnonymousSubscription } from 'rxjs/Subscription';\nimport { StateMaschine, CancellationToken, Logger, LoggerFactory, StateMaschineBase, once } from '@plexus-interop/common';\nimport { ProvidedMethodReference } from '@plexus-interop/client-api';\nimport { ClientDtoUtils } from '../ClientDtoUtils';\nimport { InvocationChannelObserver } from './InvocationChannelObserver';\n\nexport class GenericInvocation {\n\n    private readonly stateMachine: StateMaschine<InvocationState>;\n\n    private pendingHeader: plexus.interop.protocol.IInvocationMessageHeader | null;\n\n    private id: UniqueId;\n\n    private sentMessagesCounter: number = 0;\n\n    private sendCompletionReceived: boolean = false;\n\n    private sendCompletionReceivedCallback: (() => void) | null = null;\n\n    private metaInfo: InvocationMetaInfo;\n\n    private log: Logger;\n\n    public readonly readCancellationToken: CancellationToken;\n\n    public constructor(\n        private readonly sourceChannel: Channel,\n        baseReadToken: CancellationToken = new CancellationToken()) {\n        this.readCancellationToken = new CancellationToken(baseReadToken);\n        this.log = LoggerFactory.getLogger('Invocation');\n        this.memoizedClose = once(this.memoizedClose.bind(this));\n        this.stateMachine = new StateMaschineBase<InvocationState>(InvocationState.CREATED, [\n            // initialization\n            { from: InvocationState.CREATED, to: InvocationState.START_REQUESTED },\n            { from: InvocationState.START_REQUESTED, to: InvocationState.REMOTE_STARTING },\n            { from: InvocationState.REMOTE_STARTING, to: InvocationState.OPEN },\n            { from: InvocationState.CREATED, to: InvocationState.ACCEPTING_INVOCATION_INFO },\n            { from: InvocationState.ACCEPTING_INVOCATION_INFO, to: InvocationState.OPEN },\n            { from: InvocationState.START_REQUESTED, to: InvocationState.OPEN },\n            // active -> completion\n            { from: InvocationState.OPEN, to: InvocationState.COMPLETION_RECEIVED },\n            { from: InvocationState.OPEN, to: InvocationState.SENT_COMPLETED },\n            { from: InvocationState.COMPLETION_RECEIVED, to: InvocationState.COMPLETION_HANDSHAKE },\n            { from: InvocationState.SENT_COMPLETED, to: InvocationState.COMPLETION_HANDSHAKE },\n            // closure\n            { from: InvocationState.COMPLETION_HANDSHAKE, to: InvocationState.COMPLETED },\n            // forced closure\n            { from: InvocationState.OPEN, to: InvocationState.COMPLETED },\n            { from: InvocationState.SENT_COMPLETED, to: InvocationState.COMPLETED }\n        ]);\n    }\n\n    public start(metaInfo: InvocationMetaInfo, invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.metaInfo = metaInfo;\n        this.log.trace('Start basic invocation');\n        this.startInvocationInternal(() => this.sendStartInvocationRequest(metaInfo), invocationObserver);\n    }\n\n    public startDiscovered(\n        methodReference: ProvidedMethodReference,\n        invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.trace('Start discovered invocation');\n        this.metaInfo = ClientDtoUtils.providedMethodToInvocationInfo(methodReference);\n        this.startInvocationInternal(() => this.sendStartDiscoveredInvocationRequest(methodReference), invocationObserver);\n    }\n\n    public acceptInvocation(invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.debug('Accept of invocation requested');\n        this.stateMachine.throwIfNot(InvocationState.CREATED);\n        this.stateMachine.go(InvocationState.ACCEPTING_INVOCATION_INFO);\n        this.openSubscription(invocationObserver)\n            .catch(e => this.log.error('Failed to open channel subscription', e));\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n    public getMetaInfo(): InvocationMetaInfo {\n        return this.metaInfo;\n    }\n\n    public sendCompleted(): void {\n        this.stateMachine.throwIfNot(InvocationState.OPEN, InvocationState.COMPLETION_RECEIVED);\n        if (this.stateMachine.is(InvocationState.COMPLETION_RECEIVED)) {\n            this.stateMachine.go(InvocationState.COMPLETION_HANDSHAKE);\n        } else {\n            this.stateMachine.go(InvocationState.SENT_COMPLETED);\n        }\n        this.sourceChannel.sendMessage(modelHelper.sendCompletionPayload({}));\n    }\n\n    public async close(completion: plexus.ICompletion = new SuccessCompletion()): Promise<plexus.ICompletion> {\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug('Close invocation requested', JSON.stringify(completion));\n        }\n        return this.memoizedClose(completion);\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.stateMachine.throwIfNot(InvocationState.OPEN, InvocationState.COMPLETION_RECEIVED, InvocationState.SENT_COMPLETED);\n        this.log.trace(`Sending message of ${data.byteLength} bytes`);\n        const headerPayload = modelHelper.messageHeaderPayload({\n            length: data.byteLength\n        });\n        this.sourceChannel.sendMessage(headerPayload);\n        this.sourceChannel.sendMessage(data);\n        this.sentMessagesCounter++;\n    }\n\n    // public methods below are NOT a part of API, for unit tests only\n\n    public currentState(): InvocationState {\n        return this.stateMachine.getCurrent();\n    }\n\n    public getSentMessagesCounter(): number {\n        return this.sentMessagesCounter;\n    }\n\n    private async memoizedClose(completion: plexus.ICompletion): Promise<plexus.ICompletion> {\n\n        this.stateMachine.throwIfNot(InvocationState.OPEN, InvocationState.COMPLETION_RECEIVED, InvocationState.SENT_COMPLETED, InvocationState.COMPLETION_HANDSHAKE);\n\n        const isSuccessCompletion = ClientProtocolHelper.isSuccessCompletion(completion);\n        \n        if (isSuccessCompletion && this.stateMachine.isOneOf(InvocationState.COMPLETION_RECEIVED, InvocationState.OPEN)) {\n            this.sendCompleted();\n        }\n\n        this.stateMachine.go(InvocationState.COMPLETED);\n\n        return new Promise((resolveCloseAction, rejectCloseAction) => {\n            const closeChannel = () => {\n                this.log.trace('Sending channel close message');\n                this.closeChannel(completion)\n                    .then(result => resolveCloseAction(result))\n                    .catch(e => rejectCloseAction(e));\n            };\n            if (isSuccessCompletion && !this.sendCompletionReceived) {\n                // wait for remote side for success case only\n                this.log.debug('Waiting for remote completion');\n                this.sendCompletionReceivedCallback = closeChannel;\n            } else {\n                closeChannel();\n            }\n        });\n    }\n\n    private setUuid(id: UniqueId): void {\n        this.log.debug(`Set id, ${id.toString()}`);\n        this.log = LoggerFactory.getLogger(`Invocation [${id.toString()}]`);\n        this.id = id;\n    }\n\n    private startInvocationInternal(sendRequest: () => Promise<void>, invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.debug('Invocation start requested');\n        this.stateMachine.throwIfNot(InvocationState.CREATED);\n        this.setUuid(UniqueId.generateNew());\n        const subscriptionStartedPromise = this.openSubscription(invocationObserver);\n        this.stateMachine.goAsync(InvocationState.START_REQUESTED, {\n            preHandler: async () => {\n                await subscriptionStartedPromise;\n                await sendRequest();\n            }\n        })\n            .catch(e => this.log.error('Invocation start failed', e));\n    }\n\n    private terminate(message: string): void {\n        this.log.error('Terminating channel');\n        this.closeChannel(new ErrorCompletion(new ClientError(message)));\n    }\n\n    private closeChannel(completion: plexus.ICompletion): Promise<plexus.ICompletion> {\n        return this.sourceChannel.close(completion).then((channelCompletion) => {\n            this.log.debug('Channel closed');\n            this.closeInternal();\n            const result = ClientProtocolUtils.createSummarizedCompletion(completion, channelCompletion, this.checkInternalStatus());\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Completion result ${JSON.stringify(result)}`);\n            }\n            return result;\n        }).catch((e) => {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug('Error during channel closure', e);\n            }\n            this.closeInternal();\n            throw e;\n        });\n    }\n\n    private handleRemoteSentCompleted(invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.debug('Source channel subscription completed');\n        invocationObserver.streamCompleted();\n        this.sendCompletionReceived = true;\n        if (this.sendCompletionReceivedCallback) {\n            this.sendCompletionReceivedCallback();\n            this.sendCompletionReceivedCallback = null;\n        }\n        switch (this.stateMachine.getCurrent()) {\n            case InvocationState.SENT_COMPLETED:\n                this.log.debug('SENT_COMPLETED -> COMPLETION_HANDSHAKE');\n                this.stateMachine.go(InvocationState.COMPLETION_HANDSHAKE);\n                break;\n            case InvocationState.OPEN:\n                this.log.debug('OPEN -> COMPLETION_RECEIVED');\n                this.stateMachine.go(InvocationState.COMPLETION_RECEIVED);\n                break;\n            case InvocationState.COMPLETED:\n                this.log.debug('Already completed');\n                break;\n            default:\n                throw new Error(`Can't handle completion, invalid state ${this.stateMachine.getCurrent()}`);\n        }\n    }\n\n    private async closeInternal(): Promise<void> {\n        this.readCancellationToken.cancel('Invocation closed');\n    }\n\n    private openSubscription(\n        invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): Promise<AnonymousSubscription> {\n        this.log.trace(`Starting listening of incoming messages`);\n        return new Promise<AnonymousSubscription>((resolve, reject) => {\n            this.sourceChannel.open({\n\n                started: sourceSubscription => {\n                    this.log.debug('Source channel subscription started');\n                    resolve(sourceSubscription);\n                },\n\n                startFailed: error => {\n                    this.log.error('Unable to open source channel', error);\n                    invocationObserver.startFailed(error);\n                    reject(error);\n                },\n\n                next: message => {\n                    try {\n                        this.handleIncomingMessage(message, invocationObserver);\n                    } catch (e) {\n                        const errorText = 'Error while processing of incoming message';\n                        this.log.error(errorText, e);\n                        this.terminate(errorText);\n                        invocationObserver.error(e);\n                    }\n                },\n\n                complete: completion => {\n                    this.log.debug('Remote channel closed');\n                    invocationObserver.complete(completion);\n                },\n\n                error: (e) => {\n                    this.log.error('Error from source channel received', e);\n                    this.closeInternal();\n                    invocationObserver.error(e);\n                }\n\n            });\n        });\n\n    }\n\n    private handleIncomingMessage(data: ArrayBuffer, invocationObserver: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.trace(`Received message of ${data.byteLength} bytes`);\n        if (this.readCancellationToken.isCancelled()) {\n            this.log.warn(`Read cancelled with '${this.readCancellationToken.getReason()}', drop message`);\n            return;\n        }\n        if (this.pendingHeader) {\n            this.log.trace(`Received message payload of ${data.byteLength} length`);\n            this.pendingHeader = null;\n            this.sourceChannel.sendMessage(modelHelper.messageReceivedPayload({\n                invocationId: this.uuid()\n            }));\n            invocationObserver.next(data);\n        } else if (this.stateMachine.is(InvocationState.START_REQUESTED)) {\n            this.log.debug('Received invocation starting message');\n            modelHelper.decodeInvocationStarting(data);\n            this.stateMachine.go(InvocationState.REMOTE_STARTING);\n        } else if (this.stateMachine.is(InvocationState.REMOTE_STARTING)) {\n            this.log.debug('Received invocation started message');\n            modelHelper.decodeInvocationStarted(data);\n            this.stateMachine.go(InvocationState.OPEN);\n            // requested invocation started\n            invocationObserver.started(new Subscription(() => this.close()));\n        } else if (this.stateMachine.is(InvocationState.ACCEPTING_INVOCATION_INFO)) {\n            const envelopObject = modelHelper.decodeBrokerEnvelop(data);\n            if (envelopObject.invocationStartRequested) {\n                if (this.log.isTraceEnabled()) {\n                    this.log.trace(`Received invocation request message ${JSON.stringify(envelopObject.invocationStartRequested)}`);\n                }\n                this.metaInfo = ClientProtocolHelper.toInvocationInfo(envelopObject.invocationStartRequested);\n                // accepted invocation started\n                this.setUuid(UniqueId.generateNew());\n                this.stateMachine.go(InvocationState.OPEN);\n                this.sourceChannel.sendMessage(modelHelper.invocationStartedMessagePayload({\n                    invocationId: this.uuid()\n                }));\n                invocationObserver.started(new Subscription(() => this.close()));\n            } else {\n                this.log.warn(`Unknown message received ${JSON.stringify(envelopObject)}`);\n            }\n        } else if (this.stateMachine.isOneOf(\n            InvocationState.OPEN, \n            InvocationState.SENT_COMPLETED,\n            InvocationState.COMPLETION_HANDSHAKE,\n            InvocationState.COMPLETED, \n            InvocationState.COMPLETION_RECEIVED)) {\n            const envelopObject = modelHelper.decodeInvocationEnvelop(data);\n            if (envelopObject.message) {\n                this.log.trace(`Received message header`);\n                this.pendingHeader = envelopObject.message;\n            } else if (envelopObject.confirmation) {\n                this.log.trace(`Received message delivery confirmation`);\n                this.sentMessagesCounter--;\n            } else if (envelopObject.sendCompletion) {\n                this.log.trace(`Received send completion`);\n                this.handleRemoteSentCompleted(invocationObserver);\n            } else {\n                this.log.warn(`Unknown message received ${JSON.stringify(envelopObject)}`);\n            }\n        } else {\n            throw new Error(`Unexpected state, ${this.currentState()}`);\n        }\n    }\n\n    private checkInternalStatus(): plexus.ICompletion {\n        if (this.sentMessagesCounter !== 0) {\n            const message = `Confirmation not received for all messages, ${this.sentMessagesCounter}`;\n            return {\n                status: plexus.Completion.Status.Failed,\n                error: {\n                    message\n                }\n            };\n        } else {\n            return {\n                status: plexus.Completion.Status.Completed\n            };\n        }\n    }\n\n    private async sendStartInvocationRequest(metaInfo: InvocationMetaInfo): Promise<void> {\n        this.log.trace('Sending start request to channel');\n        const payload = modelHelper.invocationStartRequestPayload(metaInfo);\n        return this.sourceChannel.sendMessage(payload);\n    }\n\n    private async sendStartDiscoveredInvocationRequest(methodReference: ProvidedMethodReference): Promise<void> {\n        this.log.trace('Sending start discovered request to channel');\n        const payload = modelHelper.discoveredInvocationStartRequestPayload(methodReference);\n        return this.sourceChannel.sendMessage(payload);\n    }\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/Invocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseInvocation } from './BaseInvocation';\n\nexport interface Invocation extends BaseInvocation<ArrayBuffer, ArrayBuffer> {\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/InvocationChannelObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChannelObserver } from '@plexus-interop/transport-common';\nimport { InvocationObserver } from '.';\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface InvocationChannelObserver<S, D> extends ChannelObserver<S, D>, InvocationObserver<D> {\n    complete: (completion?: plexus.ICompletion) => void;\n} "
  },
  {
    "path": "web/packages/client/src/client/generic/InvocationObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from '@plexus-interop/common';\n\nexport interface InvocationObserver<T> extends Observer<T> {\n\n    /**\n     * Indicates that incoming messages stream completed\n     */\n    streamCompleted: () => void;\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/InvocationObserverConverter.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InvocationObserver } from './InvocationObserver';\nimport { ConversionObserver } from '@plexus-interop/common';\n\nexport class InvocationObserverConverter<S, D> extends ConversionObserver<S, D> implements InvocationObserver<D>  {\n\n    private baseSource: InvocationObserver<S>;\n\n    constructor(\n        source: InvocationObserver<S>,\n        converter: (from: D) => S) {\n        super(source, converter);\n        this.baseSource = source;\n    }\n\n    public streamCompleted(): void {\n        return this.baseSource.streamCompleted();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/InvocationState.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// tslint:disable-next-line:variable-name\nexport enum InvocationState {\n    CREATED = 'CREATED',\n    START_REQUESTED = 'START_REQUESTED',\n    REMOTE_STARTING = 'REMOTE_STARTING',\n    ACCEPTING_INVOCATION_INFO = 'ACCEPTING_INVOCATION_INFO',\n    OPEN = 'OPEN',\n    COMPLETION_RECEIVED = 'COMPLETION_RECEIVED',\n    SENT_COMPLETED = 'COMPLETION_SENT',\n    COMPLETION_HANDSHAKE = 'COMPLETION_HANDSHAKE',\n    COMPLETED = 'COMPLETED'\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/RequestedDiscoveredInvocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from '../../client/generic/Invocation';\nimport { GenericInvocation } from './GenericInvocation';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { AnonymousSubscription } from '../../client/api/AnonymousSubscription';\nimport { clientProtocol as plexus, InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { ProvidedMethodReference } from '@plexus-interop/client-api';\nimport { InvocationChannelObserver } from './InvocationChannelObserver';\n\nexport class RequestedDiscoveredInvocation implements Invocation {\n\n    constructor(\n        private readonly genericInvocation: GenericInvocation,\n        private readonly methodReference: ProvidedMethodReference) { }\n\n    public uuid(): UniqueId {\n        return this.genericInvocation.uuid();\n    }\n\n    public sendMessage(data: ArrayBuffer): Promise<void> {\n        return this.genericInvocation.sendMessage(data);\n    }\n\n    public open(observer: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        return this.genericInvocation.startDiscovered(this.methodReference, observer);\n    }\n\n    public close(completion?: plexus.ICompletion): Promise<plexus.ICompletion> {\n        return this.genericInvocation.close(completion);\n    }\n\n    public getMetaInfo(): InvocationMetaInfo {\n        return this.genericInvocation.getMetaInfo();\n    }\n\n    public async sendCompleted(): Promise<void> {\n        return this.genericInvocation.sendCompleted();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/RequestedInvocation.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Invocation } from '../../client/generic/Invocation';\nimport { GenericInvocation } from './GenericInvocation';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { AnonymousSubscription } from '../../client/api/AnonymousSubscription';\nimport { clientProtocol as plexus, InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { InvocationChannelObserver } from './InvocationChannelObserver';\n\nexport class RequestedInvocation implements Invocation {\n\n    constructor(\n        private readonly genericInvocation: GenericInvocation,\n        private readonly metaInfo: InvocationMetaInfo) { }\n\n    public uuid(): UniqueId {\n        return this.genericInvocation.uuid();\n    }\n\n    public sendMessage(data: ArrayBuffer): Promise<void> {\n        return this.genericInvocation.sendMessage(data);\n    }\n\n    public open(observer: InvocationChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        return this.genericInvocation.start(this.metaInfo, observer);\n    }\n\n    public async sendCompleted(): Promise<void> {\n        return this.genericInvocation.sendCompleted();\n    }\n\n    public close(completion?: plexus.ICompletion): Promise<plexus.ICompletion> {\n        return this.genericInvocation.close(completion);\n    }\n\n    public getMetaInfo(): InvocationMetaInfo {\n        return this.genericInvocation.getMetaInfo();\n    }\n\n}"
  },
  {
    "path": "web/packages/client/src/client/generic/SingleMessageRequst.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { Logger } from '@plexus-interop/common';\nimport { ClientProtocolHelper } from '@plexus-interop/protocol';\n\n/**\n * Represents Single Request to Broker\n */\nexport class SingleMessageRequest<R> {\n\n    constructor(\n        private readonly transportConnection: TransportConnection,\n        private readonly log: Logger) { }\n\n    public async execute(requestPayload: ArrayBuffer, decodeFn: (responsePayload: ArrayBuffer) => R): Promise<R> {\n        return new Promise<R>((resolve, reject) => {\n            (async () => {\n                try {\n                    const channel = await this.transportConnection.createChannel();\n                    channel.open({\n                        startFailed: e => reject(e),\n                        started: () => {\n                            this.log.debug('Channel is open, sending connection request');\n                            channel.sendLastMessage(requestPayload)\n                                .then(completion => {\n                                    if (!ClientProtocolHelper.isSuccessCompletion(completion)) {\n                                        /* istanbul ignore if */\n                                        if (this.log.isDebugEnabled()) {\n                                            this.log.debug('Received non successful completion', completion);\n                                        }\n                                        reject(completion.error);\n                                    }  \n                                });\n                        },\n                        next: data => {\n                            try {\n                                this.log.trace('Received single message response');\n                                const message = decodeFn(data);\n                                resolve(message);\n                            } catch (decodingError) {\n                                this.log.error('Unable to decode message', decodingError);\n                                reject(decodingError);\n                            }\n                        },\n                        complete: () => this.log.debug('Channel closed'),\n                        error: e => reject(e)\n                    });\n                } catch (error) {\n                    this.log.error('Unable to open channel', error);\n                    reject(error);\n                }\n            })();\n        });\n    }\n}\n"
  },
  {
    "path": "web/packages/client/src/client/generic/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './GenericClientFactory';\nexport * from './GenericClient';\nexport * from './Invocation';\nexport { InvocationMetaInfo as InvocationMetaInfo } from '@plexus-interop/protocol';\nexport * from './GenericClientFactory';\nexport * from './GenericClient';\nexport * from './InvocationObserver';\nexport * from './BaseInvocation';\nexport * from './InvocationChannelObserver';\nexport * from './InvocationObserverConverter';"
  },
  {
    "path": "web/packages/client/src/client/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './generic';\nexport * from './api';"
  },
  {
    "path": "web/packages/client/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './client';\nexport {UniqueId as UniqueId} from '@plexus-interop/transport-common';\nexport {InvocationRequestInfo as InvocationRequestInfo} from '@plexus-interop/protocol';\nexport {ReadOnlyCancellationToken as ReadOnlyCancellationToken} from '@plexus-interop/common';"
  },
  {
    "path": "web/packages/client/tests/BufferedInvocationObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BlockingQueueBase, CancellationToken } from '@plexus-interop/common';\nimport { LogInvocationObserver } from './LogInvocationObserver';\n\nexport class BufferedInvocationObserver<T> extends LogInvocationObserver<T> {\n\n    constructor(private cancellationToken?: CancellationToken, private buffer: BlockingQueueBase<T> = new BlockingQueueBase<T>()) {\n        super();\n    }\n\n    public next(data: T): void {\n        super.next(data);\n        this.buffer.enqueue(data);\n    }\n\n    public pullData(): Promise<T> {\n        return this.buffer.blockingDequeue(this.cancellationToken);\n    }\n}"
  },
  {
    "path": "web/packages/client/tests/LogInvocationObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport class LogInvocationObserver<T> implements Observer<T> {\n\n    constructor(private _next?: (data: T) => void, private id: UniqueId = UniqueId.generateNew()) { }\n\n    public streamCompleted(): void {\n        // tslint:disable-next-line:no-console\n        console.log('Stream completed');\n    }\n\n    public complete(): void {\n        // tslint:disable-next-line:no-console\n        console.log(`${this.id.toString()} - Complete`);\n    }\n\n    public next(data: T): void {\n        // tslint:disable-next-line:no-console\n        console.log(`${this.id.toString()} - Next`, data);\n        if (this._next) {\n            this._next(data);\n        }\n    }\n\n    public error(error: any): void {\n        // tslint:disable-next-line:no-console\n        console.log(`${this.id.toString()} - Error`);\n    }\n\n}"
  },
  {
    "path": "web/packages/client/tests/client/DefaultConnectionDetailsService.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionDetails } from '../../src/client/api/container/ConnectionDetails';\nimport { DefaultConnectionDetailsService } from '../../src/client/api/container/DefaultConnectionDetailsService';\n\ndescribe('DefaultConnectionDetailsService', () => {\n\n    it('getConnectionDetails returns correct result', async (done) => {\n        const service = new DefaultConnectionDetailsService(getConnectionDetails);\n        service.getConnectionDetails().then(r => {\n            expect(r.ws.port).toBe(42);\n            expect(r.ws.wssPort).toBe(24);\n            expect(r.appInstanceId).toBe('007');\n            done();\n        });\n    });\n\n    it('getMetadataUrl returns correct result', async (done) => {\n        const service = new DefaultConnectionDetailsService(getConnectionDetails);\n        service.getMetadataUrl().then(r => {\n            expect(r).toBe('wss://127.0.0.1:24/metadata/interop');\n            done();\n        });\n    });\n\n    function getConnectionDetails(): Promise<ConnectionDetails> {\n        return Promise.resolve<ConnectionDetails>({\n            ws: {\n                port: 42,\n                wssPort: 24\n            },\n            appInstanceId: '007'\n        });\n    }\n});\n"
  },
  {
    "path": "web/packages/client/tests/client/GenericClient.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericClientFactory } from '../../src/client/generic/GenericClientFactory';\nimport { FramedTransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { when, mock, instance } from 'ts-mockito';\nimport { CancellationToken } from '@plexus-interop/common';\nimport { ClientProtocolHelper as modelHelper } from '@plexus-interop/protocol';\nimport { BufferedChannel } from './client-mocks';\n\ndescribe('GenericClient', () => {\n\n    it('Can be created if connect request/response handshake received', async () => {\n        const mockedConnection = mock(FramedTransportConnection);\n        const cancellationToken = new CancellationToken();\n        const mockChannel = new BufferedChannel(cancellationToken);\n        const id = UniqueId.generateNew();\n        when(mockedConnection.createChannel()).thenReturn(Promise.resolve(mockChannel));\n        when(mockedConnection.uuid()).thenReturn(id);\n        const connection = instance(mockedConnection);\n\n        const sut = new GenericClientFactory(connection);\n\n        const clientPromise = sut.createClient({ applicationId: 'appId' });\n        const connectRequest = modelHelper.decodeConnectRequest(await mockChannel.pullOutMessage());\n        expect(connectRequest).toBeDefined();\n        expect(connectRequest.applicationId).toEqual('appId');\n\n        mockChannel.addToInbox(modelHelper.connectResponsePayload({\n            connectionId: UniqueId.generateNew()\n        }));\n        await clientPromise;\n        cancellationToken.cancel('All done');\n    });\n\n    it('Can execute discovery operation', async () => {\n        const cancellationToken = new CancellationToken();\n\n        const mockedConnection = mock(FramedTransportConnection);\n        let mockChannel = new BufferedChannel(cancellationToken);\n        const id = UniqueId.generateNew();\n        when(mockedConnection.createChannel()).thenReturn(Promise.resolve(mockChannel));\n        when(mockedConnection.uuid()).thenReturn(id);\n        const connection = instance(mockedConnection);\n\n        const sut = new GenericClientFactory(connection);\n\n        const clientPromise = sut.createClient({ applicationId: 'appId' });\n        modelHelper.decodeConnectRequest(await mockChannel.pullOutMessage());\n\n        mockChannel.addToInbox(modelHelper.connectResponsePayload({\n            connectionId: UniqueId.generateNew()\n        }));\n\n        const client = await clientPromise;\n\n        mockChannel = new BufferedChannel(cancellationToken);\n        when(mockedConnection.createChannel()).thenReturn(Promise.resolve(mockChannel));\n\n        const discoveryResultPromise = client.discoverService({\n            consumedService: {\n                serviceId: 'serviceId'\n            }\n        });\n\n        const discoveryRequest = modelHelper.decodeServiceDiscoveryRequest(await mockChannel.pullOutMessage());\n        expect(discoveryRequest).toBeDefined();\n        if (discoveryRequest.consumedService) {\n            expect(discoveryRequest.consumedService.serviceId).toEqual('serviceId');\n        } else {\n            fail('Consumed service is null');\n        }\n\n        mockChannel.addToInbox(modelHelper.discoveryResponsePayload(\n            {\n                services: [\n                    {\n                        consumedService: {\n                            serviceId: 'serviceId'\n                        },\n                        providedService: {\n                            serviceId: 'serviceId'\n                        }\n                    }\n                ]\n            }\n        ));\n\n        const response = await discoveryResultPromise;\n        expect(response).toBeDefined();\n        if (response.services) {\n            expect(response.services[0].consumedService).toBeDefined();\n            expect(response.services[0].providedService).toBeDefined();\n        } else {\n            fail('Response is empty');\n        }\n        cancellationToken.cancel('All done');\n    });\n\n});"
  },
  {
    "path": "web/packages/client/tests/client/GenericClientApi.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { when, mock, instance, anything, verify, capture } from 'ts-mockito';\nimport { GenericClientApiImpl } from '../../src/client/api/generic/GenericClientApiImpl';\nimport { GenericClientImpl } from '../../src/client/generic/GenericClientImpl';\nimport { RequestedInvocation } from '../../src/client/generic/RequestedInvocation';\nimport { Observer } from '@plexus-interop/common';\nimport { createRemoteInvocationInfo, MockMarshallerProvider } from './client-mocks';\nimport { clientProtocol as plexus, Completion, SuccessCompletion } from '@plexus-interop/protocol';\nimport { Subscription, AnonymousSubscription } from 'rxjs/Subscription';\nimport { ChannelObserver } from '@plexus-interop/transport-common';\nimport { InvocationHandlersRegistry} from '../../src';\nimport { Arrays } from '@plexus-interop/common';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\n\ndescribe('GenericClientApi', () => {\n\n    it('Can send point to point invocation and receive result', async (done) => {\n        const mockInvocation = mock(RequestedInvocation);\n\n        const responsePayload = new Uint8Array([3, 2, 1]).buffer;\n        const requestPayload = new Uint8Array([1, 2, 3]).buffer;\n\n        when(mockInvocation.open(anything())).thenCall((observer: Observer<ArrayBuffer>) => {\n            observer.next(responsePayload);\n            observer.complete();\n        });\n\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n        when(mockInvocation.close(anything())).thenReturn(Promise.resolve(new SuccessCompletion()));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n\n        await clientApi.sendRawUnaryRequest(createRemoteInvocationInfo(), requestPayload, {\n            value: (v) => {\n                expect(v).toEqual(responsePayload);\n                done();\n            },\n            error: () => { }\n        });\n\n    });\n\n    it('Fails Point to Point invocation if completed without message', (done) => {\n\n        const mockInvocation = mock(RequestedInvocation);\n\n        const requestPayload = new Uint8Array([1, 2, 3]).buffer;\n\n        when(mockInvocation.open(anything())).thenCall((observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>) => {\n            observer.started(new Subscription());\n            observer.complete();\n        });\n\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n        when(mockInvocation.close(anything())).thenReturn(Promise.resolve(new SuccessCompletion()));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n\n        clientApi.sendRawUnaryRequest(createRemoteInvocationInfo(), requestPayload, {\n            value: (v) => { },\n            error: () => done()\n        });\n\n    });\n\n    it('Fails Point to Point invocation if send message failed', (done) => {\n\n        const mockInvocation = mock(RequestedInvocation);\n\n        const requestPayload = new Uint8Array([1, 2, 3]).buffer;\n\n        when(mockInvocation.open(anything())).thenCall((observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>) => {\n            observer.started(new Subscription());\n            observer.complete();\n        });\n\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.reject('Error'));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n        clientApi.sendRawUnaryRequest(createRemoteInvocationInfo(), requestPayload, {\n            value: (v) => { },\n            error: () => { }\n        }).catch(() => done());\n\n    });\n\n    it('Fails Point to Point invocation if request invocation failed', (done) => {\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything())).thenReturn(Promise.reject('Error'));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n        const requestPayload = new Uint8Array([1, 2, 3]).buffer;\n\n        clientApi.sendRawUnaryRequest(createRemoteInvocationInfo(), requestPayload, {\n            value: (v) => { },\n            error: () => { }\n        }).catch(() => done());\n\n    });\n\n    it('Allows to cancel invocation by client', async () => {\n\n        const mockInvocation = mock(RequestedInvocation);\n\n        const requestPayload = new Uint8Array([1, 2, 3]).buffer;\n\n        when(mockInvocation.open(anything())).thenCall((observer) => observer.started(new Subscription()));\n\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n        when(mockInvocation.close(anything())).thenReturn(Promise.resolve(new SuccessCompletion()));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n        const invocationClient = await clientApi.sendRawUnaryRequest(createRemoteInvocationInfo(), requestPayload, {\n            value: (v) => {\n                fail('Not expected');\n            },\n            error: () => {\n                fail('Not expected');\n            }\n        });\n\n        await invocationClient.cancel();\n        verify(mockInvocation.close(anything())).called();\n        const [completion] = capture(mockInvocation.close).last();\n        expect((completion as Completion).status).toBe(plexus.Completion.Status.Canceled);\n\n    });\n\n    it('Can send few messages and complete invocation by Streaming client', async () => {\n\n        const mockInvocation = mock(RequestedInvocation);\n\n        const first = new Uint8Array([3, 2, 1]).buffer;\n        const second = new Uint8Array([1, 2, 3]).buffer;\n\n        when(mockInvocation.open(anything())).thenCall((observer) => observer.started(new Subscription()));\n\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n        when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n        when(mockInvocation.close(anything())).thenReturn(Promise.resolve(new SuccessCompletion()));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n        const streamingInvocationClient = await clientApi.sendRawBidirectionalStreamingRequest(createRemoteInvocationInfo(), {\n            next: (v) => {\n                fail('Not expected');\n            },\n            complete: () => { },\n            error: () => { },\n            streamCompleted: () => { }\n        });\n\n        await streamingInvocationClient.next(first);\n        await streamingInvocationClient.next(second);\n        await streamingInvocationClient.complete();\n\n        verify(mockInvocation.close(anything())).once();\n        verify(mockInvocation.sendMessage(anything())).twice();\n        verify(mockInvocation.sendMessage(first)).once();\n        verify(mockInvocation.sendMessage(second)).once();\n\n    });\n\n    it('Can invoke own registered handler', async () => {\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n\n        const serviceInfo = {\n            serviceId: 'service'\n        };\n        const methodId = 'method';\n        const requestPayload = 'test';\n\n        registry.registerUnaryHandler({\n            serviceInfo,\n            methodId,\n            handle: async (context, request) => {\n                expect(request).toBe(requestPayload);\n                return request;\n            }\n        }, {}, {});\n\n        const mockGenericClient = mock(GenericClientImpl);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n\n        const response = await clientApi.invokeUnaryHandler(new MethodInvocationContext('app'), { serviceId: serviceInfo.serviceId, methodId }, requestPayload);\n        \n        expect(response).toBe(requestPayload);\n        \n    });\n\n    it('Can invoke own registered generic handler', async () => {\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n\n        const serviceInfo = {\n            serviceId: 'service'\n        };\n        const methodId = 'method';\n        const requestPayload = Arrays.toArrayBuffer(new Uint8Array([123]));\n\n        registry.registerUnaryGenericHandler({\n            serviceInfo,\n            methodId,\n            handle: async (context, request) => {\n                expect(new Uint8Array(request)).toEqual(new Uint8Array(requestPayload));\n                return request;\n            }\n        });\n\n        const mockGenericClient = mock(GenericClientImpl);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n\n        const response = await clientApi.invokeRawUnaryHandler(new MethodInvocationContext('app'), { serviceId: serviceInfo.serviceId, methodId }, requestPayload);\n        expect(new Uint8Array(response)).toEqual(new Uint8Array(requestPayload));\n\n    });\n\n    it('Can receive message, completion and complete invocation with Streaming client', async (done) => {\n\n        const mockInvocation = mock(RequestedInvocation);\n\n        const responsePayload = new Uint8Array([3, 2, 1]).buffer;\n        when(mockInvocation.open(anything())).thenCall((observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>) => {\n            setTimeout(() => {\n                observer.started(new Subscription());\n                setTimeout(() => {\n                    observer.next(responsePayload);\n                    observer.next(responsePayload);\n                    observer.complete();\n                }, 0);\n            }, 0);\n        });\n\n        when(mockInvocation.close(anything())).thenReturn(Promise.resolve(new SuccessCompletion()));\n\n        const mockGenericClient = mock(GenericClientImpl);\n        when(mockGenericClient.requestInvocation(anything()))\n            .thenReturn(Promise.resolve(instance(mockInvocation)));\n\n        const mockMarshaller = new MockMarshallerProvider();\n        const registry = new InvocationHandlersRegistry(mockMarshaller);\n        const clientApi = new GenericClientApiImpl(instance(mockGenericClient), mockMarshaller, registry);\n        let count = 0;\n        const streamingInvocationClient = await clientApi.sendRawBidirectionalStreamingRequest(createRemoteInvocationInfo(), {\n            next: (v) => {\n                expect(v).toBe(responsePayload);\n                count++;\n            },\n            complete: () => {\n                streamingInvocationClient.complete().then(() => {\n                    expect(count).toBe(2);\n                    verify(mockInvocation.close(anything())).once();\n                    done();\n                }, (e) => {\n                    fail('Error not expected');\n                });\n            },\n            error: () => fail('Not expected'),\n            streamCompleted: () => { }\n        });\n\n    });\n\n});"
  },
  {
    "path": "web/packages/client/tests/client/GenericInvocationHost.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AcceptedInvocation } from '../../src/client/generic/AcceptedInvocation';\nimport { Invocation } from '../../src/client/generic/Invocation';\nimport { createInvocationInfo } from './client-mocks';\nimport { GenericInvocationsHost } from '../../src/client/api/generic/GenericInvocationsHost';\nimport { when, mock, instance, anything, verify } from 'ts-mockito';\nimport { GenericClientImpl } from '../../src/client/generic/GenericClientImpl';\nimport { Observer } from '@plexus-interop/common';\nimport { clientProtocol as plexus, SuccessCompletion } from '@plexus-interop/protocol';\nimport { Subscription, AnonymousSubscription } from 'rxjs/Subscription';\nimport { ChannelObserver } from '@plexus-interop/transport-common';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\nimport { InvocationObserver, UnaryHandlerConverter } from '../../src/client';\nimport { ServerStreamingInvocationHandler } from '../../src/client/api/generic/handlers/streaming/ServerStreamingInvocationHandler';\nimport { ServerStreamingConverter } from '../../src/client/api/generic/handlers/streaming/converters';\nimport { StreamingInvocationClient } from '../../src/client/api/generic/handlers/streaming/StreamingInvocationClient';\nimport { InvocationHandlersRegistry } from '../../src/client/api/generic/handlers/InvocationHandlersRegistry';\nimport { ProtoMarshallerProvider } from '@plexus-interop/io/dist/main/src/static';\n\ndeclare var process: any;\n\nprocess.on('unhandledRejection', (reason: any, p: any) => {\n    // tslint:disable-next-line:no-console\n    console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);\n});\n\ndescribe('GenericInvocationHost', () => {\n\n    it('Can handle invocoming invocation and send response back', async (done) => {\n\n        const responsePayload = new Uint8Array([1, 2, 3]).buffer;\n        const requestPayload = new Uint8Array([3, 2, 1]).buffer;\n\n        setupSimpleHostedInvocation(requestPayload, async (completion: plexus.ICompletion) => {\n            done();\n            return new SuccessCompletion();\n        }, async (context: MethodInvocationContext, request: ArrayBuffer) => {\n            // tslint:disable-next-line:no-console\n            console.log('Doing important stuff ...');\n            return responsePayload;\n        }, (invocation) => {\n            verify(invocation.sendMessage(responsePayload)).called();\n        });\n\n    });\n\n    it('Closes invocation with error on if execution rejected', async (done) => {\n\n        const requestPayload = new Uint8Array([3, 2, 1]).buffer;\n\n        setupSimpleHostedInvocation(requestPayload, async (completion: plexus.ICompletion) => {\n            expect(completion).toBeDefined();\n            expect(completion.status).toEqual(plexus.Completion.Status.Failed);\n            expect(completion.error).toBeDefined();\n            done();\n            return new SuccessCompletion();\n        }, (context: MethodInvocationContext, request: ArrayBuffer) => Promise.reject('Execution error'));\n\n    });\n\n    it('Closes invocation with error on if execution failed', async (done) => {\n\n        const requestPayload = new Uint8Array([3, 2, 1]).buffer;\n\n        setupSimpleHostedInvocation(requestPayload, async (completion: plexus.ICompletion) => {\n            expect(completion).toBeDefined();\n            expect(completion.status).toEqual(plexus.Completion.Status.Failed);\n            expect(completion.error).toBeDefined();\n            done();\n            return new SuccessCompletion();\n        }, (context: MethodInvocationContext, request: ArrayBuffer) => { throw new Error('Execution error'); });\n\n    });\n\n    it('Can receive multiple messages, send multiple responses back and complete invocation', async (done) => {\n        const requestPayload = new Uint8Array([3, 2, 1]).buffer;\n        const responsePayload = new Uint8Array([1, 2, 3]).buffer;\n        setupHostedInvocation(requestPayload, async (completion: plexus.ICompletion) => {\n            done();\n            return new SuccessCompletion();\n        }, (context: MethodInvocationContext, client) => {\n            let count = 0;\n            return {\n                next: request => {\n                    expect(request).toBe(requestPayload);\n                    count++;\n                    client.next(responsePayload);\n                    if (count === 3) {\n                        client.complete();\n                    }\n                },\n                error: e => { },\n                complete: () => { },\n                streamCompleted: () => { }\n            };\n        }, (invocation) => {\n        }, 3);\n    });\n\n    it('Can send multiple responses back and complete invocation with Server Streaming handler', (done) => {\n\n        const requestPayload = new Uint8Array([3, 2, 1]).buffer;\n        const responsePayload = new Uint8Array([1, 2, 3]).buffer;\n\n        const streamingHandler: ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> = {\n            ...baseHandler(),\n            handle: (context: MethodInvocationContext, receivedRequest: ArrayBuffer, invocationHostClient: StreamingInvocationClient<ArrayBuffer>) => {\n                expect(receivedRequest).toBe(requestPayload);\n                invocationHostClient.next(responsePayload);\n                invocationHostClient.next(responsePayload);\n                invocationHostClient.complete();\n            }\n        };\n\n        setupServerStreamingHostedInvocation(\n\n            requestPayload,\n\n            (completion: plexus.ICompletion) => Promise.resolve(new SuccessCompletion()),\n\n            streamingHandler,\n\n            (invocation: Invocation) => {\n                verify(invocation.sendMessage(responsePayload)).twice();\n                verify(invocation.close(anything())).called();\n                done();\n            });\n    });\n\n});\n\nfunction setupSimpleHostedInvocation(\n    requestPayload: ArrayBuffer,\n    invocationCloseHandler: (x: plexus.ICompletion) => Promise<plexus.ICompletion>,\n    hostedAction: (context: MethodInvocationContext, request: ArrayBuffer) => Promise<ArrayBuffer>,\n    postHandler?: (invocation: Invocation) => void): void {\n\n    const streamingHandler = new UnaryHandlerConverter().convert({\n        ...baseHandler(),\n        handle: hostedAction\n    });\n\n    setupHostedInvocation(requestPayload, invocationCloseHandler, streamingHandler.handle, postHandler);\n}\n\nfunction setupServerStreamingHostedInvocation(\n    requestPayload: ArrayBuffer,\n    invocationCloseHandler: (x: plexus.ICompletion) => Promise<plexus.ICompletion>,\n    serverStreamingHandler: ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer>,\n    postHandler?: (invocation: Invocation) => void): void {\n\n    const streamingHandler = new ServerStreamingConverter().convert(serverStreamingHandler);\n\n    setupHostedInvocation(requestPayload, invocationCloseHandler, streamingHandler.handle, postHandler);\n}\n\nfunction setupHostedInvocation(\n    requestPayload: ArrayBuffer,\n    invocationCloseHandler: (x: plexus.ICompletion) => Promise<plexus.ICompletion>,\n    hostedAction: (context: MethodInvocationContext, invocationHostClient: StreamingInvocationClient<ArrayBuffer>) => InvocationObserver<ArrayBuffer>,\n    postHandler?: (invocation: Invocation) => void,\n    requestMessagesCount: number = 1): void {\n\n    const invocationInfo = createInvocationInfo();\n    const mockInvocation = mock(AcceptedInvocation);\n\n    when(mockInvocation.getMetaInfo()).thenReturn(invocationInfo);\n    when(mockInvocation.sendMessage(anything())).thenReturn(Promise.resolve());\n    when(mockInvocation.close(anything())).thenCall((completion: plexus.ICompletion) => {\n        if (postHandler) {\n            postHandler(mockInvocation);\n        }\n        invocationCloseHandler(completion);\n        return Promise.resolve(new SuccessCompletion());\n    });\n    when(mockInvocation.open(anything())).thenCall((observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>) => {\n        setTimeout(() => {\n            observer.started(new Subscription());\n            setTimeout(() => {\n                for (let i = 0; i < requestMessagesCount; i++) {\n                    observer.next(requestPayload);\n                }\n                observer.complete();\n            }, 0);\n        }, 0);\n    });\n\n    const mockInvocationInstance = instance(mockInvocation);\n\n    const mockGenericClient = mock(GenericClientImpl);\n    when(mockGenericClient.acceptInvocations(anything())).thenCall((observer: Observer<Invocation>) => {\n        setTimeout(() => {\n            observer.next(mockInvocationInstance);\n            observer.complete();\n        }, 0);\n        return Promise.resolve();\n    });\n    const mockGenericClientInstance = instance(mockGenericClient);\n    const registry = new InvocationHandlersRegistry(new ProtoMarshallerProvider());\n    registry.registerBidiStreamingGenericHandler({\n        ...baseHandler(),\n        handle: hostedAction\n    });\n\n    const invocationHost = new GenericInvocationsHost(mockGenericClientInstance, registry);\n\n    invocationHost.start();\n}\n\n// tslint:disable-next-line:typedef\nfunction baseHandler() {\n    const invocationInfo = createInvocationInfo();\n    return {\n        serviceInfo: {\n            serviceId: invocationInfo.serviceId as string,\n            serviceAlias: invocationInfo.serviceAlias\n        },\n        methodId: invocationInfo.methodId as string,\n        handle: () => { }\n    };\n}"
  },
  {
    "path": "web/packages/client/tests/client/Invocation.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GenericInvocation } from '../../src/client/generic/GenericInvocation';\nimport { InvocationState } from '../../src/client/generic/InvocationState';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\nimport { InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { ClientProtocolHelper as modelHelper } from '@plexus-interop/protocol';\nimport { randomPayload } from '../utils';\nimport { AsyncHelper } from '@plexus-interop/common';\nimport { CancellationToken } from '@plexus-interop/common';\nimport { createInvocationInfo } from './client-mocks';\nimport { BufferedChannel } from './client-mocks';\nimport { DelegateInvocationObserver } from '../../src/index';\nimport { LogInvocationObserver } from '../LogInvocationObserver';\nimport { BufferedInvocationObserver } from '../BufferedInvocationObserver';\nimport { InvocationObserver } from '../../src/client';\n\ndescribe('Invocation', () => {\n\n    let mockChannel: BufferedChannel;\n    let invocationInfo: InvocationMetaInfo;\n    let invocation: GenericInvocation;\n    let inMessagesObserver: BufferedInvocationObserver<ArrayBuffer>;\n\n    beforeEach(() => {\n        invocationInfo = createInvocationInfo();\n        const token = new CancellationToken();\n        mockChannel = new BufferedChannel(token);\n        invocation = new GenericInvocation(mockChannel, token);\n        inMessagesObserver = new BufferedInvocationObserver<ArrayBuffer>(token);\n    });\n\n    it('Should request invocation start and go to STARTED state only when confirmation received', async () => {\n\n        await prepareRequestedInvocation(new LogInvocationObserver());\n\n        expect(invocation.currentState()).toEqual(InvocationState.OPEN);\n\n        await closeInvocation();\n\n    });\n\n    it('Should accept incoming invocation request and send confirmation', async () => {\n\n        const invocationAccepted = new Promise((resolve, reject) => {\n            invocation.acceptInvocation(new DelegateInvocationObserver(new LogInvocationObserver(),\n                (s) => resolve(s),\n                (e) => reject(e)));\n        });\n\n        addToInbox(modelHelper.invocationRequestedPayload({\n            methodId: invocationInfo.methodId,\n            serviceId: invocationInfo.serviceId\n        }));\n\n        await invocationAccepted;\n\n        const message = modelHelper.decodeInvocationStarted(await pullData());\n\n        expect(message).toBeDefined();\n        await closeInvocation();\n\n    });\n\n    it('Should reject API calls if invocation is not started', (done) => {\n\n        invocation.sendMessage(new ArrayBuffer(0)).catch(() => done());\n\n    });\n\n    it('Should send message as header with length and body to channel', async () => {\n\n        await prepareRequestedInvocation(new LogInvocationObserver());\n\n        const data = randomPayload(10);\n        await invocation.sendMessage(data);\n\n        const message = await pullInvocationMessage();\n        const header = message.message as plexus.interop.protocol.IInvocationMessageHeader;\n\n        expect(header).toBeDefined();\n        expect(invocation.getSentMessagesCounter()).toEqual(1);\n\n        const content = await pullSentData();\n        expect(new Uint8Array(content)).toEqual(new Uint8Array(data));\n        await closeInvocation();\n\n    });\n\n    it('Should receive confirmations and decrease counter', async () => {\n\n        const invocationId = await prepareRequestedInvocation(new LogInvocationObserver());\n\n        await invocation.sendMessage(randomPayload());\n        await invocation.sendMessage(randomPayload());\n\n        addToInbox(modelHelper.messageReceivedPayload({\n            invocationId\n        }));\n        addToInbox(modelHelper.messageReceivedPayload({\n            invocationId\n        }));\n\n        await AsyncHelper.waitFor(() => mockChannel.isInboxEmpty());\n\n        expect(invocation.getSentMessagesCounter()).toEqual(0);\n\n        await closeInvocation();\n\n    });\n\n    it('Should receive message and send confirmation back', async () => {\n\n        await prepareRequestedInvocation(inMessagesObserver);\n\n        const data = randomPayload();\n        addToInbox(modelHelper.messageHeaderPayload({\n            length: data.byteLength\n        }));\n\n        addToInbox(data);\n\n        const received = await inMessagesObserver.pullData();\n\n        expect(new Uint8Array(received)).toEqual(new Uint8Array(data));\n\n        const confirmation = await pullInvocationMessage();\n\n        const header = confirmation.confirmation as plexus.interop.protocol.InvocationMessageReceived;\n\n        expect(header).toBeDefined();\n\n        await closeInvocation();\n\n    });\n\n    it('Should send \\'Send completion\\' message before closing channel', async () => {\n\n        await prepareRequestedInvocation(new LogInvocationObserver());\n\n        expect(invocation.currentState()).toEqual(InvocationState.OPEN);\n\n        await closeInvocation();\n\n        const message = await pullInvocationMessage();\n        expect(message.sendCompletion).toBeDefined();\n\n    });\n\n    async function pullInvocationMessage(): Promise<plexus.interop.protocol.IInvocationMessageEnvelope> {\n        const message = await mockChannel.out.blockingDequeue();\n        return modelHelper.decodeInvocationEnvelop(message);\n    }\n\n    async function pullStartRequest(): Promise<plexus.interop.protocol.IInvocationStartRequest> {\n        const message = await mockChannel.out.blockingDequeue();\n        return modelHelper.decodeInvocationStartRequest(message);\n    }\n\n    async function pullData(): Promise<ArrayBuffer> {\n        return mockChannel.out.blockingDequeue();\n    }\n\n    function pullSentData(): Promise<ArrayBuffer> {\n        return mockChannel.out.blockingDequeue();\n    }\n\n    function addToInbox(data: ArrayBuffer): void {\n        mockChannel.addToInbox(data);\n    }\n\n    async function closeInvocation(): Promise<void> {\n        // tslint:disable-next-line:no-console\n        console.log('Cancelling invocation');\n        const closePromise = invocation.close();\n        addToInbox(modelHelper.sendCompletionPayload({}));\n        await closePromise;\n    }\n\n    async function prepareRequestedInvocation(observer: InvocationObserver<ArrayBuffer> = new LogInvocationObserver<ArrayBuffer>()): Promise<UniqueId> {\n\n        const startedPromise = new Promise((resolve, reject) => {\n            invocation.start(invocationInfo,\n                new DelegateInvocationObserver(observer,\n                    (s) => resolve(s),\n                    (e) => reject(e)));\n        });\n\n        const startRequestedMessage = await pullStartRequest();\n\n        expect(startRequestedMessage).toBeDefined();\n\n        if (startRequestedMessage.consumedMethod && startRequestedMessage.consumedMethod.consumedService) {\n            expect(startRequestedMessage.consumedMethod.methodId).toEqual(invocationInfo.methodId);\n            expect(startRequestedMessage.consumedMethod.consumedService.serviceId).toEqual(invocationInfo.serviceId);\n            expect(startRequestedMessage.consumedMethod.consumedService.serviceId).toEqual(invocationInfo.serviceId);\n            expect(startRequestedMessage.consumedMethod.consumedService.serviceAlias).toEqual(invocationInfo.serviceAlias);\n        }\n        \n        addToInbox(modelHelper.invocationStartingMessagePayload({}));\n        addToInbox(modelHelper.invocationStartedMessagePayload({}));\n        \n        return startedPromise.then<UniqueId>(() => UniqueId.generateNew());\n    }\n\n});\n"
  },
  {
    "path": "web/packages/client/tests/client/WsConnectionDetails.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getBaseWsUrl } from '../../src/client/api/container/WsConnectionDetails';\n\ndescribe('WsConnectionDetails', () => {\n    it('getBaseWsUrl returns correct result', () => {\n        const url = getBaseWsUrl({ port: 42, wssPort: 24 });\n        expect(url).toBe(\"wss://127.0.0.1:24\");\n    });\n\n    it('getBaseWsUrl if wssPort not defined', () => {\n        const url = getBaseWsUrl({ port: 42 });\n        expect(url).toBe(\"ws://127.0.0.1:42\");\n    });\n\n    it('getBaseWsUrl if wssPort zero', () => {\n        const url = getBaseWsUrl({ port: 42, wssPort: 0 });\n        expect(url).toBe(\"ws://127.0.0.1:42\");\n    });\n});\n"
  },
  {
    "path": "web/packages/client/tests/client/client-mocks.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InvocationMetaInfo } from '@plexus-interop/protocol';\nimport { UniqueId, TransportChannel, ChannelObserver } from '@plexus-interop/transport-common';\nimport { RemoteInvocationInfo } from '@plexus-interop/client-api';\nimport { BinaryMarshallerProvider, BinaryMarshaller } from '@plexus-interop/io';\nimport { Observer } from '@plexus-interop/common';\nimport { Subscription, AnonymousSubscription } from 'rxjs/Subscription';\nimport { clientProtocol as plexus, SuccessCompletion } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory, BlockingQueue, BlockingQueueBase, CancellationToken } from '@plexus-interop/common';\n\nexport function createInvocationInfo(): InvocationMetaInfo {\n    return {\n        methodId: '1',\n        serviceId: '2',\n        connectionId: UniqueId.generateNew(),\n        applicationId: '3',\n        serviceAlias: 'serviceAlias'\n    };\n}\n\nexport function createRemoteInvocationInfo(): RemoteInvocationInfo {\n    return {\n        methodId: 'actionId',\n        serviceId: 'serviceId',\n        applicationId: 'applicationId',\n        connectionId: UniqueId.generateNew()\n    };\n}\n\nexport class MockMarshaller implements BinaryMarshaller {\n\n    public encode(messageObj: any): Uint8Array {\n        return new Uint8Array([]);\n    }\n\n    public decode(messagePayload: Uint8Array): any {\n        return {};\n    }\n}\n\nexport class MockMarshallerProvider implements BinaryMarshallerProvider {\n\n    public getMarshaller(type: any): BinaryMarshaller {\n        return new MockMarshaller();\n    }\n\n}\n\nexport class BufferedChannel implements TransportChannel {\n\n    private log: Logger = LoggerFactory.getLogger('Test Channel');\n\n    public readonly in: BlockingQueue<ArrayBuffer> = new BlockingQueueBase<ArrayBuffer>();\n    public readonly out: BlockingQueue<ArrayBuffer> = new BlockingQueueBase<ArrayBuffer>();\n    public readonly id: UniqueId = UniqueId.generateNew();\n\n    constructor(private cancellationToken: CancellationToken) {\n        this.log.info('Created');\n    }\n\n    public open(observer: ChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        const subscription = new Subscription(() => this.cancellationToken.cancel('unsubscribed'));\n        this.listenToMessages(observer);\n        observer.started(subscription);\n    }\n\n    public addToInbox(data: ArrayBuffer): Promise<void> {\n        this.log.debug(`Adding ${data.byteLength} bytes to inbox`);\n        return this.in.enqueue(data);\n    }\n\n    public pullOutMessage(): Promise<ArrayBuffer> {\n        return this.out.blockingDequeue(this.cancellationToken);\n    }\n\n    public isInboxEmpty(): boolean {\n        return this.in.size() === 0;\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.log.debug(`Sending ${data.byteLength} bytes`);\n        this.out.enqueue(data);\n    }\n\n    public async sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion> {\n        await this.sendMessage(data);\n        return this.close();\n    }\n\n    public cancel(): void {\n        this.cancellationToken.cancel('Closed');\n    }\n\n    public async close(): Promise<SuccessCompletion> {\n        this.log.info('Close requested');\n        return new SuccessCompletion();\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n    private async listenToMessages(observer: Observer<ArrayBuffer>): Promise<void> {\n        try {\n            while (!this.cancellationToken.isCancelled()) {\n                const message = await this.in.blockingDequeue(this.cancellationToken);\n                // tslint:disable-next-line:no-console\n                console.log(`Got in message from buffer ${message.byteLength} bytes`);\n                observer.next(message);\n            }\n            observer.complete();\n        } catch (error) {\n            // tslint:disable-next-line:no-console\n            console.error('Error on reading message', error);\n            observer.error(error);\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/client/tests/utils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function randomPayload(length?: number): ArrayBuffer {\n    length = length || 10;\n    const array = new Array(length).fill('').map(_ => randomInt(1, 10));\n    return new Uint8Array(array).buffer;\n}\n\nexport function randomInt(min: number, max: number): number {\n    min = Math.ceil(min);\n    max = Math.floor(max);\n    return Math.floor(Math.random() * (max - min)) + min;\n}"
  },
  {
    "path": "web/packages/client/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noUnusedLocals\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/client/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/client-api/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/client-api\",\n  \"version\": \"0.1.0\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"Client contracts, shared between client and broker\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\"\n  },\n  \"dependencies\": {\n    \"@types/loglevel\": \"^1.4.29\",\n    \"@types/long\": \"^4.0.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"loglevel\": \"^1.4.1\",\n    \"long\": \"^4.0.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"devDependencies\": {\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/client-api/src/MethodInvocationContext.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReadOnlyCancellationToken, CancellationToken } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport class MethodInvocationContext {\n    constructor(\n        public readonly consumerApplicationId: string,\n        public readonly consumerConnectionId: UniqueId = UniqueId.generateNew(),\n        public readonly cancellationToken: ReadOnlyCancellationToken = new CancellationToken()\n    ) { }\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ActionReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ActionReference {\n\n    serviceId: string;\n\n    serviceAlias?: string;\n\n    methodId: string;\n\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/BasicInvocationInfo.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ServiceInfo } from './ServiceInfo';\n\nexport interface BasicInvocationInfo extends ServiceInfo {\n\n    methodId: string;\n\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ClientConnectRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport interface ClientConnectRequest {\n\n    applicationId: string;\n\n    applicationInstanceId?: UniqueId;\n\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/Completion.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol } from '@plexus-interop/protocol';\n\nexport abstract class Completion implements clientProtocol.ICompletion {} "
  },
  {
    "path": "web/packages/client-api/src/dto/ConsumedService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ConsumedService {\n\n    serviceId?: string;\n\n    serviceAlias?: string;\n\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/DiscoveredMethod.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedMethodReference } from './ProvidedMethodReference';\nimport { MethodType } from './MethodType';\nimport { Option } from './Option';\n\nexport interface DiscoveredMethod {\n\n    providedMethod?: ProvidedMethodReference;\n\n    methodTitle?: string;\n\n    inputMessageId?: string;\n\n    outputMessageId?: string;\n\n    methodType?: MethodType;\n\n    options?: Option[];\n    \n}"
  },
  {
    "path": "web/packages/client-api/src/dto/DiscoveredService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConsumedService } from './ConsumedService';\nimport { ProvidedServiceReference } from './ProvidedServiceReference';\nimport { DiscoveredServiceMethod } from './DiscoveredServiceMethod';\n\nexport interface DiscoveredService {\n\n    consumedService?: ConsumedService;\n\n    providedService?: ProvidedServiceReference;\n\n    serviceTitle?: string;\n\n    methods?: DiscoveredServiceMethod[];\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/DiscoveredServiceMethod.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodType } from './MethodType';\nimport { Option } from './Option';\n\nexport interface DiscoveredServiceMethod {\n    /** DiscoveredServiceMethod methodId */\n    methodId?: string;\n\n    /** DiscoveredServiceMethod methodTitle */\n    methodTitle?: string;\n\n    /** DiscoveredServiceMethod inputMessageId */\n    inputMessageId?: string;\n\n    /** DiscoveredServiceMethod outputMessageId */\n    outputMessageId?: string;\n\n    /** DiscoveredServiceMethod methodType */\n    methodType?: MethodType;\n\n    /** DiscoveredServiceMethod options */\n    options?: Option[];\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/DiscoveryMode.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum DiscoveryMode {\n    Offline = 0,\n    Online = 1\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/GenericRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedMethodReference } from './ProvidedMethodReference';\nimport { InvocationRequestInfo } from '@plexus-interop/protocol';\n\nexport type GenericRequest = ProvidedMethodReference | InvocationRequestInfo;"
  },
  {
    "path": "web/packages/client-api/src/dto/HostInvocationInfo.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BasicInvocationInfo } from './BasicInvocationInfo';\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport interface HostInvocationInfo extends BasicInvocationInfo {\n    \n    sourceApplicationId?: string;\n\n    sourceConnectionId?: UniqueId;\n    \n}"
  },
  {
    "path": "web/packages/client-api/src/dto/MethodDiscoveryRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface MethodDiscoveryRequest extends plexus.interop.protocol.IMethodDiscoveryRequest { }"
  },
  {
    "path": "web/packages/client-api/src/dto/MethodDiscoveryResponse.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DiscoveredMethod } from './DiscoveredMethod';\n\nexport interface MethodDiscoveryResponse {\n    \n    methods?: DiscoveredMethod[];\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/MethodType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum MethodType {\n    Unary = 0,\n    ServerStreaming = 1,\n    ClientStreaming = 2,\n    DuplexStreaming = 3\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/Option.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Option {\n    id: string;\n    value: string;\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ProvidedMethodReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedServiceReference } from '.';\n\nexport interface ProvidedMethodReference {\n    providedService?: ProvidedServiceReference;\n    methodId?: string;\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ProvidedServiceReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport interface ProvidedServiceReference {\n    /** ProvidedServiceReference serviceId */\n    serviceId?: string;\n\n    /** ProvidedServiceReference serviceAlias */\n    serviceAlias?: string;\n\n    /** ProvidedServiceReference applicationId */\n    applicationId?: string;\n\n    /** ProvidedServiceReference connectionId */\n    connectionId?: UniqueId;\n\n    /** ProvidedServiceReference appInstanceId */\n    applicationInstanceId?: UniqueId;\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/RemoteInvocationInfo.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BasicInvocationInfo } from './BasicInvocationInfo';\nimport { UniqueId } from '@plexus-interop/transport-common';\n\nexport interface RemoteInvocationInfo extends BasicInvocationInfo {\n    \n    applicationId?: string;\n\n    connectionId?: UniqueId;\n\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ServiceDiscoveryRequest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface ServiceDiscoveryRequest extends plexus.interop.protocol.IServiceDiscoveryRequest {}"
  },
  {
    "path": "web/packages/client-api/src/dto/ServiceDiscoveryResponse.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DiscoveredService } from './DiscoveredService';\n\nexport interface ServiceDiscoveryResponse {\n    services?: DiscoveredService[];\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/ServiceInfo.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ServiceInfo {\n    serviceId: string;\n    serviceAlias?: string;\n}"
  },
  {
    "path": "web/packages/client-api/src/dto/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './ClientConnectRequest';\nexport * from './ServiceDiscoveryRequest';\nexport * from './ServiceDiscoveryResponse';\nexport * from './ServiceInfo';\nexport * from './RemoteInvocationInfo';\nexport * from './HostInvocationInfo';\nexport * from './ClientConnectRequest';\nexport * from './Completion';\nexport * from './MethodDiscoveryRequest';\nexport * from './MethodDiscoveryResponse';\nexport * from './ProvidedMethodReference';\nexport * from './DiscoveredMethod';\nexport * from './DiscoveredServiceMethod';\nexport * from './ConsumedService';\nexport * from './ProvidedServiceReference';\nexport * from './DiscoveredService';\nexport * from './MethodType';\nexport * from './DiscoveryMode';\nexport * from './GenericRequest';\nexport * from './ActionReference';\nexport * from './Option';\n"
  },
  {
    "path": "web/packages/client-api/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './dto';\nexport * from './MethodInvocationContext';"
  },
  {
    "path": "web/packages/client-api/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noUnusedLocals\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/client-api/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/common/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/common\",\n  \"version\": \"0.1.0\",\n  \"sideEffects\": true,\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"Common functionality for Plexus Interop Web\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"test\": \"yarn unit\"\n  },\n  \"dependencies\": {\n    \"@types/loglevel\": \"^1.4.29\",\n    \"@types/long\": \"^4.0.0\",\n    \"loglevel\": \"^1.4.1\",\n    \"loglevel-plugin-prefix\": \"^0.5.3\",\n    \"long\": \"^4.0.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\",\n    \"typescript-collections\": \"1.2.3\"\n  },\n  \"devDependencies\": {\n    \"trash\": \"^4.1.0\",\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"babel-register\": \"^6.23.0\",\n    \"browserify\": \"^14.5.0\",\n    \"chai\": \"^4.1.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"glob\": \"^7.1.2\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"jest-cli\": \"^23.0.0\",\n    \"karma\": \"^1.7.1\",\n    \"minimist\": \"^1.2.0\",\n    \"mocha\": \"^3.5.0\",\n    \"path\": \"^0.12.7\",\n    \"sinon\": \"^2.4.1\",\n    \"trash-cli\": \"^1.4.0\",\n    \"ts-mockito\": \"2.0.2\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/common/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/common/src/PlexusFeatures.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface PlexusFeatures {\n    readonly decodeUndefinedToDefault: boolean;\n}\n\nconst plexusFeatures = {\n    decodeUndefinedToDefault: true\n};\n\nexport function setDecodeUndefinedToDefault(value: boolean): void {\n    plexusFeatures.decodeUndefinedToDefault = value;\n}\n\nexport function getPlexusFeatures(): PlexusFeatures {\n    return plexusFeatures;\n}\n"
  },
  {
    "path": "web/packages/common/src/RetryConfig.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface RetryConfig {\n    retriesNum: number;\n    retryTimeoutInMillis: number;\n    errorHandler?: (e: any) => void;\n}"
  },
  {
    "path": "web/packages/common/src/cache/Cache.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CacheEntry } from './CacheEntry';\n\nexport interface Cache {\n\n    /*\n    * Sets new entry for specific key, if entry already exists - then it will be evicted with calling appropriate dispose method\n    */\n    set<T>(key: string, entry: CacheEntry<T>): Promise<void>;\n\n    /**\n     * Gets current entry\n     */\n    get<T>(key: string): T | undefined;\n\n    /**\n     * Resets ttl for corresponding entry\n     */\n    resetTtl(key: string): boolean;\n\n    /*\n    * Gets all not expired keys\n    */\n    keys(): string[];\n\n    /**\n     * Checks if element exists in cache\n     */\n    has(key: string): boolean;\n\n}"
  },
  {
    "path": "web/packages/common/src/cache/CacheEntry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CacheEntry<T> {\n    constructor(\n        public readonly value: T,\n        public readonly ttl: number = -1,\n        public readonly onEvict: (value: T) => void = () => {}\n    ) {}\n}"
  },
  {
    "path": "web/packages/common/src/cache/CacheEntryDescriptor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CacheEntry } from './CacheEntry';\n\nexport class CacheEntryDescriptor<T> {\n    constructor(\n        public readonly entry: CacheEntry<T>,\n        public readonly expirationTime: number,\n        public cleanUpTimeOutId: number\n    ) {}\n}"
  },
  {
    "path": "web/packages/common/src/cache/InMemoryCache.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Cache } from './Cache';\nimport { CacheEntry } from './CacheEntry';\nimport { CacheEntryDescriptor } from './CacheEntryDescriptor';\nimport { Logger, LoggerFactory } from '../logger';\n\nlet globalObj: any = typeof window !== 'undefined' ? window : global;\n\nexport class InMemoryCache implements Cache {\n\n    private readonly log: Logger = LoggerFactory.getLogger('InMemoryCache');\n\n    private storage: Map<string, CacheEntryDescriptor<any>> = new Map();\n\n    public async set<T>(key: string, entry: CacheEntry<T>): Promise<void> {\n        const existing = this.storage.get(key);\n        if (existing) {\n            this.log.trace(`${key} already exist, cleaning up and calling dispose`);\n            clearTimeout(existing.cleanUpTimeOutId);\n            existing.entry.onEvict(existing.entry.value);\n        }\n        let cleanUpTimeout = -1;\n        if (entry.ttl > 0) {\n            cleanUpTimeout = globalObj.setTimeout(() => this.cleanEntry(key), entry.ttl);\n        }\n        this.storage.set(key, new CacheEntryDescriptor(\n            entry,\n            entry.ttl > 0 ? Date.now() + entry.ttl : -1,\n            cleanUpTimeout\n        ));\n    }\n\n    public resetTtl(key: string): boolean {\n        const descriptor = this.storage.get(key);\n        if (descriptor && descriptor.entry.ttl > 0) {\n            clearTimeout(descriptor.cleanUpTimeOutId);\n            descriptor.cleanUpTimeOutId =\n                globalObj.setTimeout(() => this.cleanEntry(key), descriptor.entry.ttl);\n        }\n        return false;\n    }\n\n    public has(key: string): boolean {\n        return this.storage.has(key);\n    }\n\n    public keys(): string[] {\n        const result: string[] = [];\n        this.storage.forEach((v, k) => result.push(k));\n        return result;\n    }\n\n    public get<T>(key: string): T | undefined {\n        const descriptor = this.storage.get(key);\n        if (descriptor) {\n            return descriptor.entry.value;\n        } else {\n            return undefined;\n        }\n    }\n\n    private cleanEntry(key: string): void {\n        const descriptor = this.storage.get(key);\n        if (descriptor) {\n            this.log.trace(`[${descriptor.entry.ttl}] passed for [${key}] element, cleaning up`);\n            descriptor.entry.onEvict(descriptor.entry.value);\n            this.storage.delete(key);\n        }\n    }\n\n} "
  },
  {
    "path": "web/packages/common/src/cache/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Cache';\nexport * from './CacheEntry';\nexport * from './InMemoryCache';"
  },
  {
    "path": "web/packages/common/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './util';\nexport * from './logger';\nexport * from './rx';\nexport * from './cache';\nexport * from './PlexusFeatures';\nexport * from './RetryConfig';"
  },
  {
    "path": "web/packages/common/src/logger/DelegatingLogger.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LogLevel } from './LoggerFactory';\nimport { Logger } from './Logger';\n\nexport class DelegatingLogger implements Logger {\n\n    constructor(\n        private mainLogger: Logger,\n        private additionalRecipients: Logger[]\n    ) { }\n\n    public debug(msg: string, ...args: any[]): void {\n        this.recipients.forEach(logger => logger.debug(msg, args));\n    }\n\n    public info(msg: string, ...args: any[]): void {\n        this.recipients.forEach(logger => logger.debug(msg, args));\n    }\n\n    public error(msg: string, ...args: any[]): void {\n        this.recipients.forEach(logger => logger.error(msg, args));\n    }\n\n    public warn(msg: string, ...args: any[]): void {\n        this.recipients.forEach(logger => logger.warn(msg, args));\n    }\n\n    public trace(msg: string, ...args: any[]): void {\n        this.recipients.forEach(logger => logger.trace(msg, args));\n    }\n\n    public getLogLevel(): LogLevel {\n        return this.mainLogger.getLogLevel();\n    }\n\n    public isDebugEnabled(): boolean {\n        return this.mainLogger.isDebugEnabled();\n    }\n\n    public isTraceEnabled(): boolean {\n        return this.mainLogger.isTraceEnabled();\n    }\n\n    private get recipients(): Logger[] {\n        return [this.mainLogger, ...this.additionalRecipients];\n    }\n}"
  },
  {
    "path": "web/packages/common/src/logger/Logger.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LogLevel } from './LoggerFactory';\n\nexport interface Logger {\n\n    debug(msg: string, ...args: any[]): void;\n\n    info(msg: string, ...args: any[]): void;\n\n    error(msg: string, ...args: any[]): void;\n\n    warn(msg: string, ...args: any[]): void;\n\n    trace(msg: string, ...args: any[]): void;\n\n    getLogLevel(): LogLevel;\n\n    isDebugEnabled(): boolean;\n\n    isTraceEnabled(): boolean;\n}\n\nexport interface LoggerDelegate {\n    log(logLevel: LogLevel, msg: string, ...args: any[]): void;\n}"
  },
  {
    "path": "web/packages/common/src/logger/LoggerBase.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as log from 'loglevel';\nimport { Logger, LoggerDelegate } from './Logger';\nimport { LogLevel } from './LoggerFactory';\n\nexport class LoggerBase implements Logger, LoggerDelegate {\n\n    constructor(\n        public name: string,\n        private loggerDelegates: LoggerDelegate[]\n    ) { }\n\n    public debug(msg: string, ...args: any[]): void {\n        /* istanbul ignore if */\n        if (log.getLevel() <= LogLevel.DEBUG) {\n            this.log(LogLevel.DEBUG, msg, args);\n        }\n    }\n\n    public info(msg: string, ...args: any[]): void {\n        this.log(LogLevel.INFO, msg, args);\n    }\n\n    public error(msg: string, ...args: any[]): void {\n        this.log(LogLevel.ERROR, msg, args);\n    }\n\n    public warn(msg: string, ...args: any[]): void {\n        this.log(LogLevel.INFO, msg, args);\n    }\n\n    public trace(msg: string, ...args: any[]): void {\n        /* istanbul ignore if */\n        if (log.getLevel() <= LogLevel.TRACE) {\n            this.log(LogLevel.TRACE, msg, args);\n        }\n    }\n\n    public log(logLevel: LogLevel, msg: string, args: any[]): void {\n\n        let actualMessage = `${this.name} ${msg}`;\n\n        switch (logLevel) {\n            case LogLevel.TRACE: \n                log.trace(actualMessage, args); \n                break;\n            case LogLevel.DEBUG: \n                log.debug(actualMessage, args); \n                break;\n            case LogLevel.INFO: \n                log.info(actualMessage, args); \n                break;\n            case LogLevel.WARN: \n                log.warn(actualMessage, args); \n                break;\n            case LogLevel.ERROR: \n                log.warn(actualMessage, args); \n                break;\n            case LogLevel.SILENT: \n                /* be silent */\n                break;\n            default: \n                throw `Unkown LogLevel: ${logLevel}`;\n        }\n        try {\n            this.loggerDelegates.forEach(logger => logger.log(logLevel, msg, args));\n        }\n        catch (error) {\n            this.error(`Error in log delegates: ${error}. Swallowed.`);\n        }\n        \n    }\n\n    public getLogLevel(): LogLevel {\n        return log.getLevel();\n    }\n\n    public isDebugEnabled(): boolean {\n        return this.getLogLevel() <= LogLevel.DEBUG;\n    }\n\n    public isTraceEnabled(): boolean {\n        return this.getLogLevel() <= LogLevel.TRACE;\n    }\n}\n"
  },
  {
    "path": "web/packages/common/src/logger/LoggerFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerDelegate } from './index';\nimport * as log from 'loglevel';\nimport { Logger } from './Logger';\nimport { LoggerBase } from './LoggerBase';\nimport { TimeUtils } from '../util/time/TimeUtils';\nconst logPrefixer: any = require('loglevel-plugin-prefix');\n\nexport enum LogLevel {\n  TRACE,\n  DEBUG,\n  INFO,\n  WARN,\n  ERROR,\n  SILENT\n}\n\nexport class LoggerFactory {\n  \n  private static additionalRecipients: LoggerDelegate[] = [];\n\n  public static registerDelegate(logger: LoggerDelegate): { unregister: () => void } {\n    let newRecipientsLen = LoggerFactory.additionalRecipients.push(logger);\n    let registeredRecipientIndex = newRecipientsLen - 1;\n\n    return {\n      unregister: () => LoggerFactory.additionalRecipients = LoggerFactory.additionalRecipients.splice(registeredRecipientIndex, 1)\n    };\n  }\n\n  public static getLogger(name: string = 'Anonymous'): Logger {\n    return new LoggerBase(name, this.additionalRecipients);\n  }\n\n  public static setLogLevel(level: LogLevel): void {\n    /* istanbul ignore if */\n    if (level <= LogLevel.DEBUG) {\n      logPrefixer.apply(log, {\n        template: '%t | [%l] ',\n        timestampFormatter: (date: Date) => TimeUtils.format(date)\n      });\n    }\n    log.setLevel(level as any);\n  }\n\n}\n\nLoggerFactory.setLogLevel(LogLevel.INFO);\n"
  },
  {
    "path": "web/packages/common/src/logger/PrefixedLogger.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LogLevel } from '.';\n\nexport class PrefixedLogger implements Logger {\n\n    public constructor(private readonly base: Logger, private readonly prefix: string = '') { }\n\n    public trace(msg: string, ...args: any[]): void {\n        this.base.trace(`${this.prefix} ${msg}`, args);\n    }\n\n    public warn(msg: string, ...args: any[]): void {\n        this.base.trace(`${this.prefix} ${msg}`, args);\n    }\n\n    public error(msg: string, ...args: any[]): void {\n        this.base.error(`${this.prefix} ${msg}`, args);\n    }\n\n    public info(msg: string, ...args: any[]): void {\n        this.base.info(`${this.prefix} ${msg}`, args);\n    }\n\n    public debug(msg: string, ...args: any[]): void {\n        this.base.debug(`${this.prefix} ${msg}`, args);\n    }\n\n    public getLogLevel(): LogLevel {\n        return this.base.getLogLevel();\n    }\n\n    public isDebugEnabled(): boolean {\n        return this.base.getLogLevel() <= LogLevel.DEBUG;\n    }\n\n    public isTraceEnabled(): boolean {\n        return this.base.getLogLevel() <= LogLevel.TRACE;\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/logger/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Logger';\nexport * from './LoggerFactory';\nexport * from './PrefixedLogger';"
  },
  {
    "path": "web/packages/common/src/rx/AnonymousSubscription.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Subscription } from './Subscription';\n\nexport class AnonymousSubscription implements Subscription {\n    constructor(public readonly unsubscribe: () => void = () => { }) { }\n}"
  },
  {
    "path": "web/packages/common/src/rx/BufferedObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from './Observer';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { Logger, LoggerFactory } from '../logger';\nimport { LimitedBufferQueue } from '../util/collections/LimitedBufferQueue';\n\n/**\n * Saves interraction with Observer, until real Observer arrives\n */\nexport class BufferedObserver<T> implements Observer<T> {\n    \n    private baseObserver: Observer<T> | undefined;\n\n    private buffer: Queue<T>;\n    private receivedError: any;\n    private completed: boolean = false;\n\n    constructor(readonly limit: number = 1024 * 10, private readonly log: Logger = LoggerFactory.getLogger('BufferedObserver')) {\n        this.buffer = new LimitedBufferQueue<T>(limit);\n    }\n\n    public setObserver(observer: Observer<T>): void {\n        if (this.baseObserver) {\n            throw new Error('Base observer already defined');\n        }\n        this.baseObserver = observer;\n        while (!this.buffer.isEmpty()) {\n            observer.next(this.buffer.dequeue());\n        }\n        if (this.receivedError) {\n            observer.error(this.receivedError);\n        } else if (this.completed) {\n            observer.complete();\n        }\n    }\n\n    public next(value: T): void {\n        if (this.baseObserver) {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Passing frame to observer`);\n            }\n            this.baseObserver.next(value);\n        } else {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`No observer, adding to buffer, buffer size ${this.buffer.size()}`);\n            }\n            this.buffer.enqueue(value);\n        }\n    }\n\n    public error(err: any): void {\n        if (this.baseObserver) {\n            this.baseObserver.error(err);\n        } else {\n            this.receivedError = err;\n        }\n    } \n\n    public complete(): void {\n        if (this.baseObserver) {\n            this.baseObserver.complete();\n        } else {\n            this.completed = true;\n        }\n    }\n\n    public clear(): void {\n        this.buffer.clear();\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/rx/ConversionObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from './Observer';\n\nexport class ConversionObserver<S, D> implements Observer<D> {\n\n    constructor(\n        protected readonly source: Observer<S>, \n        protected readonly converter: (from: D) => S) {}\n\n    public next(value: D): void {\n        const after: S = this.converter(value);\n        this.source.next(after);\n    }\n\n    public error(err: any): void {\n        this.source.error(err);\n    } \n\n    public complete(): void {\n        this.source.complete();\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/rx/Observer.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Observer<T> {\n    next: (value: T) => void;\n    error: (err: any) => void;\n    complete: () => void;\n}"
  },
  {
    "path": "web/packages/common/src/rx/Subscription.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Subscription {\n    unsubscribe(): void;\n}"
  },
  {
    "path": "web/packages/common/src/rx/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './ConversionObserver';\nexport * from './Observer';\nexport * from './Subscription';\nexport * from './AnonymousSubscription';"
  },
  {
    "path": "web/packages/common/src/util/Arrays.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ExtendedMap } from './collections/ExtendedMap';\n\nexport class Arrays {\n\n    public static concatenateBuffers(...buffers: ArrayBuffer[]): ArrayBuffer {\n        const totalLength = buffers.reduce((acc, b) => acc + b.byteLength, 0);\n        const result = new Uint8Array(totalLength);\n        let offset = 0;\n        buffers.forEach(b => {\n            result.set(new Uint8Array(b), offset);\n            offset += b.byteLength;\n        });\n        return result.buffer;\n    }\n\n    public static toArrayBuffer(typedArray: Uint8Array): ArrayBuffer {\n        return new Uint8Array(typedArray).buffer;\n    }\n\n}\n\nexport function arrayBufferToString(buf: ArrayBuffer): string {\n    let binaryString = '';\n    let bytes = new Uint8Array(buf);\n    const length = bytes.length;\n    for (let i = 0; i < length; i++) {\n        binaryString += String.fromCharCode(bytes[i]);\n    }\n    return binaryString;\n}\n\nexport function stringToArrayBuffer(str: string): ArrayBuffer {\n    const buf = new ArrayBuffer(str.length);\n    const bufView = new Uint8Array(buf);\n    for (let i = 0, strLen = str.length; i < strLen; i++) {\n        bufView[i] = str.charCodeAt(i);\n    }\n    return buf;\n}\n\nexport function concat<T>(x: T[], y: T[]): T[] {\n    return x.concat(y);\n}\n\nexport function flatMap<T, R>(f: (el: T) => R[], array: T[]): R[] {\n    return array.map(f).reduce<R[]>(concat, []);\n}\n\nexport function join<T, R, Y>(first: T[], second: R[], joinFn: (x: T, y: R) => Y, predicate: (x: T, y: R) => boolean = () => true): Y[] {\n    const result: Y[] = [];\n    first.forEach(x => second.forEach(y => {\n        if (predicate(x, y)) {\n            result.push(joinFn(x, y));\n        }\n    }));\n    return result;\n}\n\nexport function distinct<T>(array: T[], key: (x: T) => any): T[] {\n    const seen = new Set();\n    return array.filter(item => {\n        const k = key(item);\n        return seen.has(k) ? false : seen.add(k);\n    });\n}\n\nexport function toMap<T, K, V>(array: T[], keyFn: (v: T) => K, vFn: (v: T) => V): ExtendedMap<K, V> {\n    const result = ExtendedMap.create<K, V>();\n    array.forEach(v => result.set(keyFn(v), vFn(v)));\n    return result;\n}"
  },
  {
    "path": "web/packages/common/src/util/ExtendedArray.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { join, distinct, toMap, concat } from './Arrays';\nimport { ExtendedMap } from './collections/ExtendedMap';\n\n/**\n * Provides few additional utility methods for array modification, immutable, all operations create new instance\n */\nexport class ExtendedArray<T> {\n\n    constructor(private readonly values: T[]) {}\n\n    public static of<T>(values: T[]): ExtendedArray<T> {\n        return new ExtendedArray<T>(values);\n    }\n\n    public joinWith<R, Y>(second: R[], joinFn: (x: T, y: R) => Y, predicate: (x: T, y: R) => boolean = () => true): ExtendedArray<Y> {\n        return ExtendedArray.of<Y>(join(this.values, second, joinFn, predicate));\n    }\n\n    public distinct(key: (x: T) => any = x => x ): ExtendedArray<T> {\n        return ExtendedArray.of(distinct(this.values, key));\n    }\n\n    public toArray(): T[] {\n        return this.values;\n    }\n\n    public flatMap<R>(f: (el: T) => R[]): ExtendedArray<R> {\n        return ExtendedArray.of(this.values.map(f).reduce<R[]>(concat, []));\n    }\n\n    public toMap<K, V>(keyFn: (v: T) => K, vFn: (v: T) => V): ExtendedMap<K, V> {\n        return toMap(this.values, keyFn, vFn);\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/GUID.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class GUID {\n\n    private str: string;\n\n    constructor(str?: string) {\n        this.str = str || GUID.getNewGUIDString();\n    }\n\n    public static getNewGUIDString(): string {\n        let d = new Date().getTime();\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n            let r = (d + Math.random() * 16) % 16 | 0;\n            d = Math.floor(d / 16);\n            return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n        });\n    }\n\n    public toString(): string {\n        return this.str;\n    }\n}"
  },
  {
    "path": "web/packages/common/src/util/async/AsyncHelper.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CancellationToken } from './CancellationToken';\n\nexport class AsyncHelper {\n\n    public static readonly STATUS_CHECK_INTERVAL: number = 0;\n\n    public static waitFor(\n        condition: (() => boolean),\n        cancellationToken: CancellationToken = new CancellationToken(),\n        interval: number = AsyncHelper.STATUS_CHECK_INTERVAL,\n        timeout: number = -1): Promise<void> {\n        return new Promise<void>((resolve, reject) => {\n            let rejectTimeout: any;\n            let checkTimeout: any;\n            if (timeout > 0) {\n                rejectTimeout = setTimeout(() => {\n                    if (checkTimeout) {\n                        clearTimeout(checkTimeout);\n                    }\n                    reject(`Waiting timeout ${timeout}ms passed`);\n                }, timeout);\n            }\n            function success(): void {\n                if (rejectTimeout) {\n                    clearTimeout(rejectTimeout);\n                }\n                resolve();\n            }\n            function check(): void {\n                const result = condition();\n                if (result) {\n                    success();\n                } else if (cancellationToken.isCancelled()) {\n                    reject(cancellationToken.getReason());\n                } else {\n                    checkTimeout = setTimeout(check, interval);\n                }\n            }\n            check();\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/async/CancellationToken.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReadOnlyCancellationToken } from './ReadOnlyCancellationToken';\nimport { Logger, LoggerFactory } from '../../logger';\n\nconst logger: Logger = LoggerFactory.getLogger('CancellationToken');\n\nexport type CancelListener = (reason: any) => void;\n\nexport class CancellationToken implements ReadOnlyCancellationToken {\n\n    private cancelled: boolean = false;\n    private reason: string = 'Not defined';\n    private listeners: CancelListener[] = [];\n\n    constructor(private readonly baseToken?: CancellationToken) { }\n\n    public throwIfCanceled(): void {\n        if (this.isCancelled()) {\n            throw Error(this.getReason());\n        }\n    }\n\n    public onCancel(callback: CancelListener): void {\n        if (this.listeners.indexOf(callback) === -1) {\n            this.listeners.push(callback);\n        }\n    }\n\n    public isCancelled(): boolean {\n        if (this.baseToken) {\n            return this.cancelled || this.baseToken.isCancelled();\n        } else {\n            return this.cancelled;\n        }\n    }\n\n    public cancel(reason: string = 'Operation cancelled'): void {\n        if (!this.cancelled) {\n            this.reason = reason;\n            this.listeners.forEach(listener => {\n                try {\n                    listener(reason);\n                } catch (error) {\n                    logger.warn('Cancellation listener raised error', error);\n                }\n            });\n            this.cancelled = true;\n        }\n    }\n\n    public getReason(): string {\n        return this.baseToken && this.baseToken.cancelled ? this.baseToken.getReason() : this.reason;\n    }\n}"
  },
  {
    "path": "web/packages/common/src/util/async/ReadOnlyCancellationToken.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport abstract class ReadOnlyCancellationToken {\n\n    public abstract isCancelled(): boolean;\n\n    public abstract onCancel(callback: (reason: any) => void): void;\n\n}"
  },
  {
    "path": "web/packages/common/src/util/async/ReadWriteCancellationToken.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CancellationToken } from './CancellationToken';\n\nexport class ReadWriteCancellationToken {\n\n    constructor(\n        private readonly readToken: CancellationToken = new CancellationToken(),\n        private readonly writeToken: CancellationToken = new CancellationToken()\n    ) {}\n\n    public cancelRead(reason: string = 'Read cancelled'): void {\n        this.readToken.cancel(reason);\n    }\n\n    public cancelWrite(reason: string = 'Write cancelled'): void {\n        this.writeToken.cancel(reason);\n    }\n\n    public throwIfCanceled(): void {\n        if (this.isCancelled()) {\n            throw Error(this.readToken.getReason() || this.writeToken.getReason() || 'Cancelled');\n        }\n    }\n\n    public isCancelled(): boolean {\n        return this.readToken.isCancelled() && this.writeToken.isCancelled();\n    } \n\n    public cancel(reason: string = 'Cancelled'): void {\n        this.cancelRead(reason);\n        this.cancelWrite(reason);\n    }\n\n    public isReadCancelled(): boolean {\n        return this.readToken.isCancelled();\n    }\n\n    public isWriteCancelled(): boolean {\n        return this.writeToken.isCancelled();\n    }\n\n    public getReadToken(): CancellationToken {\n        return this.readToken;\n    }\n\n    public getWriteToken(): CancellationToken {\n        return this.writeToken;\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/async/SequencedExecutor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger } from '../../logger/Logger';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { AsyncHelper } from './AsyncHelper';\nimport { LoggerFactory } from '../../logger/LoggerFactory';\n\ntype PendingTask = {\n    id: number,\n    task: () => Promise<void>;\n};\n\nexport class SequencedExecutor {\n\n    private outQueue: Queue<PendingTask> = new Queue<PendingTask>();\n\n    private currentId: number = 0;\n\n    constructor(private readonly log: Logger = LoggerFactory.getLogger('SequencedExecutor')) { }\n\n    public async submit(task: () => Promise<void>): Promise<void> {\n        const id = ++this.currentId;\n        /* istanbul ignore if */\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Scheduling [${id}] task`);\n        }\n        this.outQueue.enqueue({\n            id: this.currentId,\n            task\n        });\n        if (this.outQueue.size() > 1) {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Waiting for [${id}] task to execute`);\n            }\n            await AsyncHelper.waitFor(() => this.outQueue.peek().id === id);\n        }\n        try {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Executing [${id}] task`);\n            }\n            await this.outQueue.peek().task();\n        } finally {\n            this.outQueue.dequeue();\n        }\n    }\n}"
  },
  {
    "path": "web/packages/common/src/util/async/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './CancellationToken';\nexport * from './ReadOnlyCancellationToken';\nexport * from './ReadWriteCancellationToken';\nexport * from './AsyncHelper';\nexport * from './SequencedExecutor';\nexport * from './promises';"
  },
  {
    "path": "web/packages/common/src/util/async/promises.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RetryConfig } from '../../RetryConfig';\n\nexport const defaultPromiseRetryConfig: RetryConfig = {\n    retriesNum: 3,\n    retryTimeoutInMillis: 500\n};\n\ntype CatchHandler<T> = (error: any) => Promise<T>;\n\nexport function retriable<T>(\n    action: () => Promise<T>,\n    { retriesNum, retryTimeoutInMillis, errorHandler }: RetryConfig = defaultPromiseRetryConfig): () => Promise<T> {\n    let count = retriesNum;\n    const catchHandler: CatchHandler<T> = (error) => {\n        if (count === 0) {\n            throw error;\n        }\n        if (errorHandler) {\n            errorHandler(error);\n        }\n        count--;\n        return delayed(action, retryTimeoutInMillis)\n                .catch(catchHandler);\n    };\n    return () => action().catch(catchHandler);\n}\n\nexport function delayed<T>(action: () => Promise<T>, timeoutInMillis: number = defaultPromiseRetryConfig.retryTimeoutInMillis): Promise<T> {\n    return new Promise<T>((resolve, reject) => {\n        setTimeout(() => {\n            action()\n                .then(resolve)\n                .catch(reject);\n        }, timeoutInMillis);\n    });\n} "
  },
  {
    "path": "web/packages/common/src/util/collections/BlockingQueue.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { CancellationToken } from '../async/CancellationToken';\nimport { AsyncHelper } from '../async/AsyncHelper';\n\nexport abstract class BlockingQueue<T> {\n    public abstract async blockingDequeue(cancellationToken?: CancellationToken): Promise<T>;\n    public abstract async enqueue(el: T): Promise<void>;\n    public abstract size(): number;\n    public abstract clear(): void;\n    public abstract peek(): T;\n    public abstract dequeue(): T;\n}\n\nexport class BlockingQueueBase<T> implements BlockingQueue<T> {\n\n    constructor(private readonly internal: Queue<T> = new Queue<T>()) {}\n\n    public async blockingDequeue(cancellationToken: CancellationToken = new CancellationToken()): Promise<T> {\n        if (this.internal.size() > 0) {\n            return Promise.resolve(this.internal.dequeue());\n        }\n        return AsyncHelper\n            .waitFor(\n                () => this.internal.size() > 0, \n                cancellationToken)\n            .then(() => this.internal.dequeue());\n    }\n\n    public async enqueue(el: T): Promise<void> {\n        this.internal.enqueue(el);\n    }\n\n    public size(): number {\n        return this.internal.size();\n    }\n\n    public clear(): void {\n        this.internal.clear();\n    }\n\n    public peek(): T {\n        return this.internal.peek();\n    }\n\n    public dequeue(): T {\n        return this.internal.dequeue();\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/collections/ExtendedMap.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ObjectUtils } from '../js/ObjectUtils';\n\nexport class ExtendedMap<K, V> extends Map<K, V> {\n\n    private constructor() {\n        super();\n    }\n\n    public static create<K, V>(): ExtendedMap<K, V> {\n        const instance = ObjectUtils.setPrototypeOf(new Map<K, V>(), ExtendedMap.prototype);\n        return instance as ExtendedMap<K, V>;\n    }\n\n    public valuesArray(): V[] {\n        const res: V[] = [];\n        this.forEach(v => res.push(v));\n        return res;\n    }\n\n    public getOrAdd(key: K, producer: () => V): V {\n        let res = this.get(key);\n        if (res === undefined) {\n            res = producer();\n            this.set(key, res);\n        }\n        return res;\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/collections/LimitedBufferQueue.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\n\nexport class LimitedBufferQueue<T> extends Queue<T> {\n\n    constructor(\n        private readonly maxBufferSize: number = 1024) {\n        super();\n    }\n\n    public enqueue(elem: T): boolean {\n        if (this.size() >= this.maxBufferSize) {\n            throw new Error(`Buffer reached the limit ${this.maxBufferSize}`);\n        } else {\n            return super.enqueue(elem);\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/collections/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './BlockingQueue';\nexport * from './LimitedBufferQueue';\nexport * from './ExtendedMap';\nexport * from './map';"
  },
  {
    "path": "web/packages/common/src/util/collections/map.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function pop<K, V>(map: Map<K, V>): [K, V] {\n    if (!map || map.size === 0) {\n        throw new Error('Map is empty');\n    }\n    const entry = Array.from(map)[map.size - 1];\n    map.delete(entry[0]);\n    return entry;\n}"
  },
  {
    "path": "web/packages/common/src/util/dom/DomUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LoggerFactory } from '../../logger';\n\nexport class DomUtils {\n\n    private static log: Logger = LoggerFactory.getLogger('DomUtils');\n\n    public static iFrameLoaded(iFrameElement: HTMLIFrameElement): Promise<HTMLIFrameElement> {\n        return new Promise((resolve) => {\n            iFrameElement.addEventListener('load', () => {\n                resolve(iFrameElement);\n            }, false);\n        });\n    }\n\n    public static getOrCreateHiddenIFrame(id: string, url: string): Promise<HTMLIFrameElement> {\n        let iFrameElement = document.getElementById(id) as HTMLIFrameElement;\n        if (iFrameElement) {\n            DomUtils.log.debug(`iFrame [${id}] already exist`);\n            return Promise.resolve(iFrameElement as HTMLIFrameElement);\n        } else {\n            iFrameElement = document.createElement('iframe');\n            iFrameElement.setAttribute('id', id);\n            iFrameElement.setAttribute('src', url);\n            iFrameElement.style.cssText = 'position:absolute;width:1px;height:1px;left:-9999px;display:none';\n            document.body.appendChild(iFrameElement);\n        }\n        return DomUtils.iFrameLoaded(iFrameElement);\n    }\n\n    public static getOrigin(url: string): string {\n        if (url.startsWith('/')) {\n            return window.location.origin;\n        }\n        const parts = url.split('/');\n        if (parts.length > 2 && parts[0].indexOf('http') === 0) {\n            return parts[0] + '//' + parts[2];\n        } else {\n            throw new Error(`Couldn't get origin, unsupported URL - ${url}`);\n        }\n    }\n\n    public static getQueryParam(name: string): string | undefined {\n        const top = DomUtils.getTopWindow(window);\n        const value = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(top.location.search);\n        return value ? decodeURIComponent(value[1]) : undefined;\n    }\n\n    public static getTopWindow(window: Window): Window {\n        try {\n            if (window.parent && window.parent !== window) {\n                return DomUtils.getTopWindow(window.parent);\n            } else {\n                return window;\n            }\n        } catch (e) {\n            // parent from other domain, we should stop here\n            return window;\n        }\n    }\n\n}\n"
  },
  {
    "path": "web/packages/common/src/util/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Arrays';\nexport * from './ExtendedArray';\nexport * from './GUID';\nexport * from './collections';\nexport * from './async';\nexport * from './state';\nexport * from './types';\nexport * from './dom/DomUtils';\nexport * from './time/TimeUtils';\nexport * from './url/UrlParamsProvider';\nexport * from './unique';\nexport * from './once';"
  },
  {
    "path": "web/packages/common/src/util/js/ObjectUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class ObjectUtils {\n\n    public static setPrototypeOf: (object: any, prototype: any) => any = setProtoImpl();\n\n}\n\nfunction setProtoImpl(): (x: any, y: any) => any {\n    return Object.setPrototypeOf || _proto_supported() ? set_proto_ : copyProperties;\n}\n\nfunction set_proto_(obj: any, proto: any): any {\n    obj.__proto__ = proto;\n    return obj;\n}\n\nfunction _proto_supported(): boolean {\n    return { __proto__: [] } instanceof Array;\n}\n\nfunction copyProperties(obj: any, proto: any): any {\n    for (let prop in proto) {\n        if (!obj.hasOwnProperty(prop)) {\n            obj[prop] = proto[prop];\n        }\n    }\n    return obj;\n}\n"
  },
  {
    "path": "web/packages/common/src/util/once.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Call source fn only once, even if source promise is rejected\n */\nexport const once = <Req, Res>(fn: (req?: Req) => Promise<Res>): (req?: Req) => Promise<Res> => {\n    let promise: Promise<Res> | undefined;\n    return (req?: Req) => {\n        if (!promise) {\n            promise = fn(req);\n        }\n        return promise;\n    };\n};\n\nexport function onceVoid(fn: () => void): () => void {\n    let called = false;\n    return () => {\n        if (!called) {\n            called = true;\n            fn();\n        }\n    };\n}"
  },
  {
    "path": "web/packages/common/src/util/state/StateMaschine.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport type Transitions<T> = Transition<T>[];\n\nexport interface Transition<T> {\n    from: T;\n    to: T;\n    preHandler?: () => Promise<void>;\n    postHandler?: () => Promise<void>;\n}\n\nexport interface StateMaschine<T> {\n\n    is(state: T): boolean;\n\n    isOneOf(...states: T[]): boolean;\n\n    canGo(state: T): boolean;\n\n    getCurrent(): T;\n\n    /**\n     * Swithing the state asynchronously only if all pre-handlers resolved\n     */\n    goAsync(to: T, dynamicHandlers?: Handlers): Promise<void>;\n\n    /**\n     * Switching the state synchronously, executing pre and post handlers at background\n     */\n    go(to: T): void;\n\n    throwIfNot(...states: T[]): void;\n}\n\nexport type Handlers = {\n    preHandler?: () => Promise<void>; \n    postHandler?: () => Promise<void>; \n};\n\n"
  },
  {
    "path": "web/packages/common/src/util/state/StateMaschineBase.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Transition, Transitions, StateMaschine, Handlers } from './StateMaschine';\nimport { Logger } from '../../logger/Logger';\nimport { LoggerFactory } from '../../logger/LoggerFactory';\n\nclass StateDescriptor<T> {\n\n    constructor(\n        public state: T,\n        public inTransitions: Transitions<T> = [],\n        public outTransitions: Transitions<T> = []) { }\n\n    public hasOutTransition(state: T): boolean {\n        return this.outTransitions.filter(transtion => transtion.to === state).length > 0;\n    }\n}\n\nexport class StateMaschineBase<T> implements StateMaschine<T> {\n\n    private readonly stateDescriptorsMap: Map<T, StateDescriptor<T>> = new Map<T, StateDescriptor<T>>();\n\n    constructor(private current: T, transitions: Transitions<T>, private logger: Logger = LoggerFactory.getLogger('StateMaschine')) {\n        transitions.forEach(transition => {\n            this.putIfAbsent(transition.from);\n            this.putIfAbsent(transition.to);\n            const fromDescriptor = this.lookup(transition.from);\n            if (fromDescriptor.hasOutTransition(transition.to)) {\n                throw `Transition ${transition.from} -> ${transition.to} already exists`;\n            }\n            fromDescriptor.outTransitions.push(transition);\n        });\n    }\n\n    public is(state: T): boolean {\n        return this.current === state;\n    }\n\n    public isOneOf(...states: T[]): boolean {\n        for (const state of states) {\n            if (this.is(state)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public getCurrent(): T {\n        return this.current;\n    }\n\n    public canGo(state: T): boolean {\n        const descriptor = this.stateDescriptorsMap.get(this.getCurrent());\n        if (descriptor) {\n            return descriptor.hasOutTransition(state);\n        } else {\n            return false;\n        }\n    }\n\n    public go(to: T): void {\n        if (!this.canGo(to)) {\n            throw new Error(`Transition ${this.getCurrent()} -> ${to} does not exist`);\n        }\n        const descriptor = this.lookup(this.getCurrent());        \n        const transition = descriptor.outTransitions.find(transition => transition.to === to) as Transition<T>;\n        const old = this.getCurrent();\n        if (transition.preHandler) {\n            transition.preHandler()\n                .then(() => {\n                    /* istanbul ignore if */\n                    if (this.logger.isTraceEnabled()) {\n                        this.logger.trace(`Finished pre-handler for ${old} -> ${to}`);\n                    }\n                })\n                .catch(e => this.logger.error(`Pre-handler for ${this.getCurrent()} -> ${to} failed`, e));\n        }\n        this.switchInternal(to);\n        if (transition.postHandler) {\n            transition.postHandler()\n                .then(() => {\n                    /* istanbul ignore if */\n                    if (this.logger.isTraceEnabled()) {\n                        this.logger.trace(`Finished post-handler for ${this.getCurrent()} -> ${to}`);\n                    }\n                })\n                .catch(e => this.logger.error(`Post-handler for ${this.getCurrent()} -> ${to} failed`, e));\n        }\n    }\n\n    public goAsync(to: T, dynamicHandlers?: Handlers): Promise<void> {\n        if (this.canGo(to)) {\n            const descriptor = this.lookup(this.getCurrent());                    \n            const transition = descriptor.outTransitions.find(transition => transition.to === to) as Transition<T>;\n            return new Promise<void>((resolve, reject) => {\n                const preHandlePassed = () => {\n                    this.switchInternal(transition.to);\n                    const postHandlerPromises = [dynamicHandlers ? dynamicHandlers.postHandler : null, transition.postHandler]\n                        .filter(handler => !!handler)\n                        .map(handler => handler as () => Promise<void>)\n                        .map(handler => handler());\n                    Promise.all(postHandlerPromises)\n                        .then(() => resolve(), reject);\n                };\n                const preHandlePromises = [dynamicHandlers ? dynamicHandlers.preHandler : null, transition.preHandler]\n                    .filter(handler => !!handler)\n                    .map(handler => handler as () => Promise<void>)\n                    .map(handler => handler());\n                Promise.all(preHandlePromises)\n                    .then(preHandlePassed.bind(this), reject);\n            });\n        } else {\n            const error = `Transition ${this.getCurrent()} -> ${to} does not exist`;\n            this.logError(error);\n            return Promise.reject(error);\n        }\n    }\n\n    public throwIfNot(...states: T[]): void {\n        let result = false;\n        for (const state of states) {\n            if (this.is(state)) {\n                result = true;\n            }\n        }\n        if (!result) {\n            const error = `Current state is ${this.current} not one of [${states.join(',')}]`;\n            this.logError(error);\n            throw new Error(error);\n        }\n    }\n\n    private logError(m: string): void {\n        if (this.logger) {\n            this.logger.error(m);\n        }\n    }\n    \n    private switchInternal(to: T): void {\n        /* istanbul ignore if */\n        if (this.logger.isTraceEnabled()) {\n            this.logger.trace(`${this.getCurrent()} -> ${to}`);\n        }\n        this.current = to;\n    }\n\n    private putIfAbsent(state: T): void {\n        if (!this.stateDescriptorsMap.has(state)) {\n            this.stateDescriptorsMap.set(state, new StateDescriptor(state));\n        }\n    }\n\n    private lookup(state: T): StateDescriptor<T> {\n        return this.stateDescriptorsMap.get(state) as StateDescriptor<T>;\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/state/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './StateMaschine';\nexport * from './StateMaschineBase';"
  },
  {
    "path": "web/packages/common/src/util/time/TimeUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class TimeUtils {\n\n    public static timeout(ms: number): Promise<void> {\n        return new Promise(resolve => setTimeout(resolve, ms));\n    }\n\n    public static format(date: Date): string {\n        return `${date.toTimeString().replace(/.*(\\d{2}:\\d{2}:\\d{2}).*/, '$1')}.${('000' + date.getMilliseconds()).slice(-3)}`;\n    }\n\n}"
  },
  {
    "path": "web/packages/common/src/util/types.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function isString(value: any): boolean {\n    return value && Object.prototype.toString.call(value) === '[object String]';\n}"
  },
  {
    "path": "web/packages/common/src/util/unique.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst idCounters: Map<string, number> = new Map();\n\nexport function uniqueId(prefix: string = ''): string {\n    const prevIdx = idCounters.get(prefix) || 0;\n    const nextIdx = prevIdx + 1;\n    idCounters.set(prefix, nextIdx);\n    return `${prefix + nextIdx}`;\n}"
  },
  {
    "path": "web/packages/common/src/util/url/UrlParamsProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ndeclare var window: Window;\n\nexport class UrlParamsProvider {\n\n    public static getParam(name: string): string | undefined {\n        if (typeof window === 'undefined') {\n            return undefined;\n        }\n        const queryString = this.parseUrlParams(window.location.search);\n        return queryString[name];\n    }\n\n    public static parseUrlParams(query: string): any {\n        const queryString: any = {};\n        query = query.startsWith('?') ? query.substring(1) : query;\n        let vars = query.split('&');\n        for (let i = 0; i < vars.length; i++) {\n            let pair = vars[i].split('=');\n            if (typeof queryString[pair[0]] === 'undefined') {\n                queryString[pair[0]] = decodeURIComponent(pair[1]);\n            } else if (typeof queryString[pair[0]] === 'string') {\n                let arr = [queryString[pair[0]], decodeURIComponent(pair[1])];\n                queryString[pair[0]] = arr;\n            } else {\n                queryString[pair[0]].push(decodeURIComponent(pair[1]));\n            }\n        }\n        return queryString;\n    }\n}"
  },
  {
    "path": "web/packages/common/src/ws/detect.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function webSocketCtor(): any {\n    if (typeof window !== 'undefined') {\n        const _window: any = window;\n        if (_window && _window.WebSocket) {\n            return _window.WebSocket;\n        }    \n    }\n    const isNode = typeof global !== 'undefined' && ({}).toString.call(global) === '[object global]';    \n    if (isNode) {\n        const _global: any = global;\n        if (_global && _global.WebSocket) {\n            return _global.WebSocket;\n        }\n        return require('websocket').w3cwebsocket;          \n    }\n    throw new Error('WebSocket API is not found');\n}"
  },
  {
    "path": "web/packages/common/tests/cache/InMemoryCache.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InMemoryCache } from '../../src/cache/InMemoryCache';\nimport { CacheEntry } from '../../src/cache/CacheEntry';\nimport { expect } from 'chai';\n\ndescribe('InMemoryCache', () => {\n    \n    const key = 'key';\n    const value = {\n        x: 10\n    };\n\n    it('It can store element without expiration', (done) => {\n        const sut = new InMemoryCache();\n        sut.set(key, new CacheEntry(value));\n        setTimeout(() => {\n            expect(sut.get(key)).to.deep.eq(value);\n            done();\n        }, 50);\n    });\n\n    it('I evicts value on expiration time', (done) => {\n        const sut = new InMemoryCache();\n        sut.set(key, new CacheEntry(value, 1));\n        setTimeout(() => {\n            expect(sut.get(key)).to.be.undefined;\n            done();\n        }, 50);\n    });\n\n    it('It calls callback on value eviction', (done) => {\n        const sut = new InMemoryCache();\n        sut.set(key, new CacheEntry(value, 5, () => {\n            done();\n        }));\n    });\n\n    it('It can check whether value exist or not', () => {\n        const sut = new InMemoryCache();\n        sut.set(key, new CacheEntry(value));\n        expect(sut.has(key)).to.be.true;\n        expect(sut.has('123')).to.be.false;\n    });\n\n    it('It returns all not expired keys', () => {\n\n        const sut = new InMemoryCache();\n        const keys = ['k', 'k2'];\n\n        keys.forEach(k => sut.set(k, new CacheEntry(value)))\n        \n        const receivedKeys = sut.keys();\n\n        expect(receivedKeys.length).to.eq(2);\n        expect(receivedKeys.indexOf('k') > -1).to.be.true;\n        expect(receivedKeys.indexOf('k2') > -1).to.be.true;\n\n    });\n\n    it('It can restart eviction timer with ttl reset', (done) => {\n        const sut = new InMemoryCache();\n        sut.set(key, new CacheEntry(value, 150));\n        setTimeout(() => {\n            expect(sut.get(key)).to.not.be.undefined;\n            sut.resetTtl(key);\n            setTimeout(() => {\n                // still must be there\n                expect(sut.get(key)).to.not.be.undefined;\n                done();            \n            }, 100);\n        }, 100);\n    });\n\n\n});"
  },
  {
    "path": "web/packages/common/tests/logger/LoggerFactory.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerFactory, LogLevel } from '../../src/logger/LoggerFactory';\n\ndescribe('Logger Factory', () => {\n\n    it('Should be able to register additional logger implementations', () => {\n        let called: { msg: string, args: any, logLevel: LogLevel }[] = [];\n\n        LoggerFactory.registerDelegate({\n            log: (logLevel, msg, args) => { called.push({ msg, args, logLevel }); }\n        });\n\n        let logger = LoggerFactory.getLogger('LoggerFactory.spec');\n        logger.error('test error', { arg: 'arg' });\n\n        expect(called).toEqual([{ msg: 'test error', args: [{ arg: 'arg' }], logLevel: LogLevel.ERROR }]);\n    });\n\n    it('Should be able to removed registered logger implementations', () => {\n        let called: { msg: string, args: any, logLevel: LogLevel }[] = [];\n\n        let unregisterObj = LoggerFactory.registerDelegate({\n            log: (logLevel, msg, args) => { called.push({ msg, args, logLevel }); }\n        });\n\n        let logger = LoggerFactory.getLogger('LoggerFactory.spec');\n        logger.error('test error', { arg: 'arg' });\n\n        unregisterObj.unregister();\n        logger.error('test error2', { arg: 'arg2' });\n\n        expect(called).toEqual([{ msg: 'test error', args: [{ arg: 'arg' }], logLevel: LogLevel.ERROR }]);\n    });\n});"
  },
  {
    "path": "web/packages/common/tests/util/Arrays.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Arrays, stringToArrayBuffer, arrayBufferToString } from '../../src/util/Arrays';\n\ndescribe('Arrays', () => {\n\n    it('Should contatenate two Array Buffers', () => {\n        const first = new Uint32Array([1, 2, 3]);\n        const second = new Uint32Array([5, 6, 7]);\n        expect(new Uint32Array(Arrays.concatenateBuffers(first.buffer, second.buffer)))\n            .toEqual(new Uint32Array([1, 2, 3, 5, 6, 7]));\n    });\n\n    it('Should convert array buffer to string and back', () => {\n        const first = new Uint8Array([123, 231, 312]);\n        expect(first).toEqual(\n            new Uint8Array(stringToArrayBuffer(arrayBufferToString(first.buffer))));\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/AsyncHelper.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AsyncHelper } from '../../src/util/async/AsyncHelper';\nimport { CancellationToken } from '../../src/util/async/CancellationToken';\n\n\ndescribe('Async Helper', () => {\n\n    it('Should fail if passed timeout passed', (done) => {\n        AsyncHelper.waitFor(() => false, new CancellationToken(), 10, 1).catch(() => done());\n    });\n\n    it('Should fail if cancellation token cancelled', (done) => {\n        const token = new CancellationToken();\n        AsyncHelper.waitFor(() => false, token).catch(() => done());\n        token.cancel('Cancelled');\n    });\n\n    it('Should not fail if cancellation token cancelled but condition is true', (done) => {\n        const token = new CancellationToken();\n        token.cancel('Cancelled');\n        AsyncHelper.waitFor(() => true, token).then(() => done());\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/BlockingQueue.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BlockingQueueBase } from '../../src/util/collections/BlockingQueue';\n\ndescribe('BlockingQueue', () => {\n\n    const sut = new BlockingQueueBase();\n\n    it('Should wait until element appears', (done) => {\n        const el = 'test';\n        sut.blockingDequeue().then(res => {\n            expect(res).toBe(el);\n            done();\n        });\n        setTimeout(() => sut.enqueue(el), 30);\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/ExtendedArray.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ExtendedArray } from '../../src/util/ExtendedArray';\nimport { expect } from 'chai';\n\ndescribe('ExtededArray', () => {\n\n    it('Returns distinct values by key', () => {\n        const result = ExtendedArray.of([{ a: '1', b: 'x' }, { a: '1', b: 'y' }])\n            .distinct(x => x.a)\n            .toArray();\n        expect(result[0].a).eq('1');\n        expect(result.length).eq(1);\n    });\n\n    it('Can join with other array', () => {\n        const result = ExtendedArray.of([1, 2, 3])\n            .joinWith([4, 5, 6], (x, y) => x + y, (x, y) => x === 1 && y === 4)\n            .toArray();\n        expect(result.length).eq(1);\n        expect(result[0]).eq(5);\n    });\n\n    it('Can be converted to Map', () => {\n        const map = ExtendedArray.of([1])\n            .toMap(x => x + 1, x => x + 2);\n        expect(map.size).eq(1);\n        expect(map.get(2)).eq(3);\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/LimitedBufferQueue.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LimitedBufferQueue } from '../../src/util/collections/LimitedBufferQueue';\n\ndescribe('LimitedBufferQueue', () => {\n\n    it('Should enqueue and dequeue element if buffer size is enough', () => {\n        const sut = new LimitedBufferQueue(1);\n        const el = 'test';\n        sut.enqueue(el)\n        expect(sut.dequeue()).toEqual(el);\n    });\n\n    it('Should reject enqueue if buffer size is not enough', (done) => {\n        const sut = new LimitedBufferQueue(0);\n        const el = 'test';\n        try {\n            sut.enqueue(el);\n        } catch (error) {\n            done();\n        }\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/SequencedExecutor.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SequencedExecutor } from '../../src/util/async/SequencedExecutor';\n\ndescribe('SequencedExecutor', () => {\n\n    const sut = new SequencedExecutor();\n\n    it('Executus tasks in a row', (done) => {\n        let counter = 0;\n        sut.submit(async () => {\n            counter++;\n        });\n        sut.submit(async () => {      \n            if (counter === 1) {\n                done();\n            }\n        });\n    });\n\n    it('Executus tasks if previous failed', (done) => {\n        sut.submit(async () => {\n            throw new Error('Failed');\n        }).catch(e => {});\n        sut.submit(async () => done());\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/StateMaschineBase.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StateMaschineBase } from '../../src/util/state';\n\ndescribe('StateMaschineBase', () => {\n\n    enum State { CREATED, OPEN, CLOSED }\n\n    it('Should switch states', (done) => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        expect(sut.canGo(State.CLOSED)).toBeTruthy();\n        sut.goAsync(State.CLOSED).then(() => {\n            expect(sut.is(State.CLOSED)).toBeTruthy();\n            expect(sut.getCurrent()).toBe(State.CLOSED);\n            done();\n        });\n    });\n\n    it('Should execute preHandler before switching the state', (done) => {\n        let called = false;\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, preHandler: async () => {\n                    expect(sut.getCurrent()).toBe(State.OPEN);\n                    called = true;\n                }\n            }\n        ]);\n        sut.goAsync(State.CLOSED).then(() => {\n            expect(called).toBeTruthy();\n            done();\n        });\n    });\n\n    it('Should execute both static and dynamic preHandlers before switching the state', (done) => {\n        let called = 0;\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, preHandler: async () => {\n                    expect(sut.getCurrent()).toBe(State.OPEN);\n                    called++;\n                }\n            }\n        ]);\n        sut.goAsync(State.CLOSED, {\n            preHandler: async () => {\n                expect(sut.getCurrent()).toBe(State.OPEN);\n                called++;\n            }\n        }).then(() => {\n            expect(called).toEqual(2);\n            done();\n        });\n    });\n\n    it('Should execute both static and dynamic post handlers after switching the state', (done) => {\n        let called = 0;\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, postHandler: async () => {\n                    expect(sut.getCurrent()).toBe(State.CLOSED);\n                    called++;\n                }\n            }\n        ]);\n        sut.goAsync(State.CLOSED, {\n            postHandler: async () => {\n                expect(sut.getCurrent()).toBe(State.CLOSED);\n                called++;\n            }\n        }).then(() => {\n            expect(called).toEqual(2);\n            done();\n        });\n    });\n\n    it('Should execute postHandler after switching the state', (done) => {\n        let called = false;\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, postHandler: async () => {\n                    expect(sut.getCurrent()).toBe(State.CLOSED);\n                    called = true;\n                }\n            }\n        ]);\n        sut.goAsync(State.CLOSED).then(() => {\n            expect(called).toBeTruthy();\n            done();\n        });\n    });\n\n    it('Should raise error if current status is not correct', () => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        expect(() => sut.throwIfNot(State.CLOSED)).toThrow();\n    });\n\n    it('Should raise error if none of statuses is correct', () => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        expect(() => sut.throwIfNot(State.CLOSED, State.CREATED)).toThrow();\n    });\n\n    it('Should return true from one of check if second state is correct', (done) => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        expect(sut.canGo(State.CLOSED)).toBeTruthy();\n        sut.goAsync(State.CLOSED).then(() => {\n            expect(sut.is(State.CLOSED)).toBeTruthy();\n            expect(sut.isOneOf(State.CREATED, State.CLOSED, State.OPEN)).toBeTruthy();\n            done();\n        });\n    });\n\n    it('Should return false from one of check if no correct states provided', (done) => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        expect(sut.canGo(State.CLOSED)).toBeTruthy();\n        sut.goAsync(State.CLOSED).then(() => {\n            expect(sut.isOneOf(State.CREATED, State.OPEN)).toBeFalsy();\n            done();\n        });\n    });\n\n    it('Should switch state synchronously', () => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED\n            }\n        ]);\n        sut.go(State.CLOSED);\n        expect(sut.getCurrent()).toEqual(State.CLOSED);\n    });\n\n    it('Should execute pre handler for synchronous switch', (done) => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, preHandler: async () => done()\n            }\n        ]);\n        sut.go(State.CLOSED);\n    });\n\n    it('Should execute pre handler for synchronous switch', (done) => {\n        const sut = new StateMaschineBase<State>(State.OPEN, [\n            {\n                from: State.OPEN, to: State.CLOSED, preHandler: async () => done()\n            }\n        ]);\n        sut.go(State.CLOSED);\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/map.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pop } from '../../src/util/collections/map';\n\ndescribe('Map Utils', () => {\n\n    it('Should pop last element from Map', () => {\n\n        const map = new Map();\n\n        map.set(1, 2);\n        map.set(3, 4);\n\n        const [key, value] = pop(map);\n\n        expect(key).toBe(3);\n        expect(value).toBe(4);\n        expect(map.get(key)).toBeUndefined();\n\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tests/util/promises.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { delayed, retriable, defaultPromiseRetryConfig } from '../../src/util/async/promises';\nimport { RetryConfig } from '../../src/RetryConfig';\n\nconst expectedResult = 1;\nconst expectedError = new Error('Error');\nconst plainAction = async () => expectedResult;\nconst errorAction = async () => { throw expectedError; };\n\ndescribe('Retriable invocation', () => {\n\n    it('Should make N retries if action is failing', async () => {\n        const retriesNum = 3;\n        let retriesCount = retriesNum;\n        // fail on N - 1 invocations and return res on last try\n        const actionMock = jest.fn(() => {\n            if (retriesCount > 1) {\n                retriesCount--;\n                throw expectedError;\n            } else {\n                return plainAction();\n            }\n        });\n        const retryConfig: RetryConfig = {...defaultPromiseRetryConfig, retriesNum};\n        const retriableAction = retriable(async () => actionMock(), retryConfig);\n        const result = await retriableAction();\n        expect(result).toBe(expectedResult);\n        expect(actionMock.mock.calls.length).toBe(retriesNum);\n        expect(actionMock.mock.results.filter(r => r.isThrow).length).toBe(retriesNum - 1);\n    });\n\n    it('Should fail if all retries failed', async () => {\n        const retriesNum = 3;\n        const actionMock = jest.fn(errorAction);\n        const retryConfig: RetryConfig = {...defaultPromiseRetryConfig, retriesNum};\n        const retriableAction = retriable(actionMock, retryConfig);\n        try {\n            await retriableAction();            \n            fail('Should fail');\n        } catch (error) {\n            expect(error).toBe(expectedError);\n            expect(actionMock.mock.calls.length).toBe(retriesNum + 1);\n        }\n    });\n\n    it('Should call error handler if provided', async () => {\n        const retriesNum = 3;\n        const actionMock = jest.fn(errorAction);\n        const errorHandler = jest.fn();\n        const retryConfig: RetryConfig = {...defaultPromiseRetryConfig, retriesNum, errorHandler};\n        const retriableAction = retriable(actionMock, retryConfig);\n        try {\n            await retriableAction();            \n            fail('Should fail');\n        } catch (error) {\n            expect(errorHandler.mock.calls.length).toBe(retriesNum);\n            errorHandler.mock.calls.forEach(call => expect(call[0]).toBe(expectedError));\n        }\n    });\n\n});\n\ndescribe('Delayed promise invocation', () => {\n\n    it('Should invoke action after delay', async () => {\n        const actionMock = jest.fn(plainAction);\n        const delayedAction = delayed(actionMock, 5);\n        expect(actionMock.mock.calls.length).toBe(0);\n        const result = await delayedAction;\n        expect(result).toBe(expectedResult);\n        expect(actionMock.mock.calls.length).toBe(1);\n    });\n\n    it('Should fail with target action\\'s error if raised', async () => {\n        const actionMock = jest.fn(errorAction);\n        const delayedAction = delayed(actionMock, 5);\n        expect(actionMock.mock.calls.length).toBe(0);\n        try {\n            await delayedAction;\n            fail('Should raise error');\n        } catch (error) {\n            expect(actionMock.mock.calls.length).toBe(1);\n            expect(error).toBe(expectedError);\n        }\n    });\n\n});"
  },
  {
    "path": "web/packages/common/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noUnusedLocals\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"removeComments\": false,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"jest\",\n            \"long\",\n            \"node\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/common/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/common-api-impl/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/common-api-impl/README.md",
    "content": "# Implementation for Common API Draft Proposal\n\nPartial implementation for [Common Interop API](https://github.com/finos-plexus/finos-plexus.github.io/blob/master/client-api/client-api.ts). \n\n## Metadata Setup\n\nPlexus Interop based on Metadata, so each application interracting via Common API should still be defined in metatada. \n\n- All Methods/Streams/Messages must be defined as regular Plexus Messages and Services\n- Method/Stream names, used from client code, should refer to aliases of provided actions. E.g. method, used like below:\n\n```javascript\npeer.invoke('close-market-order', { orderId });\n```\nshould be defined in metadata by action provider as following:\n```\napplication ProviderApplication {\n    provides OrderService { \n        CloseMarketOrder [(provided_method_alias) = \"close-market-order\" ]; \n    }\n}\n```\n- All apps should be also marked with aliases in metadata to be discovered by Common API, e.g.:\napplication connecting to Plexus using\n```javascript\nconst peer = await window.platform.connect('web-trader-client');\n```\nshould be mapped via custom option like this:\n```\napplication WebTraderClient {\n    option (app_alias) = \"web-trader-client\";\n}\n```\n\n## Implemented features\n\nAPI is implemented partially, all other methods raise ```Method not implemented``` error. Available features can be checked via feature flags API. Here is the list of supported functionality:\n\n  - InvokeMethod\n\n  - SubscribeStream\n\n  - RegisterMethodOnConnect\n\n  - RegisterStreamOnConnect\n\n  - DiscoverMethods\n\n  - DiscoverStreams"
  },
  {
    "path": "web/packages/common-api-impl/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/common-api-impl\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Common API implementation\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main && yarn build:bundle\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:bundle\": \"yarn create-bundle\",\n    \"create-bundle\": \"browserify dist/main/src/api/InteropPlatformFactory.js -x websocket -s PlexusPlatformFactory -o dist/main/src/platform-factory.bundle.js\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"jest --coverage\"\n  },\n  \"dependencies\": {\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/remote\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/client-api\": \"0.1.0\",\n    \"@plexus-interop/io\": \"0.1.0\",\n    \"@plexus-interop/metadata\": \"0.1.0\",\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"peerDependencies\": {\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/jest\": \"^23.1.3\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"browserify\": \"^14.5.0\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/common-api-impl/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/common-api-impl/src/PartialPeerDescriptor.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropPeerDescriptor } from './api';\n\n/**\n * Temporary Mock Implementation before we agree on final state of returned Remote Peers\n */\nexport class PartialPeerDescriptor implements InteropPeerDescriptor {\n    \n    public constructor(\n        public applicationName: string,\n        public id: string,\n        public isConnected: boolean = true) {}\n    \n    public getApiMetadata(): Promise<string> {\n        // TODO\n        throw new Error('Method not implemented.');\n    }\n    \n    public onApiMetadataChanged(callback: (metadata: string) => void): void {\n        // TODO\n        throw new Error('Method not implemented.');\n    }\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/PlexusInteropPeer.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropPeer, ConnectionStatus, Subscription, Method, InvokeResult, StreamObserver, StreamSubscription, InteropPeerDescriptor, MethodImplementation, RegisteredMethod, StreamImplementation } from './api/client-api';\nimport { GenericClientApi, MethodType } from '@plexus-interop/client';\nimport { ConnectionStatusListeners } from './listeners';\nimport { InteropRegistryService, Application } from '@plexus-interop/metadata';\nimport { InvokeHandler } from './actions/InvokeHandler';\nimport { SubscribeHandler } from './actions/SubscribeHandler';\nimport { DiscoverMethodsHandler } from './actions/DiscoverMethodsHandler';\n\nexport class PlexusInteropPeer implements InteropPeer {\n\n    private statusChangedListeners: ConnectionStatusListeners = new ConnectionStatusListeners();\n\n    public connectionStatus: ConnectionStatus;\n    public isConnected: boolean;\n    public applicationName: string;\n    public id: string;\n\n    public constructor(\n        private readonly genericClientApi: GenericClientApi,\n        private readonly registryService: InteropRegistryService,\n        private readonly plexusAppMetadata: Application\n    ) {\n        this.id = this.genericClientApi.getConnectionId().toString();\n        this.isConnected = true;\n    }\n\n    public onConnectionStatusChanged(callback: (status: ConnectionStatus) => void): Subscription {\n        return this.statusChangedListeners.addListener(callback);\n    }\n\n    public async disconnect(): Promise<void> {\n        await this.genericClientApi.disconnect();\n        this.statusChangedListeners.notifyListeners(ConnectionStatus.Disconnected);\n    }\n\n    public invoke(method: string | Method, args?: any): Promise<InvokeResult> {\n        return new InvokeHandler(this.registryService, this.genericClientApi, this.plexusAppMetadata).handle(method, args);\n    }\n\n    public subscribe(stream: string | Method, observer: StreamObserver, args?: any): Promise<StreamSubscription> {\n        return new SubscribeHandler(this.registryService, this.genericClientApi, this.plexusAppMetadata).handle(stream, observer, args);\n    }\n\n    public discoverMethods(): Promise<Method[]> {\n        return new DiscoverMethodsHandler(this.genericClientApi, this.registryService)\n            .discoverMethods(MethodType.Unary);\n    }\n\n    public discoverStreams(): Promise<Method[]> {\n        return new DiscoverMethodsHandler(this.genericClientApi, this.registryService)\n            .discoverMethods(MethodType.ServerStreaming);\n    }\n\n    // TODO: Not Implemented =>\n\n    public onMethodRegistered(callback: (method: Method) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public onMethodUnregistered(callback: (method: Method) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public onStreamRegistered(callback: (stream: Method) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public onStreamUnregistered(callback: (stream: Method) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public onPeerConnected(callback: (peer: InteropPeerDescriptor) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public register(methodImplementation: MethodImplementation): Promise<RegisteredMethod> {\n        throw new Error('Method not implemented.');\n    }\n\n    public registerStream(streamImplementation: StreamImplementation): Promise<RegisteredMethod> {\n        throw new Error('Method not implemented.');\n    }\n\n    public publishApiMetadata(apiMetadata: string): Promise<void> {\n        throw new Error('Method not implemented.');\n    }\n\n    public getApiMetadata(): Promise<string> {\n        throw new Error('Method not implemented.');\n    }\n\n    public onApiMetadataChanged(callback: (metadata: string) => void): void {\n        throw new Error('Method not implemented.');\n    }\n\n    public onDisconnected(callback: (error?: Error) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    public discoverPeers(): Promise<InteropPeerDescriptor[]> {\n        throw new Error('Method not implemented.');\n    }\n\n    public onPeerDisconnected(callback: (peer: InteropPeerDescriptor) => void): Subscription {\n        throw new Error('Method not implemented.');\n    }\n\n    // <= TODO: Not Implemented\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/PlexusInteropPlatform.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropPlatform } from './api';\nimport { InteropFeature, MethodImplementation, StreamImplementation, InteropPeer, InteropPeerDefinition } from './api/client-api';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { GenericClientApiBuilder } from '@plexus-interop/client';\nimport { PlexusInteropPeer } from './PlexusInteropPeer';\nimport { registerMethod, registerStream } from './registration';\nimport { InteropPlatformConfig } from './api/InteropPlatformFactory';\nimport { webSocketCtor } from '@plexus-interop/common/dist/main/src/ws/detect';\nimport { WebSocketDataProvider } from '@plexus-interop/remote';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport { UrlInteropRegistryProvider, InteropRegistryService, Application, Option } from '@plexus-interop/metadata';\nimport { DynamicBinaryMarshallerProvider } from '@plexus-interop/io/dist/main/src/dynamic';\n\nexport class PlexusInteropPlatform implements InteropPlatform {\n\n    private registryService: InteropRegistryService;\n    private connectionProvider: () => Promise<TransportConnection>;\n    private marshallerProvider: BinaryMarshallerProvider;\n    private interopRegistryProvider: UrlInteropRegistryProvider;\n\n    public readonly type: string = 'Plexus Interop';\n    public readonly version: string = '0.0.1';\n\n    public constructor(\n        platformConfig: InteropPlatformConfig\n    ) {\n        const wsCtor = webSocketCtor();\n        const metadataWsUrl = `${platformConfig.webSocketUrl}/metadata/interop`;\n        this.connectionProvider = async () => new WebSocketConnectionFactory(new wsCtor(platformConfig.webSocketUrl)).connect();\n        this.interopRegistryProvider = new UrlInteropRegistryProvider(metadataWsUrl, -1, new WebSocketDataProvider(webSocketCtor()));\n    }\n\n    public isFeatureSupported(feature: InteropFeature): boolean {\n        switch (feature) {\n            case InteropFeature.DiscoverMethods:\n            case InteropFeature.DiscoverStreams:\n            case InteropFeature.RegisterMethodOnConnect:\n            case InteropFeature.RegisterStreamOnConnect:\n            case InteropFeature.InvokeMethod:\n            case InteropFeature.SubscribeStream:\n                return true;\n            default:\n                return false;\n        }\n    }\n\n    public async connect(applicationName: string, apiMetadata?: string, methods?: MethodImplementation[], streams?: StreamImplementation[]): Promise<InteropPeer> {\n        await this.finishInitialization();\n        const hostAppMetadata = this.registryService.getApplication(applicationName);\n        const clientBuilder = new GenericClientApiBuilder(this.marshallerProvider)\n            .withApplicationId(hostAppMetadata.id)\n            .withTransportConnectionProvider(this.connectionProvider);\n        methods = methods || [];\n        methods.forEach(method => registerMethod(method, clientBuilder, this.registryService));\n        streams = streams || [];\n        streams.forEach(stream => registerStream(stream, clientBuilder, this.registryService));\n        const genericClient = await clientBuilder.connect();\n        const peer = new PlexusInteropPeer(genericClient, this.registryService, hostAppMetadata);\n        peer.disconnect = peer.disconnect.bind(peer);\n        peer.invoke = peer.invoke.bind(peer);\n        peer.subscribe = peer.subscribe.bind(peer);\n        peer.onConnectionStatusChanged = peer.onConnectionStatusChanged.bind(peer);\n        peer.discoverMethods = peer.discoverMethods.bind(peer);\n        peer.discoverStreams = peer.discoverStreams.bind(peer);\n        peer.disconnect = peer.disconnect.bind(peer);\n        return peer;\n    }\n\n    public async getPeerDefinitions(): Promise<InteropPeerDefinition[]> {\n        await this.finishInitialization();\n        const aliasFinder = (app: Application) => app.options.find(o => o.id.endsWith('alias'));\n        return this.interopRegistryProvider\n            .getCurrent()\n            .applications.valuesArray()\n            .map(aliasFinder)\n            .filter(alias => !!alias)\n            .map(alias => {\n                return {\n                    applicationName: (alias as Option).value\n                };\n            });\n    }\n\n    private async finishInitialization(): Promise<void> {\n        if (!this.marshallerProvider || !this.registryService) {\n            await this.interopRegistryProvider.start();\n            this.marshallerProvider = new DynamicBinaryMarshallerProvider(this.interopRegistryProvider.getCurrent());\n            this.registryService = new InteropRegistryService(this.interopRegistryProvider);\n        }\n    }\n\n}\n"
  },
  {
    "path": "web/packages/common-api-impl/src/actions/DiscoverMethodHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isMethod } from '../types';\nimport { Method } from '../api';\nimport { GenericRequest } from '@plexus-interop/client-api';\nimport { getProvidedMethodByAlias, toConsumedMethodRef } from '../metadata';\nimport { Application, InteropRegistryService } from '@plexus-interop/metadata';\nimport { GenericClientApi, DiscoveryMode, UniqueId, ProvidedMethodReference } from '@plexus-interop/client';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport class DiscoverMethodHandler {\n\n    public constructor(\n        private readonly registryService: InteropRegistryService,\n        private readonly genericClienApi: GenericClientApi,\n        private readonly app: Application\n    ) { }\n\n    public async findOnlineRequestInfo(method: string | Method): Promise<GenericRequest> {\n        return this.findRequestInfo(method, DiscoveryMode.Online);\n    }\n\n    public async findOfflineRequestInfo(method: string | Method): Promise<GenericRequest> {\n        return this.findRequestInfo(method, DiscoveryMode.Offline);\n    }\n\n    public async findRequestInfo(method: string | Method, mode: DiscoveryMode): Promise<GenericRequest> {\n        const methodAlias: string = isMethod(method) ? method.name : method;\n        const providedMethod = getProvidedMethodByAlias(methodAlias, this.registryService, this.app);\n        let requestInfo: GenericRequest;\n        const discovered = await this.genericClienApi.discoverMethod({\n            consumedMethod: toConsumedMethodRef(providedMethod),\n            discoveryMode: mode\n        });\n        let methods = discovered.methods || [];\n        if (isMethod(method)) {\n            const providerAppRef = this.registryService.getApplication(method.peer.applicationName);\n            methods = methods.filter(m => {\n                if (m.providedMethod && m.providedMethod.providedService) {\n                    const id = m.providedMethod.providedService.applicationId;\n                    const connectionId = m.providedMethod.providedService.connectionId;\n                    const connectionIdString = UniqueId.fromProperties(connectionId as plexus.IUniqueId).toString();\n                    return id === providerAppRef.id && connectionIdString === method.peer.id;\n                } else {\n                    return false;\n                }\n            });\n        }\n        if (methods.length > 0) {\n            requestInfo = methods[0].providedMethod as ProvidedMethodReference;\n        } else {\n            throw new Error(`Handler for action [${methodAlias}] is not found`);\n        }\n        return requestInfo;\n    }\n\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/actions/DiscoverMethodsHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedMethodReference, InteropRegistryService } from '@plexus-interop/metadata';\nimport { GenericClientApi } from '@plexus-interop/client';\nimport { Method } from '../api';\nimport { DiscoveryMode, ProvidedServiceReference, DiscoveredMethod, MethodType } from '@plexus-interop/client-api';\nimport { getAlias, getAppAliasById } from '../metadata';\nimport { PartialPeerDescriptor } from '../PartialPeerDescriptor';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport class DiscoverMethodsHandler {\n\n    public constructor(\n        private readonly genericClienApi: GenericClientApi,\n        private readonly registryService: InteropRegistryService\n    ) { }\n\n    public async discoverMethods(type?: MethodType): Promise<Method[]> {\n        const provided = await this.genericClienApi.discoverMethod({\n            discoveryMode: DiscoveryMode.Online\n        });\n        const methods = provided.methods || [];\n        return methods\n            .filter(m => !type || type === m.methodType)\n            .map(m => this.plexusMethodToCommon(m));\n    }\n\n    private plexusMethodToCommon(pm: DiscoveredMethod): Method {\n        const providedMethod = pm.providedMethod as ProvidedMethodReference;\n        const providedService = providedMethod.providedService as ProvidedServiceReference;\n        const appId = providedService.applicationId as string;\n        const connectionId = UniqueId.fromProperties(providedService.connectionId as plexus.IUniqueId).toString();\n        return {\n            name: getAlias(pm.options) || providedMethod.methodId as string,\n            acceptType: pm.inputMessageId,\n            returnType: pm.outputMessageId,\n            peer: new PartialPeerDescriptor(\n                getAppAliasById(appId, this.registryService) || appId,\n                connectionId)\n        };\n    }\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/actions/InvokeHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistryService, Application } from '@plexus-interop/metadata';\nimport { GenericClientApi } from '@plexus-interop/client';\nimport { Method, InvokeResult } from '../api/client-api';\nimport { isMethod } from '../types';\nimport { getProvidedMethodByAlias, getAppAliasById } from '../metadata';\nimport { GenericRequest } from '@plexus-interop/client-api';\nimport { DiscoverMethodHandler } from './DiscoverMethodHandler';\nimport { PartialPeerDescriptor } from '../PartialPeerDescriptor';\n\nexport class InvokeHandler {\n\n    public constructor(\n        private readonly registryService: InteropRegistryService,\n        private readonly genericClienApi: GenericClientApi,\n        private readonly app: Application\n    ) { }\n\n    public async handle(method: string | Method, args?: any): Promise<InvokeResult> {\n\n        const methodAlias: string = isMethod(method) ? method.name : method;\n        const providedMethod = getProvidedMethodByAlias(methodAlias, this.registryService, this.app);\n        const requestType = providedMethod.method.requestMessage.id;\n        const responseType = providedMethod.method.responseMessage.id;\n        let requestInfo: GenericRequest;\n        try {\n            requestInfo = await new DiscoverMethodHandler(this.registryService, this.genericClienApi, this.app)\n                .findOnlineRequestInfo(method);    \n        } catch (error) {\n            if (methodAlias.startsWith('open-')) {\n                // try offline discovery for 'open' invocations\n                requestInfo = await new DiscoverMethodHandler(this.registryService, this.genericClienApi, this.app)\n                    .findOfflineRequestInfo(method);\n            } else {\n                throw error;\n            }\n        }\n        \n        const providerId = providedMethod.providedService.application.id;\n        \n        return new Promise<InvokeResult>((resolve, reject) => {\n            this.genericClienApi.sendUnaryRequest(requestInfo, args, {\n                value: v => resolve({\n                    result: v,\n                    arguments: args,\n                    method: {\n                        name: methodAlias,\n                        peer: new PartialPeerDescriptor(\n                            getAppAliasById(providerId, this.registryService) || providerId,\n                            providerId)\n                    }\n                }),\n                error: e => reject(e)\n            }, requestType, responseType);\n        });\n    }\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/actions/SubscribeHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistryService, Application } from '@plexus-interop/metadata';\nimport { GenericClientApi } from '@plexus-interop/client';\nimport { Method, StreamObserver, StreamSubscription } from '../api/client-api';\nimport { isMethod } from '../types';\nimport { getProvidedMethodByAlias, toMethodDefinition } from '../metadata';\nimport { GenericRequest } from '@plexus-interop/client-api';\nimport { DiscoverMethodHandler } from './DiscoverMethodHandler';\n\nexport class SubscribeHandler {\n\n    public constructor(\n        private readonly registryService: InteropRegistryService,\n        private readonly genericClienApi: GenericClientApi,\n        private readonly app: Application\n    ) { }\n\n    public async handle(method: string | Method, observer: StreamObserver, args?: any): Promise<StreamSubscription> {\n        \n        const asyncNop = async () => {};\n        observer.next = observer.next || asyncNop;\n        observer.error = observer.error || asyncNop;\n        observer.completed = observer.completed || asyncNop;\n\n        const methodAlias: string = isMethod(method) ? method.name : method;\n        const providedMethod = getProvidedMethodByAlias(methodAlias, this.registryService, this.app);\n        const requestType = providedMethod.method.requestMessage.id;\n        const responseType = providedMethod.method.responseMessage.id;\n\n        const requestInfo: GenericRequest =\n            await new DiscoverMethodHandler(this.registryService, this.genericClienApi, this.app)\n                .findOnlineRequestInfo(method);\n\n        const invocation = await this.genericClienApi.sendServerStreamingRequest(requestInfo, args, {\n            next: v => observer.next(v),\n            error: e => observer.error(e),\n            streamCompleted: () => observer.completed(),\n            complete: () => { }\n        }, requestType, responseType);\n\n        return {\n            arguments: args,\n            unsubscribe: () => invocation.cancel(),\n            stream: toMethodDefinition(providedMethod)\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/api/InteropPlatformFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropPlatform } from '.';\nimport { PlexusInteropPlatform } from '../PlexusInteropPlatform';\n\nexport interface InteropPlatformConfig {\n    webSocketUrl: string;\n}\n\nexport class InteropPlatformFactory {\n\n    public createPlatform(config: InteropPlatformConfig): InteropPlatform {\n        return new PlexusInteropPlatform(config);\n    }\n\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/api/client-api.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// tslint:disable\n/**\n* Copyright © 2014-2018 Tick42 BG OOD, Deutsche Bank AG\n* SPDX-License-Identifier: Apache-2.0\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*     http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n// tslint:disable\n/**\n * Used to instantiate an InteropPeer.\n * An application will typically create one InteropPlatform instance per Platform (e.g. 'Glue42', 'Plexus Interop', etc.) that it wishes\n * to work with.\n * This API does not discuss how instances are created.\n * @todo: Consider how to deal with the authentication. Some platforms may do the user name/password prompt, it could be contained\n *        inside the config.\n *        Also the sign-on/security token that MAY be available after a successful connect() could be useful elsewhere so might belong\n *        in the InteropPeer.ApplicationInstance, but again that is not currently discussed.\n *        It is expected that as implementations are created for the API, a consensus will emerge about how to handle this and the spec\n *        might update.\n */\nexport interface InteropPlatform {\n    type: string;                       // Specifies the platform type (e.g. 'Glue42', 'Plexus Interop', etc.).\n    version: string;                    // The version of the platform.\n\n    /**\n     * @param  {InteropFeature}     feature       Identifies an interop feature.\n     * \n     * @return {boolean}                          Boolean indicating whether the given feature is supported.\n     */\n    isFeatureSupported(feature: InteropFeature): boolean;\n\n    /**\n     * @param  {string}                       applicationName       Name of the application participating in interop.\n     * @param  {string}                       apiMetadata           Publishes metadata which describes API implemented by the app\n     *                                                              in proto3 syntax (https://developers.google.com/protocol-buffers/docs/proto3)\n     *                                                              to help dev tools to build swagger-like API explorers.     \n     * @param  {MethodImplementation[]}       methods               Methods registered on peer creation.\n     *                                                              The InteropPeer can later register more methods.\n     * @param  {StreamImplementation[]}       streams               Streams registered on peer creation.\n     *                                                              The InteropPeer can later register more streams.\n     * @return {Promise<InteropPeer>}                               The InteropPeer which represents application connection to interop platform (InteropPeerDescriptor)\n     *                                                              and is used to participate in the interop communication (InteropClient, InteropServer).\n     *                                                              Application can create as many connections as it wish, interop platform will assign \n     *                                                              unique id for each to distinguish them.\n     */\n    connect(\n        applicationName: string,\n        apiMetadata?: string,\n        methods?: MethodImplementation[],\n        streams?: StreamImplementation[]\n    ): Promise<InteropPeer>;\n\n    getPeerDefinitions(): Promise<InteropPeerDefinition[]>;\n\n}\n\nexport enum InteropFeature {\n    InvokeMethod = \"InvokeMethod\",\n    SubscribeStream = \"SubscribeStream\",\n    RegisterMethod = \"RegisterMethod\",\n    RegisterMethodOnConnect = \"RegisterMethodOnConnect\",\n    RegisterStream = \"RegisterStream\",\n    RegisterStreamOnConnect = \"RegisterStreamOnConnect\",\n    DiscoverPeers = \"DiscoverPeers\",\n    DiscoverMethods = \"DiscoverMethods\",\n    DiscoverStreams = \"DiscoverStreams\",\n    ListenPeerConnected = \"ListenPeerConnected\",\n    ListenMethodRegistered = \"ListenMethodRegistered\",\n    ListenStreamRegistered = \"ListenStreamRegistered\"\n}\n\nexport interface InteropPeer extends InteropClient, InteropServer, InteropPeerDescriptor {\n\n    connectionStatus: ConnectionStatus; // Shows the current connection status of the peer.\n\n    /**\n     * @param  {ConnectionStatus) => void}        callback Event listener, called whenever the connection status changes (all events get\n     *                                                     replayed on subscription).\n     * @return {UnsubscribeFunction}                       Function used to unsubscribe the event listener.\n     */\n    onConnectionStatusChanged(\n        callback: (status: ConnectionStatus) => void\n    ): Subscription;\n\n    /**\n     * @return {Promise<void>} Promise that resolves when the peer is disconnected.\n     */\n    disconnect(): Promise<void>;\n\n    /**\n     * @param  {(Error) => void}     callback     Callback which is called whenever the peer disconnected. \n     *                                            Error argument might be passed in the cases disconnect caused by an error.\n     * @return {Subscription}                     Object used to unsubscribe the event listener.\n     */\n    onDisconnected(\n        callback: (error?: Error) => void\n    ): Subscription;\n}\n\n/**\n * Specifies the Peer's connection statuses.\n * State diagram:\n+---------------------------------------------+\n|                                             |\n| Disconnected+---->Connecting+---->Connected |\n|      ^                +               +     |\n|      |                |               |     |\n|      ^----------------+               |     |\n|      |                                |     |\n|      +                                |     |\n| Disconnecting<------------------------+     |\n|                                             |\n+---------------------------------------------+\n */\nexport enum ConnectionStatus {\n    Connecting = \"Connecting\",          /* A connection request has been started via a call to connect() but the connection has not\n                                           yet been completed. */\n    Connected = \"Connected\",            // Connected to the Platform. All data should be up to date.\n    Disconnecting = \"Disconnecting\",    /* A disconnect request has been made. Methods' invocation/registration don't work, but the\n                                           disconnect has not yet been completed. */\n    Disconnected = \"Disconnected\",      // The platform is disconnected.\n}\n\n/**\n * A container for the 'Client' functionality.\n */\nexport interface InteropClient {\n    /**\n     * @param  {string                 |       Method}      method  The name of the method or the method instance to be invoked.\n     * @param  {any}                                        args    An object containing the arguments to be used for the invocation.\n     * @return {Promise<InvokeResult>}                              Outcome of the method invocation, containing the result, caller and\n     *                                                              other information.\n     */\n    invoke(method: string | Method, args?: any): Promise<InvokeResult>;\n\n    /**\n     * @param  {string                         |    Stream}      stream   The name of the stream or the stream instance to subscribe to.\n     * @param  {StreamObserver}                                  observer An object which will be notified on stream events.\n     * @param  {any}                                             args     An object containing the arguments to be used for the subscription.\n     * @return {Promise<StreamSubscription>}                     StreamSubscription containing the subscription details and unsubscribe method.\n     */\n    subscribe(\n        stream: string | Stream,\n        observer: StreamObserver,\n        args?: any): Promise<StreamSubscription>;\n\n    /**\n     * @return {Promise<InteropPeerDescriptor[]>} List of all the peers currently participating in the interop communication.\n     */\n    discoverPeers(): Promise<InteropPeerDescriptor[]>;\n\n    /**\n     * @return {Promise<Method[]>} List of all the currently registered methods.\n     *                             Can be used to discover methods.\n     */\n    discoverMethods(): Promise<Method[]>;\n\n    /**\n     * @return {Promise<Stream[]>} List of all the currently registered streams.\n     *                             Can be used to discover streams.\n     */\n    discoverStreams(): Promise<Stream[]>;\n\n    /**\n     * @param  {Method)          => void}        callback Event listener, called whenever a method is registered by a server.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onMethodRegistered(callback: (method: Method) => void): Subscription;\n\n    /**\n     * @param  {Method)          => void}        callback Event listener, called whenever a method is unregistered by a server.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onMethodUnregistered(callback: (method: Method) => void): Subscription;\n\n    /**\n     * @param  {Stream)          => void}        callback Event listener, called whenever a stream is registered by a server.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onStreamRegistered(callback: (stream: Stream) => void): Subscription;\n\n    /**\n     * @param  {Stream)          => void}        callback Event listener, called whenever a stream is closed by a server.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onStreamUnregistered(callback: (stream: Stream) => void): Subscription;\n\n    /**\n     * @param  {InteropPeerDescriptor) => void}        callback Event listener, called whenever a new peer is connected.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onPeerConnected(callback: (peer: InteropPeerDescriptor) => void): Subscription;\n\n    /**\n     * @param  {InteropPeerDescriptor) => void}        callback Event listener, called whenever a peer is disconnected.\n     * @return {Subscription}                    Subscription object which can be used to unsubscribe the event listener.\n     */\n    onPeerDisconnected(callback: (peer: InteropPeerDescriptor) => void): Subscription;\n}\n\n/**\n * Invocation result object returned after a successful method invocation.\n */\nexport interface InvokeResult {\n    method: Method;                     // Identifies the method that was executed as well as the peer that registered/executed it.\n    arguments?: any;                    // An object containing the arguments used for the invocation.  \n    result?: any;                       // Result of the method invocation.\n}\n\n/**\n * An InteropClient's stream subscription.\n */\nexport interface StreamSubscription extends Subscription {\n    arguments?: object;                 // An object containing the arguments used for the subscription.\n    stream: Stream;                     // Reference to the stream that the subscription is to.\n}\n\n/**\n * A container for the 'Server' functionality.\n */\nexport interface InteropServer {\n    /**\n     * @param  {MethodImplementation} methodImplementation Method implementation, specifying the method's name, properties and invocation\n     *                                                     handler.\n     * @return {Promise<RegisteredMethod>}                 Method object containing the method's details and function to unregister the method implementation.\n     */\n    register(methodImplementation: MethodImplementation): Promise<RegisteredMethod>;\n\n    /**\n     * @param  {StreamImplementation} streamImplementation Stream implementation, specifying the stream's name, properties and subscription\n     *                                                     handlers. The stream can be closed (unregistered) by calling close() on the\n     *                                                     ServerStream instance.\n     * @return {Promise<RegisteredStream>}                 RegisteredStream object containing the stream's details and function to unregisted the stream implementation.\n     */\n    registerStream(streamImplementation: StreamImplementation): Promise<RegisteredStream>;\n\n    /**\n     * Publishes metadata which describes API implemented by the app\n     * in proto3 syntax (https://developers.google.com/protocol-buffers/docs/proto3)\n     * to help dev tools to build swagger-like API explorers.\n     */\n    publishApiMetadata(apiMetadata: string): Promise<void>;\n}\n\n/**\n * @type Specifies an unsubscribe function used to unsubscribe event listeners.\n */\nexport interface Subscription {\n    /**\n    * @return {Promise<void>} Promise that resolves when the subscription successfully closed.\n    */\n    unsubscribe(): Promise<void>;\n}\n\nexport interface InteropPeerDefinition {\n    applicationName: string;     // The name of the application.\n}\n\n/**\n * Reference to a connected instance of a peer or launchable application.\n */\nexport interface InteropPeerDescriptor extends InteropPeerDefinition {\n    isConnected: boolean;        // Shows the current connection status of the peer.\n    id: string;                  /* Platform specific id.\n                                    Unique for an InteropPeerInstance connected to the platform. Null for launchable app.\n                                    Some platforms may change the id following a disconnect/reconnect. */\n\n    /**\n     * Returns metadata describing API implemented by the application\n     * in proto3 syntax (https://developers.google.com/protocol-buffers/docs/proto3).\n     * Can be used by dev tools to implement swagger-like API explorers.\n     */\n    getApiMetadata(): Promise<string>;\n\n    /**\n     * Notifies when application changed the published API metadata.\n     */\n    onApiMetadataChanged(callback: (metadata: string) => void): void;\n}\n\n/**\n * Describes the attributes of a method.\n */\nexport interface MethodDefinition {\n    name: string;                       // The name of the method.\n    acceptType?: string,                // Optional property specifying the accepted object type ID for e.g. FINOS FDC3 Context, FINOS FInancial object and/or OpenFIGI.\n    returnType?: string,                // Optional property specifying the returned object type ID for e.g. FINOS FDC3 Context, FINOS FInancial object and/or OpenFIGI.\n\n    /**\n     * @param  {any}                        context   Object containing intent data.\n     *\n     * @return {Promise<boolean>}                     Method object containing the method's details and function to unregister the method implementation.\n     */\n    accepts?(context: any): Promise<boolean>;  /* Function checks whether the method can handle the given intent context. \n                                                  Is handled by either Interop Platform or by the peer which registered the method.\n                                                */\n\n    /**\n     * Hints from a method 'publisher' on how the method could be displayed in a UI.\n     * This is expected to dovetail with the FINOS FDC3 Intents capability.\n     */\n    displayName?: string;                             // User friendly name to present the method to a user in a UI.\n    tooltip?: string;                                 // Tooltip to describe the method.  \n    intent?: MethodIntent[];            // MethodIntents that the Method satisfies, typically there will be 0 or 1.\n}\n\n/**\n * A reference to a method available to be invoked, i.e. it is being offered by a server.\n */\nexport interface Method extends MethodDefinition {\n    peer: InteropPeerDescriptor;                       // Identifies the peer that registered the method.\n}\n\nexport interface RegisteredMethod extends Method {\n    unregister: () => Promise<void>;\n}\n\nexport type StreamDefinition = MethodDefinition;\nexport type Stream = Method;\nexport type RegisteredStream = RegisteredMethod;\n\nexport interface MethodHandler {\n    /**\n     * @param  {any}              args                  An object containing the arguments used for the invocation.\n     * @param  {InteropPeerDescriptor} caller          A reference to the peer that invoked the method.\n     * @return {Promise<any>}                          Result of the method invocation, that is then sent to the client wrapped inside of\n     *                                                 an InvokeResult.\n     */\n    onInvoke(args: any, caller: InteropPeerDescriptor): Promise<any>;\n}\n\n/**\n * Defines a method including the handler that is being registered.\n */\nexport interface MethodImplementation extends MethodDefinition, MethodHandler {\n}\n\nexport interface StreamHandler {\n\n    /**\n     * @param  {StreamObserver} observer               Observer object subscribing to the stream.\n     * @param  {InteropPeerDescriptor} caller          A reference to the peer that invoked the method.\n     * @param  {any}              args                 An object containing the arguments used for the subscription.\n     * @return {Promise<Subscription>}                 Subscription instance. Its unsubscribe method will be called \n     *                                                 when the caller closed subscription or disconnected.\n     */\n    onSubscriptionRequested(observer: StreamObserver, caller: InteropPeerDescriptor, args?: any): Promise<Subscription>;\n}\n\n/**\n * Defines a stream including the handler that is being registered.\n */\nexport interface StreamImplementation extends StreamDefinition, StreamHandler {\n}\n\n/**\n * Defines observer of a stream.\n * \n * Client (stream consumer) provides implementation of this export interface to listen the called stream.\n * \n * Server (stream producer) receives an object implementing this export interface and calls its methods \n * to push new items or to complete the stream.\n */\nexport interface StreamObserver {\n\n    /** \n     * On client side this method is called for each new received item.\n     * \n     * On server side calling this method pushes new item to the stream.\n     * \n     * @param  {any} data                   On client side: received stream item.\n     *                                      On server side: item to push into the stream.\n     * \n     * @return {Promise<void>}              Client should return promise which will be resolved as soon as item is handled.\n     *                                      Server receives promise which will be resolved as soon as interop platform \n     *                                      accepted the new item (doesn't mean it was received by subscriber!).\n     *                                      \n    */\n    next: (data: any) => Promise<void>;\n\n    /** \n     * On client side this method is called when stream is completed.\n     * \n     * On server side calling this method completes the stream. \n     * Observer won't accept any further items after calling this method.\n     * \n     * @return {Promise<void>}              Client should return promise which will be resolved \n     *                                      as soon as completion notification is handled.\n     *                                      Server receives promise which will be resolved as soon as all the items \n     *                                      are sent to the caller and stream completed.\n     *                                      \n    */\n    completed: () => Promise<void>;\n\n    /** \n     * On client side this method is called when stream is completed because of an error.\n     * \n     * On server side calling this method completes the stream with an error. \n     * Stream won't accept any further items after calling this method.\n     * \n     * @param  {Error} error                On client side: object representing error.\n     *                                      On server side: error to send.\n     * \n     * @return {Promise<void>}              Client should return promise which will be resolved \n     *                                      as soon as error notification is handled.\n     *                                      Server receives promise which will be resolved as soon as all the items \n     *                                      are sent to the caller and stream completed.\n     *                                      \n    */\n    error: (error: Error) => Promise<void>;\n}\n\n/**\n * Typically an application that implements an Intent does it by publishing an Interop method to implement the Intent.\n * This export interface provides a way that Method publishers can record the Intent capabilities of each method.\n * This is in addition to the Intent publishing capability allowed in application definitions such as the\n * FINOS FDC3 Application definition.\n */\nexport interface MethodIntent {\n    name: string;                       // Required. The name of the Intent.\n    contexts?: string;                  /* Optional 'context' which define when this method is able to implement the Intent.\n                                         This should be thought of as 'restrictions' on the scope of a method.\n                                         For example there might be a restriction to say the Intent can only be delivered for exchange traded equities. */\n}\n"
  },
  {
    "path": "web/packages/common-api-impl/src/api/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './client-api';\nexport * from './InteropPlatformFactory';"
  },
  {
    "path": "web/packages/common-api-impl/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './api';"
  },
  {
    "path": "web/packages/common-api-impl/src/listeners.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionStatus, Subscription } from './api/client-api';\nimport { LoggerFactory, Logger } from '@plexus-interop/common';\n\nconst logger: Logger = LoggerFactory.getLogger('PeerListener');\n\nexport class GenericListenerHolder<T> {\n    \n    private listeners: Array<(update: T) => void> = [];\n    \n    public addListener(callback: (update: T) => void): Subscription {\n        this.listeners.push(callback);\n        return {\n            unsubscribe: async () => this.removeListener(callback)\n        };\n    }    \n\n    public notifyListeners(update: T): void {\n        this.listeners.forEach(l => {\n            try {\n                l(update);\n            } catch (error) {\n                logger.warn('Listener raised error', error);\n            }\n        });\n    }\n\n    public reset(): void {\n        this.listeners.length = 0;\n    \n    }\n\n    private removeListener(callback: (update: T) => void): void {\n        this.listeners = this.listeners.filter(l => l !== callback);\n    }\n}\n\nexport class ConnectionStatusListeners extends GenericListenerHolder<ConnectionStatus> {}\nexport class ErrorListeners extends GenericListenerHolder<Error> {}"
  },
  {
    "path": "web/packages/common-api-impl/src/metadata.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Application, InteropRegistryService, ProvidedMethod, ConsumedMethodReference } from '@plexus-interop/metadata';\nimport { Method } from './api/client-api';\nimport { PartialPeerDescriptor } from './PartialPeerDescriptor';\nimport { Option } from '@plexus-interop/metadata';\n\nconst isAliasOption = (o: Option) => o.id.endsWith('alias');\n\nexport function getProvidedMethodByAlias(actionAlias: string, registryService: InteropRegistryService, consumerAppMetadata?: Application): ProvidedMethod {\n    const methods = !!consumerAppMetadata ?\n        registryService.getMatchingProvidedMethodsForApp(consumerAppMetadata)\n        : registryService.getProvidedMethods();\n    const provideMethod = methods.find(pm => !!pm.options && !!pm.options.find(o => isAliasOption(o) && o.value === actionAlias));\n    if (!provideMethod) {\n        throw new Error(`Provided Method not found for ${actionAlias}`);\n    }\n    return provideMethod;\n}\n\nexport function getAppAliasById(appId: string, registryService: InteropRegistryService): string | undefined {\n    const app = registryService.getApplication(appId);\n    return getAlias(app.options);\n}\n\nexport function toConsumedMethodRef(providedMethod: ProvidedMethod): ConsumedMethodReference {\n    return {\n        consumedService: {\n            serviceId: providedMethod.providedService.service.id,\n            serviceAlias: providedMethod.providedService.service.serviceAlias\n        },\n        methodId: providedMethod.method.name\n    };\n}\n\nexport function toMethodDefinition(providedMethod: ProvidedMethod): Method {\n    return {\n        name: providedMethod.method.name,\n        peer: new PartialPeerDescriptor(\n            providedMethod.providedService.application.id,\n            providedMethod.providedService.application.id,\n            false)\n    };\n}\n\nexport function getAlias(options?: Option[]): string | undefined {\n    if (!!options) {\n        const option = options.find(isAliasOption);\n        if (option) {\n            return option.value;\n        }\n    }\n    return undefined;\n}\n"
  },
  {
    "path": "web/packages/common-api-impl/src/registration.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodImplementation, StreamImplementation } from './api/client-api';\nimport { InteropRegistryService } from '@plexus-interop/metadata';\nimport { GenericClientApiBuilder, MethodInvocationContext, StreamingInvocationClient } from '@plexus-interop/client';\nimport { getProvidedMethodByAlias, getAppAliasById } from './metadata';\nimport { PartialPeerDescriptor } from './PartialPeerDescriptor';\nimport { ClientError } from '@plexus-interop/protocol';\n\nexport function registerMethod(commonApiMethod: MethodImplementation, clientBuilder: GenericClientApiBuilder, registryService: InteropRegistryService): void {\n    const providedMethod = getProvidedMethodByAlias(commonApiMethod.name, registryService);\n    const requestType = providedMethod.method.requestMessage.id;\n    const responseType = providedMethod.method.responseMessage.id;\n    clientBuilder.withTypeAwareUnaryHandler({\n        serviceInfo: {\n            serviceId: providedMethod.providedService.service.id,\n            serviceAlias: providedMethod.providedService.alias\n        },\n        methodId: providedMethod.method.name,\n        handle: async (invocationContext: MethodInvocationContext, request: any): Promise<any> => {\n            const appId = invocationContext.consumerApplicationId;\n            const response = await (commonApiMethod.onInvoke(request, new PartialPeerDescriptor(\n                getAppAliasById(appId, registryService) || appId,\n                appId\n            )) /* Return empty result if no response received */ || Promise.resolve({}));\n            return response;\n        }\n    }, requestType, responseType);\n}\n\nexport function registerStream(commonApiStream: StreamImplementation, clientBuilder: GenericClientApiBuilder, registryService: InteropRegistryService): void {\n    const providedMethod = getProvidedMethodByAlias(commonApiStream.name, registryService);\n    const requestType = providedMethod.method.requestMessage.id;\n    const responseType = providedMethod.method.responseMessage.id;\n    clientBuilder.withTypeAwareServerStreamingHandler({\n        serviceInfo: {\n            serviceId: providedMethod.providedService.service.id,\n            serviceAlias: providedMethod.providedService.alias\n        },\n        methodId: providedMethod.method.name,\n        handle: (invocationContext: MethodInvocationContext, request: any, invocationHostClient: StreamingInvocationClient<any>): void => {\n            const appId = invocationContext.consumerApplicationId;\n            const consumerPeer = new PartialPeerDescriptor(\n                getAppAliasById(appId, registryService) || appId,\n                appId\n            );\n            const subscriptionPromise = commonApiStream.onSubscriptionRequested({\n                next: async v => invocationHostClient.next(v),\n                error: async e => invocationHostClient.error(new ClientError(e.message, e.stack)),\n                completed: async () => invocationHostClient.complete()\n            }, consumerPeer, request);\n            if (subscriptionPromise) {\n                subscriptionPromise.then(subscription => {\n                    invocationContext.cancellationToken.onCancel(() => subscription.unsubscribe());\n                })\n                    .catch(e => invocationHostClient.error(new ClientError(e.message, e.stack)));\n            }\n        }\n    }, requestType, responseType);\n}"
  },
  {
    "path": "web/packages/common-api-impl/src/types.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Method } from './api/client-api';\n\nexport function isMethod(m: Method | string): m is Method {\n    return !!(m as Method).peer;\n}"
  },
  {
    "path": "web/packages/common-api-impl/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noUnusedLocals\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/common-api-impl/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/e2e/gen-metadata.cmd",
    "content": "call plexus gen-json-meta -b metadata/interop -o metadata\ncall plexus gen-ts -b metadata/interop -i echo_client.interop -o src/echo/client\ncall plexus gen-ts -b metadata/interop -i echo_server.interop -o src/echo/server\n"
  },
  {
    "path": "web/packages/e2e/karma.conf.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Karma configuration\n// Generated on Fri Dec 29 2017 15:31:22 GMT+0300 (Russia TZ 2 Standard Time)\n\nmodule.exports = function (config) {\n  config.set({\n\n    client: { \n        // pass dynamic param to test\n        hostPath: config.hostPath,\n        runInParent: true,\n        useIframe: false\n    },\n\n    basePath: '',\n\n    // frameworks to use\n    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n    frameworks: ['mocha', 'browserify'],\n\n\n    // list of files / patterns to load in the browser\n    files: [\n      '../../node_modules/long/dist/long.js',\n      'scripts/karma-*.js',\n      'dist/main/tests/web/*.spec.js',\n      'dist/main/src/polyfills.js'\n    ],\n\n    // list of files to exclude\n    exclude: [\n      'dist/main/tests/web/*Streaming.spec.js'\n    ],\n\n    // preprocess matching files before serving them to the browser\n    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor\n    preprocessors: {\n      'dist/main/tests/web/*.spec.js': ['browserify'],\n      'scripts/karma-*.js': ['browserify'],\n      'dist/main/src/polyfills.js': ['browserify']\n    },\n\n    browserify: {\n      debug: true\n    },\n\n    // test results reporter to use\n    // possible values: 'dots', 'progress'\n    // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n    // reporters: ['progress', \"mocha\"],\n    reporters: ['progress', 'mocha'],\n\n\n    // web server port\n    port: 9876,\n\n\n    // enable / disable colors in the output (reporters and logs)\n    colors: true,\n\n\n    // level of logging\n    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n    logLevel: config.LOG_DEBUG,\n\n\n    // enable / disable watching file and executing tests whenever any file changes\n    autoWatch: false,\n\n\n    // start these browsers\n    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher\n    browsers: ['Chrome', 'IE_no_addons'],\n\n    customLaunchers: {\n      IE_no_addons: {\n        base: 'IE',\n        flags: ['-extoff']\n      }\n    },\n\n    // Continuous Integration mode\n    // if true, Karma captures browsers, runs the tests and exits\n    singleRun: true,\n\n    // Concurrency level\n    // how many browser should be started simultaneous\n    concurrency: Infinity\n  })\n}\n"
  },
  {
    "path": "web/packages/e2e/metadata/apps.json",
    "content": "﻿{\n  \"apps\": [\n    {\n      \"id\": \"plexus.interop.testing.TestAppLauncher\",\n      \"displayName\": \"Test App Launcher\"\n    },\n    {\n      \"id\": \"plexus.interop.testing.EchoServer\",\n      \"displayName\": \"Test Echo Server\",\n      \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n      \"launcherParams\": {}\n    },\n    {\n      \"id\": \"plexus.interop.testing.EchoClient\",\n      \"displayName\": \"Test Echo Client\",\n      \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n      \"launcherParams\": {}\n    }\n  ]\n}"
  },
  {
    "path": "web/packages/e2e/metadata/interop/plexus/interop/testing/echo_client.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"plexus/interop/testing/echo_service.proto\";\n\npackage plexus.interop.testing;\n\napplication EchoClient {\n\tconsumes plexus.interop.testing.EchoService from plexus.interop.testing.* { Unary; ServerStreaming; ClientStreaming; DuplexStreaming; }\n\tconsumes plexus.interop.testing.EchoService as ServiceAlias from plexus.interop.testing.* { Unary; }\n}\n"
  },
  {
    "path": "web/packages/e2e/metadata/interop/plexus/interop/testing/echo_server.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"plexus/interop/testing/echo_service.proto\";\n\npackage plexus.interop.testing;\n\napplication EchoServer {\n\tprovides plexus.interop.testing.EchoService to plexus.interop.testing.* {\n\t\toption title = \"Sample Echo Service\";\n\t\tUnary [title = \"Sample Unary Method\"];\n\t\tServerStreaming [title = \"Sample Server Streaming Method\"];\n\t\tClientStreaming [title = \"Sample Client Streaming Method\"];\n\t\tDuplexStreaming [title = \"Sample Duplex Streaming Method\"];\n\t}\n}\n"
  },
  {
    "path": "web/packages/e2e/metadata/interop/plexus/interop/testing/echo_service.proto",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nsyntax = \"proto3\";\n\npackage plexus.interop.testing;\n\nservice EchoService {\n\trpc Unary (EchoRequest) returns (EchoRequest);\n\trpc ServerStreaming (EchoRequest) returns (stream EchoRequest);\n\trpc ClientStreaming (stream EchoRequest) returns (EchoRequest);\n\trpc DuplexStreaming (stream EchoRequest) returns (stream EchoRequest);\n}\n\nmessage EchoRequest {\n\tstring string_field = 1;\n\tint64 int64_field = 2;\n\tuint32 uint32_field = 3;\n\trepeated double repeated_double_field = 4;\n\tSubEnum enum_field = 5;\n\tSubMessage sub_message_field = 6;\n\trepeated SubMessage repeated_sub_message_field = 7;\n\n\tmessage SubMessage {\n\t\tbytes bytes_field = 1;\n\t\tstring string_field = 2;\n\t}\n\n\tenum SubEnum {\n\t\tVALUE_ONE = 0;\n\t\tVALUE_TWO = 1;\n\t}\n}"
  },
  {
    "path": "web/packages/e2e/metadata/interop/plexus/interop/testing/test_app_launcher.interop",
    "content": "//\n// Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n// SPDX-License-Identifier: Apache-2.0\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport \"interop/app_launcher_service.proto\";\n\npackage plexus.interop.testing;\n\napplication TestAppLauncher {\n\n\tprovides .interop.AppLauncherService to interop.AppLifecycleManager { Launch; }\n}"
  },
  {
    "path": "web/packages/e2e/metadata/interop.json",
    "content": "{\n\t\"messages\": {\n\t  \"nested\": {\n\t    \"google\": {\n\t      \"nested\": {\n\t        \"protobuf\": {\n\t          \"options\": {\n\t            \"go_package\": \"github.com/golang/protobuf/ptypes/empty\",\n\t            \"java_package\": \"com.google.protobuf\",\n\t            \"java_outer_classname\": \"EmptyProto\",\n\t            \"csharp_namespace\": \"Google.Protobuf.WellKnownTypes\",\n\t            \"objc_class_prefix\": \"GPB\",\n\t            \"optimize_for\": \"SPEED\",\n\t            \"java_multiple_files\": true,\n\t            \"cc_enable_arenas\": true\n\t          },\n\t          \"nested\": {\n\t            \"FileDescriptorSet\": {\n\t              \"fields\": {\n\t                \"file\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FileDescriptorProto\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"FileDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"package\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"dependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"publicDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"weakDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 11,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"messageType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 5\n\t                },\n\t                \"service\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ServiceDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 7\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FileOptions\",\n\t                  \"id\": 8\n\t                },\n\t                \"sourceCodeInfo\": {\n\t                  \"type\": \"SourceCodeInfo\",\n\t                  \"id\": 9\n\t                },\n\t                \"syntax\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 12\n\t                }\n\t              }\n\t            },\n\t            \"DescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"field\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"nestedType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 3\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"extensionRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ExtensionRange\",\n\t                  \"id\": 5\n\t                },\n\t                \"oneofDecl\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"OneofDescriptorProto\",\n\t                  \"id\": 8\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MessageOptions\",\n\t                  \"id\": 7\n\t                },\n\t                \"reservedRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ReservedRange\",\n\t                  \"id\": 9\n\t                },\n\t                \"reservedName\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"ExtensionRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"options\": {\n\t                      \"type\": \"ExtensionRangeOptions\",\n\t                      \"id\": 3\n\t                    }\n\t                  }\n\t                },\n\t                \"ReservedRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"ExtensionRangeOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 3\n\t                },\n\t                \"label\": {\n\t                  \"type\": \"Label\",\n\t                  \"id\": 4\n\t                },\n\t                \"type\": {\n\t                  \"type\": \"Type\",\n\t                  \"id\": 5\n\t                },\n\t                \"typeName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 6\n\t                },\n\t                \"extendee\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"defaultValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 7\n\t                },\n\t                \"oneofIndex\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 9\n\t                },\n\t                \"jsonName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FieldOptions\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Type\": {\n\t                  \"values\": {\n\t                    \"TYPE_DOUBLE\": 1,\n\t                    \"TYPE_FLOAT\": 2,\n\t                    \"TYPE_INT64\": 3,\n\t                    \"TYPE_UINT64\": 4,\n\t                    \"TYPE_INT32\": 5,\n\t                    \"TYPE_FIXED64\": 6,\n\t                    \"TYPE_FIXED32\": 7,\n\t                    \"TYPE_BOOL\": 8,\n\t                    \"TYPE_STRING\": 9,\n\t                    \"TYPE_GROUP\": 10,\n\t                    \"TYPE_MESSAGE\": 11,\n\t                    \"TYPE_BYTES\": 12,\n\t                    \"TYPE_UINT32\": 13,\n\t                    \"TYPE_ENUM\": 14,\n\t                    \"TYPE_SFIXED32\": 15,\n\t                    \"TYPE_SFIXED64\": 16,\n\t                    \"TYPE_SINT32\": 17,\n\t                    \"TYPE_SINT64\": 18\n\t                  }\n\t                },\n\t                \"Label\": {\n\t                  \"values\": {\n\t                    \"LABEL_OPTIONAL\": 1,\n\t                    \"LABEL_REQUIRED\": 2,\n\t                    \"LABEL_REPEATED\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"OneofOptions\",\n\t                  \"id\": 2\n\t                }\n\t              }\n\t            },\n\t            \"EnumDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"value\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumValueDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"EnumValueDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumValueOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"ServiceDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"method\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"MethodDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"ServiceOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"MethodDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"inputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"outputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MethodOptions\",\n\t                  \"id\": 4\n\t                },\n\t                \"clientStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"serverStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"FileOptions\": {\n\t              \"fields\": {\n\t                \"javaPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"javaOuterClassname\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                },\n\t                \"javaMultipleFiles\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenerateEqualsAndHash\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 20,\n\t                  \"options\": {\n\t                    \"deprecated\": true\n\t                  }\n\t                },\n\t                \"javaStringCheckUtf8\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 27,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"optimizeFor\": {\n\t                  \"type\": \"OptimizeMode\",\n\t                  \"id\": 9,\n\t                  \"options\": {\n\t                    \"default\": \"SPEED\"\n\t                  }\n\t                },\n\t                \"goPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 11\n\t                },\n\t                \"ccGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 16,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 17,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"pyGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 18,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"phpGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 19,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 23,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"ccEnableArenas\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 31,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"objcClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 36\n\t                },\n\t                \"csharpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 37\n\t                },\n\t                \"swiftPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 39\n\t                },\n\t                \"phpClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 40\n\t                },\n\t                \"phpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 41\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  38,\n\t                  38\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"OptimizeMode\": {\n\t                  \"values\": {\n\t                    \"SPEED\": 1,\n\t                    \"CODE_SIZE\": 2,\n\t                    \"LITE_RUNTIME\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"MessageOptions\": {\n\t              \"fields\": {\n\t                \"messageSetWireFormat\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"noStandardDescriptorAccessor\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"mapEntry\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 7\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  8,\n\t                  8\n\t                ],\n\t                [\n\t                  9,\n\t                  9\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldOptions\": {\n\t              \"fields\": {\n\t                \"ctype\": {\n\t                  \"type\": \"CType\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": \"STRING\"\n\t                  }\n\t                },\n\t                \"packed\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"jstype\": {\n\t                  \"type\": \"JSType\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": \"JS_NORMAL\"\n\t                  }\n\t                },\n\t                \"lazy\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"weak\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  4,\n\t                  4\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"CType\": {\n\t                  \"values\": {\n\t                    \"STRING\": 0,\n\t                    \"CORD\": 1,\n\t                    \"STRING_PIECE\": 2\n\t                  }\n\t                },\n\t                \"JSType\": {\n\t                  \"values\": {\n\t                    \"JS_NORMAL\": 0,\n\t                    \"JS_STRING\": 1,\n\t                    \"JS_NUMBER\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumOptions\": {\n\t              \"fields\": {\n\t                \"allowAlias\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  5,\n\t                  5\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumValueOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"ServiceOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"MethodOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"idempotencyLevel\": {\n\t                  \"type\": \"IdempotencyLevel\",\n\t                  \"id\": 34,\n\t                  \"options\": {\n\t                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"IdempotencyLevel\": {\n\t                  \"values\": {\n\t                    \"IDEMPOTENCY_UNKNOWN\": 0,\n\t                    \"NO_SIDE_EFFECTS\": 1,\n\t                    \"IDEMPOTENT\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"UninterpretedOption\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"NamePart\",\n\t                  \"id\": 2\n\t                },\n\t                \"identifierValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"positiveIntValue\": {\n\t                  \"type\": \"uint64\",\n\t                  \"id\": 4\n\t                },\n\t                \"negativeIntValue\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 5\n\t                },\n\t                \"doubleValue\": {\n\t                  \"type\": \"double\",\n\t                  \"id\": 6\n\t                },\n\t                \"stringValue\": {\n\t                  \"type\": \"bytes\",\n\t                  \"id\": 7\n\t                },\n\t                \"aggregateValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"NamePart\": {\n\t                  \"fields\": {\n\t                    \"namePart\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"isExtension\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"bool\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"SourceCodeInfo\": {\n\t              \"fields\": {\n\t                \"location\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Location\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Location\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"span\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"leadingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"trailingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"leadingDetachedComments\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 6\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GeneratedCodeInfo\": {\n\t              \"fields\": {\n\t                \"annotation\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Annotation\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Annotation\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"sourceFile\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"begin\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 4\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"Empty\": {\n\t              \"fields\": {}\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"interop\": {\n\t      \"options\": {\n\t        \"csharp_namespace\": \"plexus\"\n\t      },\n\t      \"nested\": {\n\t        \"AppLaunchMode\": {\n\t          \"values\": {\n\t            \"SINGLE_INSTANCE\": 0,\n\t            \"MULTI_INSTANCE\": 1\n\t          }\n\t        },\n\t        \"AppLauncherService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLauncherService\"\n\t          },\n\t          \"methods\": {\n\t            \"Launch\": {\n\t              \"requestType\": \"AppLaunchRequest\",\n\t              \"responseType\": \"AppLaunchResponse\"\n\t            },\n\t            \"AppLaunchedEventStream\": {\n\t              \"requestType\": \".google.protobuf.Empty\",\n\t              \"responseType\": \"AppLaunchedEvent\",\n\t              \"responseStream\": true\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchParamsJson\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"suggestedAppInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 4\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 5\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchReferrer\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchReferrer\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 2\n\t            },\n\t            \"connectionId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchedEvent\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchedEvent\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            },\n\t            \"appIds\": {\n\t              \"rule\": \"repeated\",\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"referrer\": {\n\t              \"type\": \"AppLaunchReferrer\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ApplicationOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedServiceOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedServiceOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ProvidedMethodOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"uint32\",\n\t              \"id\": 3\n\t            }\n\t          },\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ConsumedMethodOptions\": {\n\t          \"fields\": {},\n\t          \"extensions\": [\n\t            [\n\t              1000,\n\t              536870911\n\t            ]\n\t          ]\n\t        },\n\t        \"ApplicationLaunchOnCallMode\": {\n\t          \"options\": {\n\t            \"allow_alias\": true\n\t          },\n\t          \"values\": {\n\t            \"IF_NOT_LAUNCHED\": 0,\n\t            \"DEFAULT\": 0,\n\t            \"ALWAYS\": 1,\n\t            \"ENABLED\": 1,\n\t            \"NEVER\": 2,\n\t            \"DISABLED\": 2\n\t          }\n\t        },\n\t        \"messageId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MessageOptions\"\n\t        },\n\t        \"serviceId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.ServiceOptions\"\n\t        },\n\t        \"methodId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MethodOptions\"\n\t        },\n\t        \"UniqueId\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.UniqueId\"\n\t          },\n\t          \"fields\": {\n\t            \"lo\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 1\n\t            },\n\t            \"hi\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"plexus\": {\n\t      \"nested\": {\n\t        \"interop\": {\n\t          \"nested\": {\n\t            \"testing\": {\n\t              \"options\": {\n\t                \"csharp_namespace\": \"plexus\"\n\t              },\n\t              \"nested\": {\n\t                \"EchoService\": {\n\t                  \"options\": {\n\t                    \"(.interop.service_id)\": \"plexus.interop.testing.EchoService\"\n\t                  },\n\t                  \"methods\": {\n\t                    \"Unary\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"responseType\": \"EchoRequest\"\n\t                    },\n\t                    \"ServerStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"responseType\": \"EchoRequest\",\n\t                      \"responseStream\": true\n\t                    },\n\t                    \"ClientStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"requestStream\": true,\n\t                      \"responseType\": \"EchoRequest\"\n\t                    },\n\t                    \"DuplexStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"requestStream\": true,\n\t                      \"responseType\": \"EchoRequest\",\n\t                      \"responseStream\": true\n\t                    }\n\t                  }\n\t                },\n\t                \"EchoRequest\": {\n\t                  \"options\": {\n\t                    \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest\"\n\t                  },\n\t                  \"fields\": {\n\t                    \"stringField\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"int64Field\": {\n\t                      \"type\": \"int64\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"uint32Field\": {\n\t                      \"type\": \"uint32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"repeatedDoubleField\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"double\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"enumField\": {\n\t                      \"type\": \"SubEnum\",\n\t                      \"id\": 5\n\t                    },\n\t                    \"subMessageField\": {\n\t                      \"type\": \"SubMessage\",\n\t                      \"id\": 6\n\t                    },\n\t                    \"repeatedSubMessageField\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"SubMessage\",\n\t                      \"id\": 7\n\t                    }\n\t                  },\n\t                  \"nested\": {\n\t                    \"SubMessage\": {\n\t                      \"options\": {\n\t                        \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest.SubMessage\"\n\t                      },\n\t                      \"fields\": {\n\t                        \"bytesField\": {\n\t                          \"type\": \"bytes\",\n\t                          \"id\": 1\n\t                        },\n\t                        \"stringField\": {\n\t                          \"type\": \"string\",\n\t                          \"id\": 2\n\t                        }\n\t                      }\n\t                    },\n\t                    \"SubEnum\": {\n\t                      \"values\": {\n\t                        \"VALUE_ONE\": 0,\n\t                        \"VALUE_TWO\": 1\n\t                      }\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            }\n\t          }\n\t        }\n\t      }\n\t    }\n\t  }\n\t}\n\t,\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"plexus.interop.testing.EchoService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"AppLaunchedEventStream\",\n\t\t\t\t\t\"request\": \"google.protobuf.Empty\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchedEvent\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLauncherService\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoClient\",\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"plexus.interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"plexus.interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"plexus.interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"alias\": \"ServiceAlias\",\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"plexus.interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"plexus.interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Unary Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Server Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Client Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Duplex Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"plexus.interop.testing.*\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Sample Echo Service\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.TestAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "web/packages/e2e/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/e2e\",\n  \"version\": \"0.1.0\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"Integration tests for Plexus Web Interop\",\n  \"license\": \"Apache-2.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"build\": \"yarn build:main && npm run copy-assets && npm run build-host-proxy\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"yarn build && jest --coverage\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\",\n    \"copy-assets\": \"copyfiles src/echo/server/* src/echo/client/* dist/main && copyfiles src/views/* dist/main\",\n    \"build-host-proxy\": \"node scripts/browserify-all.js --standalone proxyHost --inputGlob dist/main/tests/common/TestCrossDomainHost.js --outputFile dist/main/tests/web/CrossDomainHost.bundle.js\",\n    \"prepare-native-e2e-debug-tests\": \"node scripts/browserify-all.js --inputGlob dist/main/tests/native/*Connect*spec.js --outputFile dist/main/tests/native/RendererProcess.bundle.js\",\n    \"e2e-web-electron\": \"node scripts/web-e2e-tests-launcher.js --file ./dist/main/tests/web/RendererProcess.bundle.js\",\n    \"pree2e-web-electron\": \"node scripts/browserify-all.js --brokerCoverage true --inputGlob dist/main/tests/web/*spec.js --outputFile dist/main/tests/web/RendererProcess.bundle.js\",\n    \"e2e-web-ie\": \"node scripts/web-e2e-tests-launcher.js --browser ie\",\n    \"e2e-web-chrome\": \"node scripts/web-e2e-tests-launcher.js --browser chrome\",\n    \"web-broker-benchmarks\": \"node scripts/web-e2e-tests-launcher.js --file ./dist/main/tests/web/benchmarks/RendererProcessBenchmarks.bundle.js\",\n    \"preweb-broker-benchmarks\": \"node scripts/browserify-all.js --inputGlob dist/main/tests/web/benchmarks/*spec.js --outputFile dist/main/tests/web/benchmarks/RendererProcessBenchmarks.bundle.js\",\n    \"native-broker-benchmarks\": \"node scripts/native-e2e-tests-launcher.js --file ./dist/main/tests/native/benchmarks/RendererProcessBenchmarks.bundle.js\",\n    \"prenative-broker-benchmarks\": \"node scripts/browserify-all.js --inputGlob dist/main/tests/native/benchmarks/*spec.js --outputFile dist/main/tests/native/benchmarks/RendererProcessBenchmarks.bundle.js\",\n    \"e2e-native\": \"node scripts/native-e2e-tests-launcher.js --file ./dist/main/tests/native/RendererProcess.bundle.js\",\n    \"pree2e-native\": \"node scripts/browserify-all.js --clientCoverage true --inputGlob dist/main/tests/native/*spec.js --outputFile dist/main/tests/native/RendererProcess.bundle.js\",\n    \"e2e-native-debug\": \"npm run build && npm run prepare-native-e2e-debug-tests && npm run e2e-native-debug-run\",\n    \"e2e-native-debug-run\": \"node scripts/native-e2e-tests-launcher.js --printBrokerStdout true --debug true --file ./dist/main/tests/native/RendererProcess.bundle.js\"\n  },\n  \"dependencies\": {\n    \"@plexus-interop/broker\": \"0.1.0\",\n    \"@plexus-interop/common-api-impl\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/remote\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/client-api\": \"0.1.0\",\n    \"@plexus-interop/io\": \"0.1.0\",\n    \"@plexus-interop/metadata\": \"0.1.0\",\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"@types/long\": \"^4.0.0\",\n    \"protobufjs\": \"6.11.3\",\n    \"long\": \"^4.0.0\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"babel-register\": \"^6.23.0\",\n    \"browserify\": \"^14.5.0\",\n    \"browserify-istanbul\": \"^3.0.1\",\n    \"chai\": \"^4.1.0\",\n    \"chokidar\": \"^1.7.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"core-js\": \"^2.5.3\",\n    \"electron\": \"1.8.8\",\n    \"electron-mocha\": \"^4.0.2\",\n    \"glob\": \"^7.1.2\",\n    \"http-server\": \"^0.11.1\",\n    \"is-electron-renderer\": \"^2.0.1\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"karma\": \"^1.7.1\",\n    \"karma-browserify\": \"^5.1.2\",\n    \"karma-chrome-launcher\": \"^2.2.0\",\n    \"karma-ie-launcher\": \"^1.0.0\",\n    \"karma-mocha\": \"^1.3.0\",\n    \"karma-mocha-reporter\": \"^2.2.5\",\n    \"minimist\": \"^1.2.0\",\n    \"mocha\": \"^3.5.0\",\n    \"nyc\": \"^11.2.1\",\n    \"path\": \"^0.12.7\",\n    \"sinon\": \"^2.4.1\",\n    \"strip-bom\": \"^3.0.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tree-kill\": \"^1.1.0\",\n    \"ts-mockito\": \"2.0.2\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"watchify\": \"^3.9.0\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/server/**/*.js\",\n      \"!dist/main/src/client/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}"
  },
  {
    "path": "web/packages/e2e/scripts/browserify-all.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar fs = require(\"fs\");\nvar path = require(\"path\");\nvar glob = require('glob');\nvar browserify = require(\"browserify\");\nvar istanbul = require('browserify-istanbul');\nvar argv = require('minimist')(process.argv.slice(2));\n\nconsole.log('Passed arguments' + JSON.stringify(argv));\nvar resultOutFile = path.join(process.cwd(), argv.outputFile);\nconsole.log('Output file:' + resultOutFile);\nvar resultInputGlob = path.join(process.cwd(), argv.inputGlob);\nconsole.log('Input files pattern:' + resultInputGlob);\nif (argv.standalone) {\n    console.log(`Building UMD module [${argv.standalone}]`);\n}\nvar testFiles = glob.sync(resultInputGlob);\n\nconsole.log('Processing files: ' + JSON.stringify(testFiles));\n\nlet browserifyBundle = browserify({ \n    entries: testFiles, \n    standalone: argv.standalone\n})\n.external('websocket');\n\nconst coverageIgnorePatterns =  [\n    // skip all node modules, except our\n    '**/node_modules/!(@plexus-interop)/**',\n    // skip all generated proto messages\n    '**/*-messages.js',\n    '**/*-protocol.js',\n    '**/index.js',\n    '**/bower_components/**',\n    '**/test/**',\n    '**/tests/**',\n    '**/*.json',\n    '**/*.spec.js'];\n\nif (argv.clientCoverage) {\n    // skip web broker to have better picture    \n    coverageIgnorePatterns.push('**/broker/**');\n}\n\nif (argv.clientCoverage || argv.brokerCoverage) {\n    console.log('Coverage enabled, instrumenting sources');\n    bundle = browserifyBundle.transform(istanbul({\n        ignore: coverageIgnorePatterns,\n        defaultIgnore: true\n    }), { global: true });\n} else if (argv.broker) {\n    coverageIgnorePatterns.push('**/broker/**');\n\n}\n\nbrowserifyBundle.bundle()\n    .pipe(fs.createWriteStream(argv.outputFile));"
  },
  {
    "path": "web/packages/e2e/scripts/coverage.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Adds hook to save coverage info (if any) after finishing of electron tests\n */\n\n'use strict'\nconst glob = require('glob')\nconst { resolve, join } = require('path')\nconst { writeFileSync, existsSync, mkdirSync } = require('fs');\n\n// write coverage info to root, so we can build report against all components \nconst root = resolve(__dirname, '../../..');\nconst tmpd = resolve(root, '.nyc_output');\n\nfunction report() {\n    console.log(`Writing coverage report to ${tmpd}`);\n    try {\n        if (!existsSync(tmpd)){\n            mkdirSync(tmpd);\n        }\n        writeFileSync(join(tmpd, `coverage.json`), JSON.stringify(coverageInfo), 'utf-8');\n    } catch (e) {\n        console.log(\"Error\", e);\n    }\n}\n\nconst coverageInfo = global.__coverage__ = {}\n\nif (window) {\n    window.addEventListener('unload', report);\n}\n\n"
  },
  {
    "path": "web/packages/e2e/scripts/file-utils.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst baseReadline = require('readline');\nconst chokidar = require('chokidar');\n\nfunction readline(filePath, callBack) {\n    var lineReader = baseReadline.createInterface({\n        input: require('fs').createReadStream(filePath)\n    });\n    lineReader.on('line', function (line) {\n        callBack(line);\n    });\n};\n\nfunction onFileAdded(dir, fileName, callback) {\n    var wsAddressWatcher = chokidar.watch(dir, {\n        ignored: /(^|[\\/\\\\])\\../,\n        persistent: true\n    });\n    wsAddressWatcher\n        .on('add', path => {\n            if (path.endsWith(fileName)) {\n                console.log(`File ${path} has been added`);\n                callback(path);\n            }\n        })\n        .on('change', path => {\n            if (path.endsWith(fileName)) {\n                console.log(`File ${path} has been changed`)\n            }\n        });\n}\n\nmodule.exports = {\n    readline,\n    onFileAdded\n};"
  },
  {
    "path": "web/packages/e2e/scripts/karma-preprocessor.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"
  },
  {
    "path": "web/packages/e2e/scripts/native-broker-launcher.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst argv = require('minimist')(process.argv.slice(2));\nconst exec = require('child_process').exec;\nconst kill = require('tree-kill');\nconst readline = require('./file-utils').readline;\nconst onFileAdded = require('./file-utils').onFileAdded;\nconst stripBom = require('strip-bom');\nconst log = console.log.bind(console);\n\n/**\n * Starts Broker\n * @return Process and its Working Directory\n */\nfunction start() {\n\n    log(\"Starting Native Broker instance\");\n\n    const config = {\n        brokerBaseDir: `${__dirname}/../../../../bin/win-x86/samples`,\n        wsAddressDir: \"servers/ws-v1\",\n        wsAddressFile: \"address\",\n        brokerCmd: \"../broker/plexus.exe\",\n        brokerArgs: ` broker -m ${__dirname}/../metadata`\n    };\n\n    const fullBrokerCmd = path.join(config.brokerBaseDir, config.brokerCmd);\n    const wsAddressDir = path.join(config.brokerBaseDir, config.wsAddressDir);\n    const addressFile = path.join(wsAddressDir, config.wsAddressFile);\n\n    try {\n        fs.accessSync(addressFile);\n        log(`Deleting WS address file ${addressFile}`);\n        fs.unlinkSync(addressFile);\n        log(`Deleted ${addressFile}`);\n    } catch (error) {\n        log(`${addressFile} does not exist`);\n    }\n\n    log(\"Broker start cmd\", fullBrokerCmd);\n    log(\"Broker working dir\", config.brokerBaseDir);\n    log(\"WS address dir\", wsAddressDir);\n\n    log(\"Watching for Web Socket Server address file update\");\n\n    return new Promise((resolve, reject) => {\n\n        let brokerProcess;\n        let launched = false;\n        onFileAdded(wsAddressDir, addressFile, receivedPath => {\n            if (!launched) {\n                launched = true;\n                readClearedLine(receivedPath)\n                    .then(line => resolve({\n                        workingDir: line,\n                        process: brokerProcess\n                    }));\n            }\n        });\n\n        // if file addition was not handled due to race condition, \n        // then try to read port from hardcoded path\n        setTimeout(() => {\n            if (!launched) {\n                launched = true;\n                log(`No file notification received, trying to read from default location ${addressFile}`);\n                readClearedLine(addressFile)\n                    .then(line => resolve({\n                        workingDir: line,\n                        process: brokerProcess\n                    }));\n            }\n        }, 20000);\n\n        log(\"Starting Broker ...\");\n        brokerProcess = exec(fullBrokerCmd + config.brokerArgs, {\n            cwd: config.brokerBaseDir,\n            maxBuffer: 1024 * 1024\n        }, (error, stdout, stderr) => {\n            log(\"Broker stopped\");\n            if (argv.printBrokerStdout) {\n                log('StdOut', stdout);\n            }\n            process.exit();\n        });\n    });\n\n}\n\n/**\n * Reads first line, clearing BOM symbol\n */\nfunction readClearedLine(path) {\n    return new Promise((resolve, reject) => {\n        log(`Reading first line of ${path}`);\n        readline(path, (line) => {\n            log(`Data received, clearing BOM symbol`, line);\n            line = stripBom(line);\n            resolve(line);\n        });\n    });\n}\n\nmodule.exports = {\n    start\n};\n\n"
  },
  {
    "path": "web/packages/e2e/scripts/native-e2e-tests-launcher.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst argv = require('minimist')(process.argv.slice(2));\nconst exec = require('child_process').exec;\nconst kill = require('tree-kill');\nconst log = console.log.bind(console);\nconst startNativeBroker = require('./native-broker-launcher').start;\n\nlet brokerProcess;\n\nfunction main() {\n    log('Passed arguments' + JSON.stringify(argv));\n    startNativeBroker()\n        .then(brokerInfo => {\n            brokerProcess = brokerInfo.process;\n            runElectronTest(brokerInfo.workingDir);\n        });\n}\n\nfunction killBroker() {\n    if (brokerProcess) {\n        log(\"Killing broker process ...\");\n        kill(brokerProcess.pid, \"SIGTERM\", error => {\n            if (error) {\n                log(\"Error on stopping of broker\", error);\n            } else {\n                log(\"Broker stopped without error\");\n            }\n        });\n        log(\"Kill signal sent\");\n    }\n}\n\nfunction runElectronTest(wsUrl) {\n    log(\"Starting Electron Tests ...\");\n    exec(`electron-mocha --require scripts/coverage ${argv.file} ${argv.debug ? \"--debug\" : \"\"} --renderer --reporter spec --colors`, {\n        cwd: process.cwd(),\n        env: {\n            PLEXUS_BROKER_WEBSOCKET_URL: wsUrl\n        }\n    }, (error, stdout, stderr) => {\n        let exitCode = 0;\n        log(\"Electron tests stopped, killing Broker\");\n        if (error || stderr) {\n            console.error('Std Error:', stderr);\n            console.error('Error: ', error);\n            exitCode = 1;\n        }\n        log('StdOut', stdout);\n        killBroker();\n        setTimeout(() => process.exit(exitCode), 3000);\n    });\n}\n\nmain();\n\n\n"
  },
  {
    "path": "web/packages/e2e/scripts/web-e2e-tests-launcher.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst argv = require('minimist')(process.argv.slice(2));\nconst { spawn, exec } = require('child_process');\nconst kill = require('tree-kill');\nconst log = console.log.bind(console);\n\nlet httpServerProcess;\n\nfunction main() {\n\n    log('Passed arguments' + JSON.stringify(argv));\n    \n    const port = argv.port || 3001;\n    const baseDir = argv.baseUrl || `${__dirname}/../dist`;  \n    const proxyPagePath = argv.path || `main/src/views/proxyHost.html`;\n\n    const proxyHostUrl = `http://localhost:${port}/${proxyPagePath}`;\n\n    log(`Starting http-server in ${baseDir}, listening on ${port} port`);\n\n    httpServerProcess = exec(`http-server ${baseDir} -p ${port}`, {\n        cwd: process.cwd()\n    }, (error, stdout, stderr) => {\n        log(\"http-server stopped\");\n        if (error || stderr) {\n            console.error('Std Error:', stderr);\n            console.error('Error: ', error);\n        }\n        killHttpServerProcess();\n    });\n\n    setTimeout(() => {\n\n        const browser = argv.browser;        \n        switch (browser) {\n            case 'ie':\n                runIETest(proxyHostUrl);\n                break;\n            case 'chrome':\n                runChromeTest(proxyHostUrl);\n                break;\n            case 'electron':\n            default:\n                runElectronTest(proxyHostUrl);\n                break;\n        }\n\n    }, 1000);\n}\n\nfunction killHttpServerProcess() {\n    if (httpServerProcess) {\n        log(\"Killing broker process ...\");\n        kill(httpServerProcess.pid);\n        log(\"Kill signal sent\");\n    }\n}\n\nfunction runChromeTest(path) {\n    log(\"Starting Web Broker Chrome Tests ...\");\n    exec(`karma start --hostPath=${path} --browsers=Chrome`, {\n        cwd: process.cwd()\n    }, testsFinishedHandler);\n}\n\nfunction runIETest(path) {\n    log(\"Starting Web Broker IE Tests ...\");\n    exec(`karma start --hostPath=${path} --browsers=IE_no_addons`, {\n        cwd: process.cwd()\n    }, testsFinishedHandler);\n}\n\nfunction testsFinishedHandler(error, stdout, stderr) {\n    log(\"Tests exection process completed, killing HTTP Server\");\n    let exitCode = 0;\n    if (error || stderr) {\n        console.error('Std Error:', stderr);\n        console.error('Error: ', error);\n        exitCode = 1;\n    }\n    log('StdOut', stdout);\n    killHttpServerProcess();\n    process.exit(exitCode);\n}\n\nfunction runElectronTest(path) {\n    log(\"Starting Web Broker Electron Tests ...\");\n    exec(`electron-mocha --require scripts/coverage ${argv.file} ${argv.debug ? \"--debug\" : \"\"} --renderer --reporter spec --colors`, {\n        cwd: process.cwd(),\n        env: {\n            PLEXUS_BROKER_HOST_URL: path\n        }\n    }, testsFinishedHandler);\n}\n\nmain();\n\n\n"
  },
  {
    "path": "web/packages/e2e/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/e2e/src/echo/client/EchoClientGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InternalGenericClientApi, ClientApiBuilder, MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as plexus from './plexus-messages';\n\nexport interface CancellableUnaryResponse<T> {\n    invocation: InvocationClient;\n    response: Promise<T>;\n}\n\n/**\n *  Proxy interface of EchoService service, to be consumed by Client API\n */\nexport abstract class EchoServiceProxy {\n\n    public abstract unary(request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest>;\n    public abstract unaryWithCancellation(request: plexus.plexus.interop.testing.IEchoRequest): Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>>;\n    \n    public abstract serverStreaming(request: plexus.plexus.interop.testing.IEchoRequest, responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<InvocationClient>;\n    \n    public abstract clientStreaming(responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>>;\n    \n    public abstract duplexStreaming(responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>>;\n}\n\n/**\n *  Proxy interface of ServiceAlias service, to be consumed by Client API\n */\nexport abstract class ServiceAliasProxy {\n\n    public abstract unary(request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest>;\n    public abstract unaryWithCancellation(request: plexus.plexus.interop.testing.IEchoRequest): Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>>;\n}\n\n/**\n *  Internal Proxy implementation for EchoService service\n */\nexport class EchoServiceProxyImpl implements EchoServiceProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public unary(request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'Unary',\n            serviceId: 'plexus.interop.testing.EchoService'\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n        });\n    }\n    public unaryWithCancellation(request: plexus.plexus.interop.testing.IEchoRequest): Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'Unary',\n            serviceId: 'plexus.interop.testing.EchoService'\n        };\n        return new Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>>((resolveInvocation, rejectInvocation) => {\n            const responsePromise = new Promise<plexus.plexus.interop.testing.IEchoRequest>((resolveResponse, rejectResponse) => {\n                this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                    value: responsePayload => resolveResponse(responsePayload),\n                    error: e => rejectResponse(e)\n                }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n                .then(invocationClient => resolveInvocation({ invocation: invocationClient, response: responsePromise }))\n                .catch(rejectInvocation);\n            });\n        });\n    }\n    \n    public serverStreaming(request: plexus.plexus.interop.testing.IEchoRequest, responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<InvocationClient> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ServerStreaming',\n            serviceId: 'plexus.interop.testing.EchoService'\n        };\n        return this.genericClient.sendServerStreamingRequest(\n            invocationInfo,\n            request,\n            responseObserver,\n            plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest\n        );\n    }\n    \n    public clientStreaming(responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'ClientStreaming',\n            serviceId: 'plexus.interop.testing.EchoService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n    }\n    \n    public duplexStreaming(responseObserver: InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>): Promise<StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'DuplexStreaming',\n            serviceId: 'plexus.interop.testing.EchoService'\n        };\n        return this.genericClient.sendBidirectionalStreamingRequest(\n            invocationInfo,\n            responseObserver,\n            plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n    }\n\n}\n\n/**\n *  Internal Proxy implementation for ServiceAlias service\n */\nexport class ServiceAliasProxyImpl implements ServiceAliasProxy {\n\n    constructor(private readonly genericClient: GenericClientApi) { }\n\n    public unary(request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'Unary',\n            serviceId: 'plexus.interop.testing.EchoService',\n            serviceAlias: 'ServiceAlias'\n        };\n        return new Promise((resolve, reject) => {\n            this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                value: responsePayload => resolve(responsePayload),\n                error: e => reject(e)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n        });\n    }\n    public unaryWithCancellation(request: plexus.plexus.interop.testing.IEchoRequest): Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>> {\n        const invocationInfo: InvocationRequestInfo = {\n            methodId: 'Unary',\n            serviceId: 'plexus.interop.testing.EchoService',\n            serviceAlias: 'ServiceAlias'\n        };\n        return new Promise<CancellableUnaryResponse<plexus.plexus.interop.testing.IEchoRequest>>((resolveInvocation, rejectInvocation) => {\n            const responsePromise = new Promise<plexus.plexus.interop.testing.IEchoRequest>((resolveResponse, rejectResponse) => {\n                this.genericClient.sendUnaryRequest(invocationInfo, request, {\n                    value: responsePayload => resolveResponse(responsePayload),\n                    error: e => rejectResponse(e)\n                }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n                .then(invocationClient => resolveInvocation({ invocation: invocationClient, response: responsePromise }))\n                .catch(rejectInvocation);\n            });\n        });\n    }\n\n}\n\n/**\n * Main client API\n */\nexport interface EchoClientClient extends GenericClientApi  {\n\n    getEchoServiceProxy(): EchoServiceProxy;\n    \n    getServiceAliasProxy(): ServiceAliasProxy;\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass EchoClientClientImpl extends GenericClientApiBase implements EchoClientClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n        private readonly echoServiceProxy: EchoServiceProxy,\n        private readonly serviceAliasProxy: ServiceAliasProxy\n    ) {\n        super(genericClient);\n    }\n\n    public getEchoServiceProxy(): EchoServiceProxy {\n        return this.echoServiceProxy;\n    }\n    \n    public getServiceAliasProxy(): ServiceAliasProxy {\n        return this.serviceAliasProxy;\n    }\n\n}\n\n\n/**\n * Client API builder\n */\nexport class EchoClientClientBuilder implements ClientApiBuilder<EchoClientClient, EchoClientClientBuilder> {\n\n    protected genericBuilder: GenericClientApiBuilder =\n        new ContainerAwareClientAPIBuilder()\n            .withApplicationId('plexus.interop.testing.EchoClient');\n\n\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): EchoClientClientBuilder {\n        this.genericBuilder.withClientApiDecorator(clientApiDecorator);\n        return this;\n    }\n\n    public withClientExtension(extension: (builder: ClientApiBuilder<EchoClientClient, EchoClientClientBuilder>) => void): EchoClientClientBuilder {\n        extension(this);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): EchoClientClientBuilder {\n        this.genericBuilder.withTransportConnectionProvider(provider);\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): EchoClientClientBuilder {\n        this.genericBuilder.withAppInstanceId(appInstanceId);\n        return this;\n    }\n\n    public withAppId(appId: string): EchoClientClientBuilder {\n        this.genericBuilder.withApplicationId(appId);\n        return this;\n    }\n\n    public connect(): Promise<EchoClientClient> {\n        return this.genericBuilder\n            .connect()\n            .then(genericClient => new EchoClientClientImpl(\n                genericClient,\n                new EchoServiceProxyImpl(genericClient),\n                                new ServiceAliasProxyImpl(genericClient)\n                ));\n    }\n}\n"
  },
  {
    "path": "web/packages/e2e/src/echo/client/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from \"protobufjs\";\n/** Namespace plexus. */\nexport namespace plexus {\n\n    /** Namespace interop. */\n    namespace interop {\n\n        /** Namespace testing. */\n        namespace testing {\n\n            /** Represents an EchoService */\n            class EchoService extends $protobuf.rpc.Service {\n\n                /**\n                 * Constructs a new EchoService service.\n                 * @param rpcImpl RPC implementation\n                 * @param [requestDelimited=false] Whether requests are length-delimited\n                 * @param [responseDelimited=false] Whether responses are length-delimited\n                 */\n                constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n                /**\n                 * Creates new EchoService service using the specified rpc implementation.\n                 * @param rpcImpl RPC implementation\n                 * @param [requestDelimited=false] Whether requests are length-delimited\n                 * @param [responseDelimited=false] Whether responses are length-delimited\n                 * @returns RPC service. Useful where requests and/or responses are streamed.\n                 */\n                public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EchoService;\n\n                /**\n                 * Calls Unary.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public unary(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.UnaryCallback): void;\n\n                /**\n                 * Calls Unary.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public unary(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls ServerStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public serverStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.ServerStreamingCallback): void;\n\n                /**\n                 * Calls ServerStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public serverStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls ClientStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public clientStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.ClientStreamingCallback): void;\n\n                /**\n                 * Calls ClientStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public clientStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public duplexStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.DuplexStreamingCallback): void;\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public duplexStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n            }\n\n            namespace EchoService {\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#unary}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type UnaryCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#serverStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type ServerStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#clientStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type ClientStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#duplexStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type DuplexStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n            }\n\n            /** Properties of an EchoRequest. */\n            interface IEchoRequest {\n\n                /** EchoRequest stringField */\n                stringField?: (string|null);\n\n                /** EchoRequest int64Field */\n                int64Field?: (Long|null);\n\n                /** EchoRequest uint32Field */\n                uint32Field?: (number|null);\n\n                /** EchoRequest repeatedDoubleField */\n                repeatedDoubleField?: (number[]|null);\n\n                /** EchoRequest enumField */\n                enumField?: (plexus.interop.testing.EchoRequest.SubEnum|null);\n\n                /** EchoRequest subMessageField */\n                subMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage|null);\n\n                /** EchoRequest repeatedSubMessageField */\n                repeatedSubMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage[]|null);\n            }\n\n            /** Represents an EchoRequest. */\n            class EchoRequest implements IEchoRequest {\n\n                /**\n                 * Constructs a new EchoRequest.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: plexus.interop.testing.IEchoRequest);\n\n                /** EchoRequest stringField. */\n                public stringField: string;\n\n                /** EchoRequest int64Field. */\n                public int64Field: Long;\n\n                /** EchoRequest uint32Field. */\n                public uint32Field: number;\n\n                /** EchoRequest repeatedDoubleField. */\n                public repeatedDoubleField: number[];\n\n                /** EchoRequest enumField. */\n                public enumField: plexus.interop.testing.EchoRequest.SubEnum;\n\n                /** EchoRequest subMessageField. */\n                public subMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage|null);\n\n                /** EchoRequest repeatedSubMessageField. */\n                public repeatedSubMessageField: plexus.interop.testing.EchoRequest.ISubMessage[];\n\n                /**\n                 * Creates a new EchoRequest instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns EchoRequest instance\n                 */\n                public static create(properties?: plexus.interop.testing.IEchoRequest): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Encodes the specified EchoRequest message. Does not implicitly {@link plexus.interop.testing.EchoRequest.verify|verify} messages.\n                 * @param message EchoRequest message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: plexus.interop.testing.IEchoRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes an EchoRequest message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns EchoRequest\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Verifies an EchoRequest message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates an EchoRequest message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns EchoRequest\n                 */\n                public static fromObject(object: { [k: string]: any }): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Creates a plain object from an EchoRequest message. Also converts values to other types if specified.\n                 * @param message EchoRequest\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: plexus.interop.testing.EchoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this EchoRequest to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n\n            namespace EchoRequest {\n\n                /** Properties of a SubMessage. */\n                interface ISubMessage {\n\n                    /** SubMessage bytesField */\n                    bytesField?: (Uint8Array|null);\n\n                    /** SubMessage stringField */\n                    stringField?: (string|null);\n                }\n\n                /** Represents a SubMessage. */\n                class SubMessage implements ISubMessage {\n\n                    /**\n                     * Constructs a new SubMessage.\n                     * @param [properties] Properties to set\n                     */\n                    constructor(properties?: plexus.interop.testing.EchoRequest.ISubMessage);\n\n                    /** SubMessage bytesField. */\n                    public bytesField: Uint8Array;\n\n                    /** SubMessage stringField. */\n                    public stringField: string;\n\n                    /**\n                     * Creates a new SubMessage instance using the specified properties.\n                     * @param [properties] Properties to set\n                     * @returns SubMessage instance\n                     */\n                    public static create(properties?: plexus.interop.testing.EchoRequest.ISubMessage): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Encodes the specified SubMessage message. Does not implicitly {@link plexus.interop.testing.EchoRequest.SubMessage.verify|verify} messages.\n                     * @param message SubMessage message or plain object to encode\n                     * @param [writer] Writer to encode to\n                     * @returns Writer\n                     */\n                    public static encode(message: plexus.interop.testing.EchoRequest.ISubMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                    /**\n                     * Decodes a SubMessage message from the specified reader or buffer.\n                     * @param reader Reader or buffer to decode from\n                     * @param [length] Message length if known beforehand\n                     * @returns SubMessage\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Verifies a SubMessage message.\n                     * @param message Plain object to verify\n                     * @returns `null` if valid, otherwise the reason why it is not\n                     */\n                    public static verify(message: { [k: string]: any }): (string|null);\n\n                    /**\n                     * Creates a SubMessage message from a plain object. Also converts values to their respective internal types.\n                     * @param object Plain object\n                     * @returns SubMessage\n                     */\n                    public static fromObject(object: { [k: string]: any }): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Creates a plain object from a SubMessage message. Also converts values to other types if specified.\n                     * @param message SubMessage\n                     * @param [options] Conversion options\n                     * @returns Plain object\n                     */\n                    public static toObject(message: plexus.interop.testing.EchoRequest.SubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                    /**\n                     * Converts this SubMessage to JSON.\n                     * @returns JSON object\n                     */\n                    public toJSON(): { [k: string]: any };\n                }\n\n                /** SubEnum enum. */\n                enum SubEnum {\n                    VALUE_ONE = 0,\n                    VALUE_TWO = 1\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "web/packages/e2e/src/echo/client/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.plexus || ($protobuf.roots.plexus = {});\n\n$root.plexus = (function() {\n\n    /**\n     * Namespace plexus.\n     * @exports plexus\n     * @namespace\n     */\n    var plexus = {};\n\n    plexus.interop = (function() {\n\n        /**\n         * Namespace interop.\n         * @memberof plexus\n         * @namespace\n         */\n        var interop = {};\n\n        interop.testing = (function() {\n\n            /**\n             * Namespace testing.\n             * @memberof plexus.interop\n             * @namespace\n             */\n            var testing = {};\n\n            testing.EchoService = (function() {\n\n                /**\n                 * Constructs a new EchoService service.\n                 * @memberof plexus.interop.testing\n                 * @classdesc Represents an EchoService\n                 * @extends $protobuf.rpc.Service\n                 * @constructor\n                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n                 */\n                function EchoService(rpcImpl, requestDelimited, responseDelimited) {\n                    $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n                }\n\n                (EchoService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EchoService;\n\n                /**\n                 * Creates new EchoService service using the specified rpc implementation.\n                 * @function create\n                 * @memberof plexus.interop.testing.EchoService\n                 * @static\n                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n                 * @returns {EchoService} RPC service. Useful where requests and/or responses are streamed.\n                 */\n                EchoService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n                    return new this(rpcImpl, requestDelimited, responseDelimited);\n                };\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#unary}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef UnaryCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls Unary.\n                 * @function unary\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.UnaryCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.unary = function unary(request, callback) {\n                    return this.rpcCall(unary, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"Unary\" });\n\n                /**\n                 * Calls Unary.\n                 * @function unary\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#serverStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef ServerStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls ServerStreaming.\n                 * @function serverStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.ServerStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.serverStreaming = function serverStreaming(request, callback) {\n                    return this.rpcCall(serverStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"ServerStreaming\" });\n\n                /**\n                 * Calls ServerStreaming.\n                 * @function serverStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#clientStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef ClientStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls ClientStreaming.\n                 * @function clientStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.ClientStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.clientStreaming = function clientStreaming(request, callback) {\n                    return this.rpcCall(clientStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"ClientStreaming\" });\n\n                /**\n                 * Calls ClientStreaming.\n                 * @function clientStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#duplexStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef DuplexStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @function duplexStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.DuplexStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.duplexStreaming = function duplexStreaming(request, callback) {\n                    return this.rpcCall(duplexStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"DuplexStreaming\" });\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @function duplexStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                return EchoService;\n            })();\n\n            testing.EchoRequest = (function() {\n\n                /**\n                 * Properties of an EchoRequest.\n                 * @memberof plexus.interop.testing\n                 * @interface IEchoRequest\n                 * @property {string|null} [stringField] EchoRequest stringField\n                 * @property {Long|null} [int64Field] EchoRequest int64Field\n                 * @property {number|null} [uint32Field] EchoRequest uint32Field\n                 * @property {Array.<number>|null} [repeatedDoubleField] EchoRequest repeatedDoubleField\n                 * @property {plexus.interop.testing.EchoRequest.SubEnum|null} [enumField] EchoRequest enumField\n                 * @property {plexus.interop.testing.EchoRequest.ISubMessage|null} [subMessageField] EchoRequest subMessageField\n                 * @property {Array.<plexus.interop.testing.EchoRequest.ISubMessage>|null} [repeatedSubMessageField] EchoRequest repeatedSubMessageField\n                 */\n\n                /**\n                 * Constructs a new EchoRequest.\n                 * @memberof plexus.interop.testing\n                 * @classdesc Represents an EchoRequest.\n                 * @implements IEchoRequest\n                 * @constructor\n                 * @param {plexus.interop.testing.IEchoRequest=} [properties] Properties to set\n                 */\n                function EchoRequest(properties) {\n                    this.repeatedDoubleField = [];\n                    this.repeatedSubMessageField = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * EchoRequest stringField.\n                 * @member {string} stringField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.stringField = \"\";\n\n                /**\n                 * EchoRequest int64Field.\n                 * @member {Long} int64Field\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.int64Field = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n                /**\n                 * EchoRequest uint32Field.\n                 * @member {number} uint32Field\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.uint32Field = 0;\n\n                /**\n                 * EchoRequest repeatedDoubleField.\n                 * @member {Array.<number>} repeatedDoubleField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.repeatedDoubleField = $util.emptyArray;\n\n                /**\n                 * EchoRequest enumField.\n                 * @member {plexus.interop.testing.EchoRequest.SubEnum} enumField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.enumField = 0;\n\n                /**\n                 * EchoRequest subMessageField.\n                 * @member {plexus.interop.testing.EchoRequest.ISubMessage|null|undefined} subMessageField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.subMessageField = null;\n\n                /**\n                 * EchoRequest repeatedSubMessageField.\n                 * @member {Array.<plexus.interop.testing.EchoRequest.ISubMessage>} repeatedSubMessageField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.repeatedSubMessageField = $util.emptyArray;\n\n                /**\n                 * Creates a new EchoRequest instance using the specified properties.\n                 * @function create\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.IEchoRequest=} [properties] Properties to set\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest instance\n                 */\n                EchoRequest.create = function create(properties) {\n                    return new EchoRequest(properties);\n                };\n\n                /**\n                 * Encodes the specified EchoRequest message. Does not implicitly {@link plexus.interop.testing.EchoRequest.verify|verify} messages.\n                 * @function encode\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.IEchoRequest} message EchoRequest message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                EchoRequest.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.stringField != null && Object.hasOwnProperty.call(message, \"stringField\"))\n                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringField);\n                    if (message.int64Field != null && Object.hasOwnProperty.call(message, \"int64Field\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int64(message.int64Field);\n                    if (message.uint32Field != null && Object.hasOwnProperty.call(message, \"uint32Field\"))\n                        writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.uint32Field);\n                    if (message.repeatedDoubleField != null && message.repeatedDoubleField.length) {\n                        writer.uint32(/* id 4, wireType 2 =*/34).fork();\n                        for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                            writer.double(message.repeatedDoubleField[i]);\n                        writer.ldelim();\n                    }\n                    if (message.enumField != null && Object.hasOwnProperty.call(message, \"enumField\"))\n                        writer.uint32(/* id 5, wireType 0 =*/40).int32(message.enumField);\n                    if (message.subMessageField != null && Object.hasOwnProperty.call(message, \"subMessageField\"))\n                        $root.plexus.interop.testing.EchoRequest.SubMessage.encode(message.subMessageField, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                    if (message.repeatedSubMessageField != null && message.repeatedSubMessageField.length)\n                        for (var i = 0; i < message.repeatedSubMessageField.length; ++i)\n                            $root.plexus.interop.testing.EchoRequest.SubMessage.encode(message.repeatedSubMessageField[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                    return writer;\n                };\n\n                /**\n                 * Decodes an EchoRequest message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                EchoRequest.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.plexus.interop.testing.EchoRequest();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.stringField = reader.string();\n                            break;\n                        case 2:\n                            message.int64Field = reader.int64();\n                            break;\n                        case 3:\n                            message.uint32Field = reader.uint32();\n                            break;\n                        case 4:\n                            if (!(message.repeatedDoubleField && message.repeatedDoubleField.length))\n                                message.repeatedDoubleField = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.repeatedDoubleField.push(reader.double());\n                            } else\n                                message.repeatedDoubleField.push(reader.double());\n                            break;\n                        case 5:\n                            message.enumField = reader.int32();\n                            break;\n                        case 6:\n                            message.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.decode(reader, reader.uint32());\n                            break;\n                        case 7:\n                            if (!(message.repeatedSubMessageField && message.repeatedSubMessageField.length))\n                                message.repeatedSubMessageField = [];\n                            message.repeatedSubMessageField.push($root.plexus.interop.testing.EchoRequest.SubMessage.decode(reader, reader.uint32()));\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Verifies an EchoRequest message.\n                 * @function verify\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                EchoRequest.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                        if (!$util.isString(message.stringField))\n                            return \"stringField: string expected\";\n                    if (message.int64Field != null && message.hasOwnProperty(\"int64Field\"))\n                        if (!$util.isInteger(message.int64Field) && !(message.int64Field && $util.isInteger(message.int64Field.low) && $util.isInteger(message.int64Field.high)))\n                            return \"int64Field: integer|Long expected\";\n                    if (message.uint32Field != null && message.hasOwnProperty(\"uint32Field\"))\n                        if (!$util.isInteger(message.uint32Field))\n                            return \"uint32Field: integer expected\";\n                    if (message.repeatedDoubleField != null && message.hasOwnProperty(\"repeatedDoubleField\")) {\n                        if (!Array.isArray(message.repeatedDoubleField))\n                            return \"repeatedDoubleField: array expected\";\n                        for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                            if (typeof message.repeatedDoubleField[i] !== \"number\")\n                                return \"repeatedDoubleField: number[] expected\";\n                    }\n                    if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                        switch (message.enumField) {\n                        default:\n                            return \"enumField: enum value expected\";\n                        case 0:\n                        case 1:\n                            break;\n                        }\n                    if (message.subMessageField != null && message.hasOwnProperty(\"subMessageField\")) {\n                        var error = $root.plexus.interop.testing.EchoRequest.SubMessage.verify(message.subMessageField);\n                        if (error)\n                            return \"subMessageField.\" + error;\n                    }\n                    if (message.repeatedSubMessageField != null && message.hasOwnProperty(\"repeatedSubMessageField\")) {\n                        if (!Array.isArray(message.repeatedSubMessageField))\n                            return \"repeatedSubMessageField: array expected\";\n                        for (var i = 0; i < message.repeatedSubMessageField.length; ++i) {\n                            var error = $root.plexus.interop.testing.EchoRequest.SubMessage.verify(message.repeatedSubMessageField[i]);\n                            if (error)\n                                return \"repeatedSubMessageField.\" + error;\n                        }\n                    }\n                    return null;\n                };\n\n                /**\n                 * Creates an EchoRequest message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest\n                 */\n                EchoRequest.fromObject = function fromObject(object) {\n                    if (object instanceof $root.plexus.interop.testing.EchoRequest)\n                        return object;\n                    var message = new $root.plexus.interop.testing.EchoRequest();\n                    if (object.stringField != null)\n                        message.stringField = String(object.stringField);\n                    if (object.int64Field != null)\n                        if ($util.Long)\n                            (message.int64Field = $util.Long.fromValue(object.int64Field)).unsigned = false;\n                        else if (typeof object.int64Field === \"string\")\n                            message.int64Field = parseInt(object.int64Field, 10);\n                        else if (typeof object.int64Field === \"number\")\n                            message.int64Field = object.int64Field;\n                        else if (typeof object.int64Field === \"object\")\n                            message.int64Field = new $util.LongBits(object.int64Field.low >>> 0, object.int64Field.high >>> 0).toNumber();\n                    if (object.uint32Field != null)\n                        message.uint32Field = object.uint32Field >>> 0;\n                    if (object.repeatedDoubleField) {\n                        if (!Array.isArray(object.repeatedDoubleField))\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedDoubleField: array expected\");\n                        message.repeatedDoubleField = [];\n                        for (var i = 0; i < object.repeatedDoubleField.length; ++i)\n                            message.repeatedDoubleField[i] = Number(object.repeatedDoubleField[i]);\n                    }\n                    switch (object.enumField) {\n                    case \"VALUE_ONE\":\n                    case 0:\n                        message.enumField = 0;\n                        break;\n                    case \"VALUE_TWO\":\n                    case 1:\n                        message.enumField = 1;\n                        break;\n                    }\n                    if (object.subMessageField != null) {\n                        if (typeof object.subMessageField !== \"object\")\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.subMessageField: object expected\");\n                        message.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.fromObject(object.subMessageField);\n                    }\n                    if (object.repeatedSubMessageField) {\n                        if (!Array.isArray(object.repeatedSubMessageField))\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedSubMessageField: array expected\");\n                        message.repeatedSubMessageField = [];\n                        for (var i = 0; i < object.repeatedSubMessageField.length; ++i) {\n                            if (typeof object.repeatedSubMessageField[i] !== \"object\")\n                                throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedSubMessageField: object expected\");\n                            message.repeatedSubMessageField[i] = $root.plexus.interop.testing.EchoRequest.SubMessage.fromObject(object.repeatedSubMessageField[i]);\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an EchoRequest message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.EchoRequest} message EchoRequest\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                EchoRequest.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults) {\n                        object.repeatedDoubleField = [];\n                        object.repeatedSubMessageField = [];\n                    }\n                    if (options.defaults) {\n                        object.stringField = \"\";\n                        if ($util.Long) {\n                            var long = new $util.Long(0, 0, false);\n                            object.int64Field = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                        } else\n                            object.int64Field = options.longs === String ? \"0\" : 0;\n                        object.uint32Field = 0;\n                        object.enumField = options.enums === String ? \"VALUE_ONE\" : 0;\n                        object.subMessageField = null;\n                    }\n                    if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                        object.stringField = message.stringField;\n                    if (message.int64Field != null && message.hasOwnProperty(\"int64Field\"))\n                        if (typeof message.int64Field === \"number\")\n                            object.int64Field = options.longs === String ? String(message.int64Field) : message.int64Field;\n                        else\n                            object.int64Field = options.longs === String ? $util.Long.prototype.toString.call(message.int64Field) : options.longs === Number ? new $util.LongBits(message.int64Field.low >>> 0, message.int64Field.high >>> 0).toNumber() : message.int64Field;\n                    if (message.uint32Field != null && message.hasOwnProperty(\"uint32Field\"))\n                        object.uint32Field = message.uint32Field;\n                    if (message.repeatedDoubleField && message.repeatedDoubleField.length) {\n                        object.repeatedDoubleField = [];\n                        for (var j = 0; j < message.repeatedDoubleField.length; ++j)\n                            object.repeatedDoubleField[j] = options.json && !isFinite(message.repeatedDoubleField[j]) ? String(message.repeatedDoubleField[j]) : message.repeatedDoubleField[j];\n                    }\n                    if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                        object.enumField = options.enums === String ? $root.plexus.interop.testing.EchoRequest.SubEnum[message.enumField] : message.enumField;\n                    if (message.subMessageField != null && message.hasOwnProperty(\"subMessageField\"))\n                        object.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.toObject(message.subMessageField, options);\n                    if (message.repeatedSubMessageField && message.repeatedSubMessageField.length) {\n                        object.repeatedSubMessageField = [];\n                        for (var j = 0; j < message.repeatedSubMessageField.length; ++j)\n                            object.repeatedSubMessageField[j] = $root.plexus.interop.testing.EchoRequest.SubMessage.toObject(message.repeatedSubMessageField[j], options);\n                    }\n                    return object;\n                };\n\n                /**\n                 * Converts this EchoRequest to JSON.\n                 * @function toJSON\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                EchoRequest.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                EchoRequest.SubMessage = (function() {\n\n                    /**\n                     * Properties of a SubMessage.\n                     * @memberof plexus.interop.testing.EchoRequest\n                     * @interface ISubMessage\n                     * @property {Uint8Array|null} [bytesField] SubMessage bytesField\n                     * @property {string|null} [stringField] SubMessage stringField\n                     */\n\n                    /**\n                     * Constructs a new SubMessage.\n                     * @memberof plexus.interop.testing.EchoRequest\n                     * @classdesc Represents a SubMessage.\n                     * @implements ISubMessage\n                     * @constructor\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage=} [properties] Properties to set\n                     */\n                    function SubMessage(properties) {\n                        if (properties)\n                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                                if (properties[keys[i]] != null)\n                                    this[keys[i]] = properties[keys[i]];\n                    }\n\n                    /**\n                     * SubMessage bytesField.\n                     * @member {Uint8Array} bytesField\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     */\n                    SubMessage.prototype.bytesField = $util.newBuffer([]);\n\n                    /**\n                     * SubMessage stringField.\n                     * @member {string} stringField\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     */\n                    SubMessage.prototype.stringField = \"\";\n\n                    /**\n                     * Creates a new SubMessage instance using the specified properties.\n                     * @function create\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage=} [properties] Properties to set\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage instance\n                     */\n                    SubMessage.create = function create(properties) {\n                        return new SubMessage(properties);\n                    };\n\n                    /**\n                     * Encodes the specified SubMessage message. Does not implicitly {@link plexus.interop.testing.EchoRequest.SubMessage.verify|verify} messages.\n                     * @function encode\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage} message SubMessage message or plain object to encode\n                     * @param {$protobuf.Writer} [writer] Writer to encode to\n                     * @returns {$protobuf.Writer} Writer\n                     */\n                    SubMessage.encode = function encode(message, writer) {\n                        if (!writer)\n                            writer = $Writer.create();\n                        if (message.bytesField != null && Object.hasOwnProperty.call(message, \"bytesField\"))\n                            writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bytesField);\n                        if (message.stringField != null && Object.hasOwnProperty.call(message, \"stringField\"))\n                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringField);\n                        return writer;\n                    };\n\n                    /**\n                     * Decodes a SubMessage message from the specified reader or buffer.\n                     * @function decode\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                     * @param {number} [length] Message length if known beforehand\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    SubMessage.decode = function decode(reader, length) {\n                        if (!(reader instanceof $Reader))\n                            reader = $Reader.create(reader);\n                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.plexus.interop.testing.EchoRequest.SubMessage();\n                        while (reader.pos < end) {\n                            var tag = reader.uint32();\n                            switch (tag >>> 3) {\n                            case 1:\n                                message.bytesField = reader.bytes();\n                                break;\n                            case 2:\n                                message.stringField = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag & 7);\n                                break;\n                            }\n                        }\n                        return message;\n                    };\n\n                    /**\n                     * Verifies a SubMessage message.\n                     * @function verify\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {Object.<string,*>} message Plain object to verify\n                     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                     */\n                    SubMessage.verify = function verify(message) {\n                        if (typeof message !== \"object\" || message === null)\n                            return \"object expected\";\n                        if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                            if (!(message.bytesField && typeof message.bytesField.length === \"number\" || $util.isString(message.bytesField)))\n                                return \"bytesField: buffer expected\";\n                        if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                            if (!$util.isString(message.stringField))\n                                return \"stringField: string expected\";\n                        return null;\n                    };\n\n                    /**\n                     * Creates a SubMessage message from a plain object. Also converts values to their respective internal types.\n                     * @function fromObject\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {Object.<string,*>} object Plain object\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage\n                     */\n                    SubMessage.fromObject = function fromObject(object) {\n                        if (object instanceof $root.plexus.interop.testing.EchoRequest.SubMessage)\n                            return object;\n                        var message = new $root.plexus.interop.testing.EchoRequest.SubMessage();\n                        if (object.bytesField != null)\n                            if (typeof object.bytesField === \"string\")\n                                $util.base64.decode(object.bytesField, message.bytesField = $util.newBuffer($util.base64.length(object.bytesField)), 0);\n                            else if (object.bytesField.length)\n                                message.bytesField = object.bytesField;\n                        if (object.stringField != null)\n                            message.stringField = String(object.stringField);\n                        return message;\n                    };\n\n                    /**\n                     * Creates a plain object from a SubMessage message. Also converts values to other types if specified.\n                     * @function toObject\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.SubMessage} message SubMessage\n                     * @param {$protobuf.IConversionOptions} [options] Conversion options\n                     * @returns {Object.<string,*>} Plain object\n                     */\n                    SubMessage.toObject = function toObject(message, options) {\n                        if (!options)\n                            options = {};\n                        var object = {};\n                        if (options.defaults) {\n                            if (options.bytes === String)\n                                object.bytesField = \"\";\n                            else {\n                                object.bytesField = [];\n                                if (options.bytes !== Array)\n                                    object.bytesField = $util.newBuffer(object.bytesField);\n                            }\n                            object.stringField = \"\";\n                        }\n                        if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                            object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField;\n                        if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                            object.stringField = message.stringField;\n                        return object;\n                    };\n\n                    /**\n                     * Converts this SubMessage to JSON.\n                     * @function toJSON\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     * @returns {Object.<string,*>} JSON object\n                     */\n                    SubMessage.prototype.toJSON = function toJSON() {\n                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                    };\n\n                    return SubMessage;\n                })();\n\n                /**\n                 * SubEnum enum.\n                 * @name plexus.interop.testing.EchoRequest.SubEnum\n                 * @enum {number}\n                 * @property {number} VALUE_ONE=0 VALUE_ONE value\n                 * @property {number} VALUE_TWO=1 VALUE_TWO value\n                 */\n                EchoRequest.SubEnum = (function() {\n                    var valuesById = {}, values = Object.create(valuesById);\n                    values[valuesById[0] = \"VALUE_ONE\"] = 0;\n                    values[valuesById[1] = \"VALUE_TWO\"] = 1;\n                    return values;\n                })();\n\n                return EchoRequest;\n            })();\n\n            return testing;\n        })();\n\n        return interop;\n    })();\n\n    return plexus;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/e2e/src/echo/server/EchoServerGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InternalGenericClientApi, ClientApiBuilder, MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as plexus from './plexus-messages';\n\nexport interface CancellableUnaryResponse<T> {\n    invocation: InvocationClient;\n    response: Promise<T>;\n}\n\n\n\n/**\n * Main client API\n */\nexport interface EchoServerClient extends GenericClientApi  {\n\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass EchoServerClientImpl extends GenericClientApiBase implements EchoServerClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n    ) {\n        super(genericClient);\n    }\n\n\n}\n\n/**\n * Client invocation handler for EchoService, to be implemented by Client\n */\nexport abstract class EchoServiceInvocationHandler {\n\n    public abstract onUnary(invocationContext: MethodInvocationContext, request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest>;\n    \n    public abstract onServerStreaming(invocationContext: MethodInvocationContext, request: plexus.plexus.interop.testing.IEchoRequest, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): void;\n    \n    public abstract onClientStreaming(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>;\n    \n    public abstract onDuplexStreaming(invocationContext: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>;\n}\n\n/**\n * Client API builder\n */\nexport class EchoServerClientBuilder implements ClientApiBuilder<EchoServerClient, EchoServerClientBuilder> {\n\n    protected genericBuilder: GenericClientApiBuilder =\n        new ContainerAwareClientAPIBuilder()\n            .withApplicationId('plexus.interop.testing.EchoServer');\n\n    private echoServiceHandler: EchoServiceInvocationHandler;\n\n    public withEchoServiceInvocationsHandler(invocationsHandler: EchoServiceInvocationHandler): EchoServerClientBuilder {\n        this.echoServiceHandler = invocationsHandler;\n        return this;\n    }\n\n    public withClientApiDecorator(clientApiDecorator: (client: InternalGenericClientApi) => Promise<GenericClientApi>): EchoServerClientBuilder {\n        this.genericBuilder.withClientApiDecorator(clientApiDecorator);\n        return this;\n    }\n\n    public withClientExtension(extension: (builder: ClientApiBuilder<EchoServerClient, EchoServerClientBuilder>) => void): EchoServerClientBuilder {\n        extension(this);\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): EchoServerClientBuilder {\n        this.genericBuilder.withTransportConnectionProvider(provider);\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): EchoServerClientBuilder {\n        this.genericBuilder.withAppInstanceId(appInstanceId);\n        return this;\n    }\n\n    public withAppId(appId: string): EchoServerClientBuilder {\n        this.genericBuilder.withApplicationId(appId);\n        return this;\n    }\n\n    public connect(): Promise<EchoServerClient> {\n        if (!this.echoServiceHandler) {\n            return Promise.reject('Invocation handler for EchoService is not provided');\n        }\n        return this.genericBuilder\n            .withTypeAwareUnaryHandler({\n                serviceInfo: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'Unary',\n                handle: this.echoServiceHandler.onUnary.bind(this.echoServiceHandler)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n            .withTypeAwareServerStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'ServerStreaming',\n                handle: this.echoServiceHandler.onServerStreaming.bind(this.echoServiceHandler)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n            .withTypeAwareBidiStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'ClientStreaming',\n                handle: this.echoServiceHandler.onClientStreaming.bind(this.echoServiceHandler)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n            .withTypeAwareBidiStreamingHandler({\n                serviceInfo: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'DuplexStreaming',\n                handle: this.echoServiceHandler.onDuplexStreaming.bind(this.echoServiceHandler)\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest)\n            .connect()\n            .then(genericClient => new EchoServerClientImpl(\n                genericClient\n));\n    }\n}\n"
  },
  {
    "path": "web/packages/e2e/src/echo/server/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from \"protobufjs\";\n/** Namespace interop. */\nexport namespace interop {\n\n    /** Properties of an ApplicationOptions. */\n    interface IApplicationOptions {\n\n        /** ApplicationOptions title */\n        title?: (string|null);\n\n        /** ApplicationOptions launchOnCall */\n        launchOnCall?: (interop.ApplicationLaunchOnCallMode|null);\n    }\n\n    /** Represents an ApplicationOptions. */\n    class ApplicationOptions implements IApplicationOptions {\n\n        /**\n         * Constructs a new ApplicationOptions.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IApplicationOptions);\n\n        /** ApplicationOptions title. */\n        public title: string;\n\n        /** ApplicationOptions launchOnCall. */\n        public launchOnCall: interop.ApplicationLaunchOnCallMode;\n\n        /**\n         * Creates a new ApplicationOptions instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns ApplicationOptions instance\n         */\n        public static create(properties?: interop.IApplicationOptions): interop.ApplicationOptions;\n\n        /**\n         * Encodes the specified ApplicationOptions message. Does not implicitly {@link interop.ApplicationOptions.verify|verify} messages.\n         * @param message ApplicationOptions message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IApplicationOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes an ApplicationOptions message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns ApplicationOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.ApplicationOptions;\n\n        /**\n         * Verifies an ApplicationOptions message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates an ApplicationOptions message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns ApplicationOptions\n         */\n        public static fromObject(object: { [k: string]: any }): interop.ApplicationOptions;\n\n        /**\n         * Creates a plain object from an ApplicationOptions message. Also converts values to other types if specified.\n         * @param message ApplicationOptions\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.ApplicationOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this ApplicationOptions to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a ProvidedServiceOptions. */\n    interface IProvidedServiceOptions {\n\n        /** ProvidedServiceOptions title */\n        title?: (string|null);\n\n        /** ProvidedServiceOptions launchOnCall */\n        launchOnCall?: (interop.ApplicationLaunchOnCallMode|null);\n    }\n\n    /** Represents a ProvidedServiceOptions. */\n    class ProvidedServiceOptions implements IProvidedServiceOptions {\n\n        /**\n         * Constructs a new ProvidedServiceOptions.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IProvidedServiceOptions);\n\n        /** ProvidedServiceOptions title. */\n        public title: string;\n\n        /** ProvidedServiceOptions launchOnCall. */\n        public launchOnCall: interop.ApplicationLaunchOnCallMode;\n\n        /**\n         * Creates a new ProvidedServiceOptions instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns ProvidedServiceOptions instance\n         */\n        public static create(properties?: interop.IProvidedServiceOptions): interop.ProvidedServiceOptions;\n\n        /**\n         * Encodes the specified ProvidedServiceOptions message. Does not implicitly {@link interop.ProvidedServiceOptions.verify|verify} messages.\n         * @param message ProvidedServiceOptions message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IProvidedServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a ProvidedServiceOptions message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns ProvidedServiceOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.ProvidedServiceOptions;\n\n        /**\n         * Verifies a ProvidedServiceOptions message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a ProvidedServiceOptions message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns ProvidedServiceOptions\n         */\n        public static fromObject(object: { [k: string]: any }): interop.ProvidedServiceOptions;\n\n        /**\n         * Creates a plain object from a ProvidedServiceOptions message. Also converts values to other types if specified.\n         * @param message ProvidedServiceOptions\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.ProvidedServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this ProvidedServiceOptions to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a ConsumedServiceOptions. */\n    interface IConsumedServiceOptions {\n    }\n\n    /** Represents a ConsumedServiceOptions. */\n    class ConsumedServiceOptions implements IConsumedServiceOptions {\n\n        /**\n         * Constructs a new ConsumedServiceOptions.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IConsumedServiceOptions);\n\n        /**\n         * Creates a new ConsumedServiceOptions instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns ConsumedServiceOptions instance\n         */\n        public static create(properties?: interop.IConsumedServiceOptions): interop.ConsumedServiceOptions;\n\n        /**\n         * Encodes the specified ConsumedServiceOptions message. Does not implicitly {@link interop.ConsumedServiceOptions.verify|verify} messages.\n         * @param message ConsumedServiceOptions message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IConsumedServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a ConsumedServiceOptions message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns ConsumedServiceOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.ConsumedServiceOptions;\n\n        /**\n         * Verifies a ConsumedServiceOptions message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a ConsumedServiceOptions message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns ConsumedServiceOptions\n         */\n        public static fromObject(object: { [k: string]: any }): interop.ConsumedServiceOptions;\n\n        /**\n         * Creates a plain object from a ConsumedServiceOptions message. Also converts values to other types if specified.\n         * @param message ConsumedServiceOptions\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.ConsumedServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this ConsumedServiceOptions to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a ProvidedMethodOptions. */\n    interface IProvidedMethodOptions {\n\n        /** ProvidedMethodOptions title */\n        title?: (string|null);\n\n        /** ProvidedMethodOptions launchOnCall */\n        launchOnCall?: (interop.ApplicationLaunchOnCallMode|null);\n\n        /** ProvidedMethodOptions timeoutMs */\n        timeoutMs?: (number|null);\n    }\n\n    /** Represents a ProvidedMethodOptions. */\n    class ProvidedMethodOptions implements IProvidedMethodOptions {\n\n        /**\n         * Constructs a new ProvidedMethodOptions.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IProvidedMethodOptions);\n\n        /** ProvidedMethodOptions title. */\n        public title: string;\n\n        /** ProvidedMethodOptions launchOnCall. */\n        public launchOnCall: interop.ApplicationLaunchOnCallMode;\n\n        /** ProvidedMethodOptions timeoutMs. */\n        public timeoutMs: number;\n\n        /**\n         * Creates a new ProvidedMethodOptions instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns ProvidedMethodOptions instance\n         */\n        public static create(properties?: interop.IProvidedMethodOptions): interop.ProvidedMethodOptions;\n\n        /**\n         * Encodes the specified ProvidedMethodOptions message. Does not implicitly {@link interop.ProvidedMethodOptions.verify|verify} messages.\n         * @param message ProvidedMethodOptions message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IProvidedMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a ProvidedMethodOptions message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns ProvidedMethodOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.ProvidedMethodOptions;\n\n        /**\n         * Verifies a ProvidedMethodOptions message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a ProvidedMethodOptions message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns ProvidedMethodOptions\n         */\n        public static fromObject(object: { [k: string]: any }): interop.ProvidedMethodOptions;\n\n        /**\n         * Creates a plain object from a ProvidedMethodOptions message. Also converts values to other types if specified.\n         * @param message ProvidedMethodOptions\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.ProvidedMethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this ProvidedMethodOptions to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a ConsumedMethodOptions. */\n    interface IConsumedMethodOptions {\n    }\n\n    /** Represents a ConsumedMethodOptions. */\n    class ConsumedMethodOptions implements IConsumedMethodOptions {\n\n        /**\n         * Constructs a new ConsumedMethodOptions.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IConsumedMethodOptions);\n\n        /**\n         * Creates a new ConsumedMethodOptions instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns ConsumedMethodOptions instance\n         */\n        public static create(properties?: interop.IConsumedMethodOptions): interop.ConsumedMethodOptions;\n\n        /**\n         * Encodes the specified ConsumedMethodOptions message. Does not implicitly {@link interop.ConsumedMethodOptions.verify|verify} messages.\n         * @param message ConsumedMethodOptions message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IConsumedMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a ConsumedMethodOptions message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns ConsumedMethodOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.ConsumedMethodOptions;\n\n        /**\n         * Verifies a ConsumedMethodOptions message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a ConsumedMethodOptions message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns ConsumedMethodOptions\n         */\n        public static fromObject(object: { [k: string]: any }): interop.ConsumedMethodOptions;\n\n        /**\n         * Creates a plain object from a ConsumedMethodOptions message. Also converts values to other types if specified.\n         * @param message ConsumedMethodOptions\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.ConsumedMethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this ConsumedMethodOptions to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** ApplicationLaunchOnCallMode enum. */\n    enum ApplicationLaunchOnCallMode {\n        IF_NOT_LAUNCHED = 0,\n        DEFAULT = 0,\n        ALWAYS = 1,\n        ENABLED = 1,\n        NEVER = 2,\n        DISABLED = 2\n    }\n}\n\n/** Namespace plexus. */\nexport namespace plexus {\n\n    /** Namespace interop. */\n    namespace interop {\n\n        /** Namespace testing. */\n        namespace testing {\n\n            /** Represents an EchoService */\n            class EchoService extends $protobuf.rpc.Service {\n\n                /**\n                 * Constructs a new EchoService service.\n                 * @param rpcImpl RPC implementation\n                 * @param [requestDelimited=false] Whether requests are length-delimited\n                 * @param [responseDelimited=false] Whether responses are length-delimited\n                 */\n                constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n                /**\n                 * Creates new EchoService service using the specified rpc implementation.\n                 * @param rpcImpl RPC implementation\n                 * @param [requestDelimited=false] Whether requests are length-delimited\n                 * @param [responseDelimited=false] Whether responses are length-delimited\n                 * @returns RPC service. Useful where requests and/or responses are streamed.\n                 */\n                public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EchoService;\n\n                /**\n                 * Calls Unary.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public unary(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.UnaryCallback): void;\n\n                /**\n                 * Calls Unary.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public unary(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls ServerStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public serverStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.ServerStreamingCallback): void;\n\n                /**\n                 * Calls ServerStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public serverStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls ClientStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public clientStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.ClientStreamingCallback): void;\n\n                /**\n                 * Calls ClientStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public clientStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @param callback Node-style callback called with the error, if any, and EchoRequest\n                 */\n                public duplexStreaming(request: plexus.interop.testing.IEchoRequest, callback: plexus.interop.testing.EchoService.DuplexStreamingCallback): void;\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @param request EchoRequest message or plain object\n                 * @returns Promise\n                 */\n                public duplexStreaming(request: plexus.interop.testing.IEchoRequest): Promise<plexus.interop.testing.EchoRequest>;\n            }\n\n            namespace EchoService {\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#unary}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type UnaryCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#serverStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type ServerStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#clientStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type ClientStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#duplexStreaming}.\n                 * @param error Error, if any\n                 * @param [response] EchoRequest\n                 */\n                type DuplexStreamingCallback = (error: (Error|null), response?: plexus.interop.testing.EchoRequest) => void;\n            }\n\n            /** Properties of an EchoRequest. */\n            interface IEchoRequest {\n\n                /** EchoRequest stringField */\n                stringField?: (string|null);\n\n                /** EchoRequest int64Field */\n                int64Field?: (Long|null);\n\n                /** EchoRequest uint32Field */\n                uint32Field?: (number|null);\n\n                /** EchoRequest repeatedDoubleField */\n                repeatedDoubleField?: (number[]|null);\n\n                /** EchoRequest enumField */\n                enumField?: (plexus.interop.testing.EchoRequest.SubEnum|null);\n\n                /** EchoRequest subMessageField */\n                subMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage|null);\n\n                /** EchoRequest repeatedSubMessageField */\n                repeatedSubMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage[]|null);\n            }\n\n            /** Represents an EchoRequest. */\n            class EchoRequest implements IEchoRequest {\n\n                /**\n                 * Constructs a new EchoRequest.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: plexus.interop.testing.IEchoRequest);\n\n                /** EchoRequest stringField. */\n                public stringField: string;\n\n                /** EchoRequest int64Field. */\n                public int64Field: Long;\n\n                /** EchoRequest uint32Field. */\n                public uint32Field: number;\n\n                /** EchoRequest repeatedDoubleField. */\n                public repeatedDoubleField: number[];\n\n                /** EchoRequest enumField. */\n                public enumField: plexus.interop.testing.EchoRequest.SubEnum;\n\n                /** EchoRequest subMessageField. */\n                public subMessageField?: (plexus.interop.testing.EchoRequest.ISubMessage|null);\n\n                /** EchoRequest repeatedSubMessageField. */\n                public repeatedSubMessageField: plexus.interop.testing.EchoRequest.ISubMessage[];\n\n                /**\n                 * Creates a new EchoRequest instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns EchoRequest instance\n                 */\n                public static create(properties?: plexus.interop.testing.IEchoRequest): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Encodes the specified EchoRequest message. Does not implicitly {@link plexus.interop.testing.EchoRequest.verify|verify} messages.\n                 * @param message EchoRequest message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: plexus.interop.testing.IEchoRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes an EchoRequest message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns EchoRequest\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Verifies an EchoRequest message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates an EchoRequest message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns EchoRequest\n                 */\n                public static fromObject(object: { [k: string]: any }): plexus.interop.testing.EchoRequest;\n\n                /**\n                 * Creates a plain object from an EchoRequest message. Also converts values to other types if specified.\n                 * @param message EchoRequest\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: plexus.interop.testing.EchoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this EchoRequest to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n\n            namespace EchoRequest {\n\n                /** Properties of a SubMessage. */\n                interface ISubMessage {\n\n                    /** SubMessage bytesField */\n                    bytesField?: (Uint8Array|null);\n\n                    /** SubMessage stringField */\n                    stringField?: (string|null);\n                }\n\n                /** Represents a SubMessage. */\n                class SubMessage implements ISubMessage {\n\n                    /**\n                     * Constructs a new SubMessage.\n                     * @param [properties] Properties to set\n                     */\n                    constructor(properties?: plexus.interop.testing.EchoRequest.ISubMessage);\n\n                    /** SubMessage bytesField. */\n                    public bytesField: Uint8Array;\n\n                    /** SubMessage stringField. */\n                    public stringField: string;\n\n                    /**\n                     * Creates a new SubMessage instance using the specified properties.\n                     * @param [properties] Properties to set\n                     * @returns SubMessage instance\n                     */\n                    public static create(properties?: plexus.interop.testing.EchoRequest.ISubMessage): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Encodes the specified SubMessage message. Does not implicitly {@link plexus.interop.testing.EchoRequest.SubMessage.verify|verify} messages.\n                     * @param message SubMessage message or plain object to encode\n                     * @param [writer] Writer to encode to\n                     * @returns Writer\n                     */\n                    public static encode(message: plexus.interop.testing.EchoRequest.ISubMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                    /**\n                     * Decodes a SubMessage message from the specified reader or buffer.\n                     * @param reader Reader or buffer to decode from\n                     * @param [length] Message length if known beforehand\n                     * @returns SubMessage\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Verifies a SubMessage message.\n                     * @param message Plain object to verify\n                     * @returns `null` if valid, otherwise the reason why it is not\n                     */\n                    public static verify(message: { [k: string]: any }): (string|null);\n\n                    /**\n                     * Creates a SubMessage message from a plain object. Also converts values to their respective internal types.\n                     * @param object Plain object\n                     * @returns SubMessage\n                     */\n                    public static fromObject(object: { [k: string]: any }): plexus.interop.testing.EchoRequest.SubMessage;\n\n                    /**\n                     * Creates a plain object from a SubMessage message. Also converts values to other types if specified.\n                     * @param message SubMessage\n                     * @param [options] Conversion options\n                     * @returns Plain object\n                     */\n                    public static toObject(message: plexus.interop.testing.EchoRequest.SubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                    /**\n                     * Converts this SubMessage to JSON.\n                     * @returns JSON object\n                     */\n                    public toJSON(): { [k: string]: any };\n                }\n\n                /** SubEnum enum. */\n                enum SubEnum {\n                    VALUE_ONE = 0,\n                    VALUE_TWO = 1\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "web/packages/e2e/src/echo/server/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2021 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.plexus || ($protobuf.roots.plexus = {});\n\n$root.interop = (function() {\n\n    /**\n     * Namespace interop.\n     * @exports interop\n     * @namespace\n     */\n    var interop = {};\n\n    interop.ApplicationOptions = (function() {\n\n        /**\n         * Properties of an ApplicationOptions.\n         * @memberof interop\n         * @interface IApplicationOptions\n         * @property {string|null} [title] ApplicationOptions title\n         * @property {interop.ApplicationLaunchOnCallMode|null} [launchOnCall] ApplicationOptions launchOnCall\n         */\n\n        /**\n         * Constructs a new ApplicationOptions.\n         * @memberof interop\n         * @classdesc Represents an ApplicationOptions.\n         * @implements IApplicationOptions\n         * @constructor\n         * @param {interop.IApplicationOptions=} [properties] Properties to set\n         */\n        function ApplicationOptions(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * ApplicationOptions title.\n         * @member {string} title\n         * @memberof interop.ApplicationOptions\n         * @instance\n         */\n        ApplicationOptions.prototype.title = \"\";\n\n        /**\n         * ApplicationOptions launchOnCall.\n         * @member {interop.ApplicationLaunchOnCallMode} launchOnCall\n         * @memberof interop.ApplicationOptions\n         * @instance\n         */\n        ApplicationOptions.prototype.launchOnCall = 0;\n\n        /**\n         * Creates a new ApplicationOptions instance using the specified properties.\n         * @function create\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {interop.IApplicationOptions=} [properties] Properties to set\n         * @returns {interop.ApplicationOptions} ApplicationOptions instance\n         */\n        ApplicationOptions.create = function create(properties) {\n            return new ApplicationOptions(properties);\n        };\n\n        /**\n         * Encodes the specified ApplicationOptions message. Does not implicitly {@link interop.ApplicationOptions.verify|verify} messages.\n         * @function encode\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {interop.IApplicationOptions} message ApplicationOptions message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        ApplicationOptions.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.title != null && Object.hasOwnProperty.call(message, \"title\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);\n            if (message.launchOnCall != null && Object.hasOwnProperty.call(message, \"launchOnCall\"))\n                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchOnCall);\n            return writer;\n        };\n\n        /**\n         * Decodes an ApplicationOptions message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.ApplicationOptions} ApplicationOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        ApplicationOptions.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.ApplicationOptions();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.title = reader.string();\n                    break;\n                case 2:\n                    message.launchOnCall = reader.int32();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Verifies an ApplicationOptions message.\n         * @function verify\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        ApplicationOptions.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                if (!$util.isString(message.title))\n                    return \"title: string expected\";\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                switch (message.launchOnCall) {\n                default:\n                    return \"launchOnCall: enum value expected\";\n                case 0:\n                case 0:\n                case 1:\n                case 1:\n                case 2:\n                case 2:\n                    break;\n                }\n            return null;\n        };\n\n        /**\n         * Creates an ApplicationOptions message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.ApplicationOptions} ApplicationOptions\n         */\n        ApplicationOptions.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.ApplicationOptions)\n                return object;\n            var message = new $root.interop.ApplicationOptions();\n            if (object.title != null)\n                message.title = String(object.title);\n            switch (object.launchOnCall) {\n            case \"IF_NOT_LAUNCHED\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"DEFAULT\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"ALWAYS\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"ENABLED\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"NEVER\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            case \"DISABLED\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from an ApplicationOptions message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.ApplicationOptions\n         * @static\n         * @param {interop.ApplicationOptions} message ApplicationOptions\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        ApplicationOptions.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.title = \"\";\n                object.launchOnCall = options.enums === String ? \"IF_NOT_LAUNCHED\" : 0;\n            }\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                object.title = message.title;\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                object.launchOnCall = options.enums === String ? $root.interop.ApplicationLaunchOnCallMode[message.launchOnCall] : message.launchOnCall;\n            return object;\n        };\n\n        /**\n         * Converts this ApplicationOptions to JSON.\n         * @function toJSON\n         * @memberof interop.ApplicationOptions\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        ApplicationOptions.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return ApplicationOptions;\n    })();\n\n    interop.ProvidedServiceOptions = (function() {\n\n        /**\n         * Properties of a ProvidedServiceOptions.\n         * @memberof interop\n         * @interface IProvidedServiceOptions\n         * @property {string|null} [title] ProvidedServiceOptions title\n         * @property {interop.ApplicationLaunchOnCallMode|null} [launchOnCall] ProvidedServiceOptions launchOnCall\n         */\n\n        /**\n         * Constructs a new ProvidedServiceOptions.\n         * @memberof interop\n         * @classdesc Represents a ProvidedServiceOptions.\n         * @implements IProvidedServiceOptions\n         * @constructor\n         * @param {interop.IProvidedServiceOptions=} [properties] Properties to set\n         */\n        function ProvidedServiceOptions(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * ProvidedServiceOptions title.\n         * @member {string} title\n         * @memberof interop.ProvidedServiceOptions\n         * @instance\n         */\n        ProvidedServiceOptions.prototype.title = \"\";\n\n        /**\n         * ProvidedServiceOptions launchOnCall.\n         * @member {interop.ApplicationLaunchOnCallMode} launchOnCall\n         * @memberof interop.ProvidedServiceOptions\n         * @instance\n         */\n        ProvidedServiceOptions.prototype.launchOnCall = 0;\n\n        /**\n         * Creates a new ProvidedServiceOptions instance using the specified properties.\n         * @function create\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {interop.IProvidedServiceOptions=} [properties] Properties to set\n         * @returns {interop.ProvidedServiceOptions} ProvidedServiceOptions instance\n         */\n        ProvidedServiceOptions.create = function create(properties) {\n            return new ProvidedServiceOptions(properties);\n        };\n\n        /**\n         * Encodes the specified ProvidedServiceOptions message. Does not implicitly {@link interop.ProvidedServiceOptions.verify|verify} messages.\n         * @function encode\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {interop.IProvidedServiceOptions} message ProvidedServiceOptions message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        ProvidedServiceOptions.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.title != null && Object.hasOwnProperty.call(message, \"title\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);\n            if (message.launchOnCall != null && Object.hasOwnProperty.call(message, \"launchOnCall\"))\n                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchOnCall);\n            return writer;\n        };\n\n        /**\n         * Decodes a ProvidedServiceOptions message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.ProvidedServiceOptions} ProvidedServiceOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        ProvidedServiceOptions.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.ProvidedServiceOptions();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.title = reader.string();\n                    break;\n                case 2:\n                    message.launchOnCall = reader.int32();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Verifies a ProvidedServiceOptions message.\n         * @function verify\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        ProvidedServiceOptions.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                if (!$util.isString(message.title))\n                    return \"title: string expected\";\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                switch (message.launchOnCall) {\n                default:\n                    return \"launchOnCall: enum value expected\";\n                case 0:\n                case 0:\n                case 1:\n                case 1:\n                case 2:\n                case 2:\n                    break;\n                }\n            return null;\n        };\n\n        /**\n         * Creates a ProvidedServiceOptions message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.ProvidedServiceOptions} ProvidedServiceOptions\n         */\n        ProvidedServiceOptions.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.ProvidedServiceOptions)\n                return object;\n            var message = new $root.interop.ProvidedServiceOptions();\n            if (object.title != null)\n                message.title = String(object.title);\n            switch (object.launchOnCall) {\n            case \"IF_NOT_LAUNCHED\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"DEFAULT\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"ALWAYS\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"ENABLED\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"NEVER\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            case \"DISABLED\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a ProvidedServiceOptions message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.ProvidedServiceOptions\n         * @static\n         * @param {interop.ProvidedServiceOptions} message ProvidedServiceOptions\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        ProvidedServiceOptions.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.title = \"\";\n                object.launchOnCall = options.enums === String ? \"IF_NOT_LAUNCHED\" : 0;\n            }\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                object.title = message.title;\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                object.launchOnCall = options.enums === String ? $root.interop.ApplicationLaunchOnCallMode[message.launchOnCall] : message.launchOnCall;\n            return object;\n        };\n\n        /**\n         * Converts this ProvidedServiceOptions to JSON.\n         * @function toJSON\n         * @memberof interop.ProvidedServiceOptions\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        ProvidedServiceOptions.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return ProvidedServiceOptions;\n    })();\n\n    interop.ConsumedServiceOptions = (function() {\n\n        /**\n         * Properties of a ConsumedServiceOptions.\n         * @memberof interop\n         * @interface IConsumedServiceOptions\n         */\n\n        /**\n         * Constructs a new ConsumedServiceOptions.\n         * @memberof interop\n         * @classdesc Represents a ConsumedServiceOptions.\n         * @implements IConsumedServiceOptions\n         * @constructor\n         * @param {interop.IConsumedServiceOptions=} [properties] Properties to set\n         */\n        function ConsumedServiceOptions(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * Creates a new ConsumedServiceOptions instance using the specified properties.\n         * @function create\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {interop.IConsumedServiceOptions=} [properties] Properties to set\n         * @returns {interop.ConsumedServiceOptions} ConsumedServiceOptions instance\n         */\n        ConsumedServiceOptions.create = function create(properties) {\n            return new ConsumedServiceOptions(properties);\n        };\n\n        /**\n         * Encodes the specified ConsumedServiceOptions message. Does not implicitly {@link interop.ConsumedServiceOptions.verify|verify} messages.\n         * @function encode\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {interop.IConsumedServiceOptions} message ConsumedServiceOptions message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        ConsumedServiceOptions.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            return writer;\n        };\n\n        /**\n         * Decodes a ConsumedServiceOptions message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.ConsumedServiceOptions} ConsumedServiceOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        ConsumedServiceOptions.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.ConsumedServiceOptions();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Verifies a ConsumedServiceOptions message.\n         * @function verify\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        ConsumedServiceOptions.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            return null;\n        };\n\n        /**\n         * Creates a ConsumedServiceOptions message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.ConsumedServiceOptions} ConsumedServiceOptions\n         */\n        ConsumedServiceOptions.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.ConsumedServiceOptions)\n                return object;\n            return new $root.interop.ConsumedServiceOptions();\n        };\n\n        /**\n         * Creates a plain object from a ConsumedServiceOptions message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.ConsumedServiceOptions\n         * @static\n         * @param {interop.ConsumedServiceOptions} message ConsumedServiceOptions\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        ConsumedServiceOptions.toObject = function toObject() {\n            return {};\n        };\n\n        /**\n         * Converts this ConsumedServiceOptions to JSON.\n         * @function toJSON\n         * @memberof interop.ConsumedServiceOptions\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        ConsumedServiceOptions.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return ConsumedServiceOptions;\n    })();\n\n    interop.ProvidedMethodOptions = (function() {\n\n        /**\n         * Properties of a ProvidedMethodOptions.\n         * @memberof interop\n         * @interface IProvidedMethodOptions\n         * @property {string|null} [title] ProvidedMethodOptions title\n         * @property {interop.ApplicationLaunchOnCallMode|null} [launchOnCall] ProvidedMethodOptions launchOnCall\n         * @property {number|null} [timeoutMs] ProvidedMethodOptions timeoutMs\n         */\n\n        /**\n         * Constructs a new ProvidedMethodOptions.\n         * @memberof interop\n         * @classdesc Represents a ProvidedMethodOptions.\n         * @implements IProvidedMethodOptions\n         * @constructor\n         * @param {interop.IProvidedMethodOptions=} [properties] Properties to set\n         */\n        function ProvidedMethodOptions(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * ProvidedMethodOptions title.\n         * @member {string} title\n         * @memberof interop.ProvidedMethodOptions\n         * @instance\n         */\n        ProvidedMethodOptions.prototype.title = \"\";\n\n        /**\n         * ProvidedMethodOptions launchOnCall.\n         * @member {interop.ApplicationLaunchOnCallMode} launchOnCall\n         * @memberof interop.ProvidedMethodOptions\n         * @instance\n         */\n        ProvidedMethodOptions.prototype.launchOnCall = 0;\n\n        /**\n         * ProvidedMethodOptions timeoutMs.\n         * @member {number} timeoutMs\n         * @memberof interop.ProvidedMethodOptions\n         * @instance\n         */\n        ProvidedMethodOptions.prototype.timeoutMs = 0;\n\n        /**\n         * Creates a new ProvidedMethodOptions instance using the specified properties.\n         * @function create\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {interop.IProvidedMethodOptions=} [properties] Properties to set\n         * @returns {interop.ProvidedMethodOptions} ProvidedMethodOptions instance\n         */\n        ProvidedMethodOptions.create = function create(properties) {\n            return new ProvidedMethodOptions(properties);\n        };\n\n        /**\n         * Encodes the specified ProvidedMethodOptions message. Does not implicitly {@link interop.ProvidedMethodOptions.verify|verify} messages.\n         * @function encode\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {interop.IProvidedMethodOptions} message ProvidedMethodOptions message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        ProvidedMethodOptions.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.title != null && Object.hasOwnProperty.call(message, \"title\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);\n            if (message.launchOnCall != null && Object.hasOwnProperty.call(message, \"launchOnCall\"))\n                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchOnCall);\n            if (message.timeoutMs != null && Object.hasOwnProperty.call(message, \"timeoutMs\"))\n                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.timeoutMs);\n            return writer;\n        };\n\n        /**\n         * Decodes a ProvidedMethodOptions message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.ProvidedMethodOptions} ProvidedMethodOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        ProvidedMethodOptions.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.ProvidedMethodOptions();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.title = reader.string();\n                    break;\n                case 2:\n                    message.launchOnCall = reader.int32();\n                    break;\n                case 3:\n                    message.timeoutMs = reader.uint32();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Verifies a ProvidedMethodOptions message.\n         * @function verify\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        ProvidedMethodOptions.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                if (!$util.isString(message.title))\n                    return \"title: string expected\";\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                switch (message.launchOnCall) {\n                default:\n                    return \"launchOnCall: enum value expected\";\n                case 0:\n                case 0:\n                case 1:\n                case 1:\n                case 2:\n                case 2:\n                    break;\n                }\n            if (message.timeoutMs != null && message.hasOwnProperty(\"timeoutMs\"))\n                if (!$util.isInteger(message.timeoutMs))\n                    return \"timeoutMs: integer expected\";\n            return null;\n        };\n\n        /**\n         * Creates a ProvidedMethodOptions message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.ProvidedMethodOptions} ProvidedMethodOptions\n         */\n        ProvidedMethodOptions.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.ProvidedMethodOptions)\n                return object;\n            var message = new $root.interop.ProvidedMethodOptions();\n            if (object.title != null)\n                message.title = String(object.title);\n            switch (object.launchOnCall) {\n            case \"IF_NOT_LAUNCHED\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"DEFAULT\":\n            case 0:\n                message.launchOnCall = 0;\n                break;\n            case \"ALWAYS\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"ENABLED\":\n            case 1:\n                message.launchOnCall = 1;\n                break;\n            case \"NEVER\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            case \"DISABLED\":\n            case 2:\n                message.launchOnCall = 2;\n                break;\n            }\n            if (object.timeoutMs != null)\n                message.timeoutMs = object.timeoutMs >>> 0;\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a ProvidedMethodOptions message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.ProvidedMethodOptions\n         * @static\n         * @param {interop.ProvidedMethodOptions} message ProvidedMethodOptions\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        ProvidedMethodOptions.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.title = \"\";\n                object.launchOnCall = options.enums === String ? \"IF_NOT_LAUNCHED\" : 0;\n                object.timeoutMs = 0;\n            }\n            if (message.title != null && message.hasOwnProperty(\"title\"))\n                object.title = message.title;\n            if (message.launchOnCall != null && message.hasOwnProperty(\"launchOnCall\"))\n                object.launchOnCall = options.enums === String ? $root.interop.ApplicationLaunchOnCallMode[message.launchOnCall] : message.launchOnCall;\n            if (message.timeoutMs != null && message.hasOwnProperty(\"timeoutMs\"))\n                object.timeoutMs = message.timeoutMs;\n            return object;\n        };\n\n        /**\n         * Converts this ProvidedMethodOptions to JSON.\n         * @function toJSON\n         * @memberof interop.ProvidedMethodOptions\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        ProvidedMethodOptions.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return ProvidedMethodOptions;\n    })();\n\n    interop.ConsumedMethodOptions = (function() {\n\n        /**\n         * Properties of a ConsumedMethodOptions.\n         * @memberof interop\n         * @interface IConsumedMethodOptions\n         */\n\n        /**\n         * Constructs a new ConsumedMethodOptions.\n         * @memberof interop\n         * @classdesc Represents a ConsumedMethodOptions.\n         * @implements IConsumedMethodOptions\n         * @constructor\n         * @param {interop.IConsumedMethodOptions=} [properties] Properties to set\n         */\n        function ConsumedMethodOptions(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * Creates a new ConsumedMethodOptions instance using the specified properties.\n         * @function create\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {interop.IConsumedMethodOptions=} [properties] Properties to set\n         * @returns {interop.ConsumedMethodOptions} ConsumedMethodOptions instance\n         */\n        ConsumedMethodOptions.create = function create(properties) {\n            return new ConsumedMethodOptions(properties);\n        };\n\n        /**\n         * Encodes the specified ConsumedMethodOptions message. Does not implicitly {@link interop.ConsumedMethodOptions.verify|verify} messages.\n         * @function encode\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {interop.IConsumedMethodOptions} message ConsumedMethodOptions message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        ConsumedMethodOptions.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            return writer;\n        };\n\n        /**\n         * Decodes a ConsumedMethodOptions message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.ConsumedMethodOptions} ConsumedMethodOptions\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        ConsumedMethodOptions.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.ConsumedMethodOptions();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Verifies a ConsumedMethodOptions message.\n         * @function verify\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        ConsumedMethodOptions.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            return null;\n        };\n\n        /**\n         * Creates a ConsumedMethodOptions message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.ConsumedMethodOptions} ConsumedMethodOptions\n         */\n        ConsumedMethodOptions.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.ConsumedMethodOptions)\n                return object;\n            return new $root.interop.ConsumedMethodOptions();\n        };\n\n        /**\n         * Creates a plain object from a ConsumedMethodOptions message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.ConsumedMethodOptions\n         * @static\n         * @param {interop.ConsumedMethodOptions} message ConsumedMethodOptions\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        ConsumedMethodOptions.toObject = function toObject() {\n            return {};\n        };\n\n        /**\n         * Converts this ConsumedMethodOptions to JSON.\n         * @function toJSON\n         * @memberof interop.ConsumedMethodOptions\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        ConsumedMethodOptions.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return ConsumedMethodOptions;\n    })();\n\n    /**\n     * ApplicationLaunchOnCallMode enum.\n     * @name interop.ApplicationLaunchOnCallMode\n     * @enum {number}\n     * @property {number} IF_NOT_LAUNCHED=0 IF_NOT_LAUNCHED value\n     * @property {number} DEFAULT=0 DEFAULT value\n     * @property {number} ALWAYS=1 ALWAYS value\n     * @property {number} ENABLED=1 ENABLED value\n     * @property {number} NEVER=2 NEVER value\n     * @property {number} DISABLED=2 DISABLED value\n     */\n    interop.ApplicationLaunchOnCallMode = (function() {\n        var valuesById = {}, values = Object.create(valuesById);\n        values[valuesById[0] = \"IF_NOT_LAUNCHED\"] = 0;\n        values[\"DEFAULT\"] = 0;\n        values[valuesById[1] = \"ALWAYS\"] = 1;\n        values[\"ENABLED\"] = 1;\n        values[valuesById[2] = \"NEVER\"] = 2;\n        values[\"DISABLED\"] = 2;\n        return values;\n    })();\n\n    return interop;\n})();\n\n$root.plexus = (function() {\n\n    /**\n     * Namespace plexus.\n     * @exports plexus\n     * @namespace\n     */\n    var plexus = {};\n\n    plexus.interop = (function() {\n\n        /**\n         * Namespace interop.\n         * @memberof plexus\n         * @namespace\n         */\n        var interop = {};\n\n        interop.testing = (function() {\n\n            /**\n             * Namespace testing.\n             * @memberof plexus.interop\n             * @namespace\n             */\n            var testing = {};\n\n            testing.EchoService = (function() {\n\n                /**\n                 * Constructs a new EchoService service.\n                 * @memberof plexus.interop.testing\n                 * @classdesc Represents an EchoService\n                 * @extends $protobuf.rpc.Service\n                 * @constructor\n                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n                 */\n                function EchoService(rpcImpl, requestDelimited, responseDelimited) {\n                    $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n                }\n\n                (EchoService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EchoService;\n\n                /**\n                 * Creates new EchoService service using the specified rpc implementation.\n                 * @function create\n                 * @memberof plexus.interop.testing.EchoService\n                 * @static\n                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n                 * @returns {EchoService} RPC service. Useful where requests and/or responses are streamed.\n                 */\n                EchoService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n                    return new this(rpcImpl, requestDelimited, responseDelimited);\n                };\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#unary}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef UnaryCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls Unary.\n                 * @function unary\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.UnaryCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.unary = function unary(request, callback) {\n                    return this.rpcCall(unary, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"Unary\" });\n\n                /**\n                 * Calls Unary.\n                 * @function unary\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#serverStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef ServerStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls ServerStreaming.\n                 * @function serverStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.ServerStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.serverStreaming = function serverStreaming(request, callback) {\n                    return this.rpcCall(serverStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"ServerStreaming\" });\n\n                /**\n                 * Calls ServerStreaming.\n                 * @function serverStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#clientStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef ClientStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls ClientStreaming.\n                 * @function clientStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.ClientStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.clientStreaming = function clientStreaming(request, callback) {\n                    return this.rpcCall(clientStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"ClientStreaming\" });\n\n                /**\n                 * Calls ClientStreaming.\n                 * @function clientStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                /**\n                 * Callback as used by {@link plexus.interop.testing.EchoService#duplexStreaming}.\n                 * @memberof plexus.interop.testing.EchoService\n                 * @typedef DuplexStreamingCallback\n                 * @type {function}\n                 * @param {Error|null} error Error, if any\n                 * @param {plexus.interop.testing.EchoRequest} [response] EchoRequest\n                 */\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @function duplexStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @param {plexus.interop.testing.EchoService.DuplexStreamingCallback} callback Node-style callback called with the error, if any, and EchoRequest\n                 * @returns {undefined}\n                 * @variation 1\n                 */\n                Object.defineProperty(EchoService.prototype.duplexStreaming = function duplexStreaming(request, callback) {\n                    return this.rpcCall(duplexStreaming, $root.plexus.interop.testing.EchoRequest, $root.plexus.interop.testing.EchoRequest, request, callback);\n                }, \"name\", { value: \"DuplexStreaming\" });\n\n                /**\n                 * Calls DuplexStreaming.\n                 * @function duplexStreaming\n                 * @memberof plexus.interop.testing.EchoService\n                 * @instance\n                 * @param {plexus.interop.testing.IEchoRequest} request EchoRequest message or plain object\n                 * @returns {Promise<plexus.interop.testing.EchoRequest>} Promise\n                 * @variation 2\n                 */\n\n                return EchoService;\n            })();\n\n            testing.EchoRequest = (function() {\n\n                /**\n                 * Properties of an EchoRequest.\n                 * @memberof plexus.interop.testing\n                 * @interface IEchoRequest\n                 * @property {string|null} [stringField] EchoRequest stringField\n                 * @property {Long|null} [int64Field] EchoRequest int64Field\n                 * @property {number|null} [uint32Field] EchoRequest uint32Field\n                 * @property {Array.<number>|null} [repeatedDoubleField] EchoRequest repeatedDoubleField\n                 * @property {plexus.interop.testing.EchoRequest.SubEnum|null} [enumField] EchoRequest enumField\n                 * @property {plexus.interop.testing.EchoRequest.ISubMessage|null} [subMessageField] EchoRequest subMessageField\n                 * @property {Array.<plexus.interop.testing.EchoRequest.ISubMessage>|null} [repeatedSubMessageField] EchoRequest repeatedSubMessageField\n                 */\n\n                /**\n                 * Constructs a new EchoRequest.\n                 * @memberof plexus.interop.testing\n                 * @classdesc Represents an EchoRequest.\n                 * @implements IEchoRequest\n                 * @constructor\n                 * @param {plexus.interop.testing.IEchoRequest=} [properties] Properties to set\n                 */\n                function EchoRequest(properties) {\n                    this.repeatedDoubleField = [];\n                    this.repeatedSubMessageField = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * EchoRequest stringField.\n                 * @member {string} stringField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.stringField = \"\";\n\n                /**\n                 * EchoRequest int64Field.\n                 * @member {Long} int64Field\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.int64Field = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n                /**\n                 * EchoRequest uint32Field.\n                 * @member {number} uint32Field\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.uint32Field = 0;\n\n                /**\n                 * EchoRequest repeatedDoubleField.\n                 * @member {Array.<number>} repeatedDoubleField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.repeatedDoubleField = $util.emptyArray;\n\n                /**\n                 * EchoRequest enumField.\n                 * @member {plexus.interop.testing.EchoRequest.SubEnum} enumField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.enumField = 0;\n\n                /**\n                 * EchoRequest subMessageField.\n                 * @member {plexus.interop.testing.EchoRequest.ISubMessage|null|undefined} subMessageField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.subMessageField = null;\n\n                /**\n                 * EchoRequest repeatedSubMessageField.\n                 * @member {Array.<plexus.interop.testing.EchoRequest.ISubMessage>} repeatedSubMessageField\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 */\n                EchoRequest.prototype.repeatedSubMessageField = $util.emptyArray;\n\n                /**\n                 * Creates a new EchoRequest instance using the specified properties.\n                 * @function create\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.IEchoRequest=} [properties] Properties to set\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest instance\n                 */\n                EchoRequest.create = function create(properties) {\n                    return new EchoRequest(properties);\n                };\n\n                /**\n                 * Encodes the specified EchoRequest message. Does not implicitly {@link plexus.interop.testing.EchoRequest.verify|verify} messages.\n                 * @function encode\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.IEchoRequest} message EchoRequest message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                EchoRequest.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.stringField != null && Object.hasOwnProperty.call(message, \"stringField\"))\n                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringField);\n                    if (message.int64Field != null && Object.hasOwnProperty.call(message, \"int64Field\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int64(message.int64Field);\n                    if (message.uint32Field != null && Object.hasOwnProperty.call(message, \"uint32Field\"))\n                        writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.uint32Field);\n                    if (message.repeatedDoubleField != null && message.repeatedDoubleField.length) {\n                        writer.uint32(/* id 4, wireType 2 =*/34).fork();\n                        for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                            writer.double(message.repeatedDoubleField[i]);\n                        writer.ldelim();\n                    }\n                    if (message.enumField != null && Object.hasOwnProperty.call(message, \"enumField\"))\n                        writer.uint32(/* id 5, wireType 0 =*/40).int32(message.enumField);\n                    if (message.subMessageField != null && Object.hasOwnProperty.call(message, \"subMessageField\"))\n                        $root.plexus.interop.testing.EchoRequest.SubMessage.encode(message.subMessageField, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                    if (message.repeatedSubMessageField != null && message.repeatedSubMessageField.length)\n                        for (var i = 0; i < message.repeatedSubMessageField.length; ++i)\n                            $root.plexus.interop.testing.EchoRequest.SubMessage.encode(message.repeatedSubMessageField[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                    return writer;\n                };\n\n                /**\n                 * Decodes an EchoRequest message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                EchoRequest.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.plexus.interop.testing.EchoRequest();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.stringField = reader.string();\n                            break;\n                        case 2:\n                            message.int64Field = reader.int64();\n                            break;\n                        case 3:\n                            message.uint32Field = reader.uint32();\n                            break;\n                        case 4:\n                            if (!(message.repeatedDoubleField && message.repeatedDoubleField.length))\n                                message.repeatedDoubleField = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.repeatedDoubleField.push(reader.double());\n                            } else\n                                message.repeatedDoubleField.push(reader.double());\n                            break;\n                        case 5:\n                            message.enumField = reader.int32();\n                            break;\n                        case 6:\n                            message.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.decode(reader, reader.uint32());\n                            break;\n                        case 7:\n                            if (!(message.repeatedSubMessageField && message.repeatedSubMessageField.length))\n                                message.repeatedSubMessageField = [];\n                            message.repeatedSubMessageField.push($root.plexus.interop.testing.EchoRequest.SubMessage.decode(reader, reader.uint32()));\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Verifies an EchoRequest message.\n                 * @function verify\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                EchoRequest.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                        if (!$util.isString(message.stringField))\n                            return \"stringField: string expected\";\n                    if (message.int64Field != null && message.hasOwnProperty(\"int64Field\"))\n                        if (!$util.isInteger(message.int64Field) && !(message.int64Field && $util.isInteger(message.int64Field.low) && $util.isInteger(message.int64Field.high)))\n                            return \"int64Field: integer|Long expected\";\n                    if (message.uint32Field != null && message.hasOwnProperty(\"uint32Field\"))\n                        if (!$util.isInteger(message.uint32Field))\n                            return \"uint32Field: integer expected\";\n                    if (message.repeatedDoubleField != null && message.hasOwnProperty(\"repeatedDoubleField\")) {\n                        if (!Array.isArray(message.repeatedDoubleField))\n                            return \"repeatedDoubleField: array expected\";\n                        for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                            if (typeof message.repeatedDoubleField[i] !== \"number\")\n                                return \"repeatedDoubleField: number[] expected\";\n                    }\n                    if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                        switch (message.enumField) {\n                        default:\n                            return \"enumField: enum value expected\";\n                        case 0:\n                        case 1:\n                            break;\n                        }\n                    if (message.subMessageField != null && message.hasOwnProperty(\"subMessageField\")) {\n                        var error = $root.plexus.interop.testing.EchoRequest.SubMessage.verify(message.subMessageField);\n                        if (error)\n                            return \"subMessageField.\" + error;\n                    }\n                    if (message.repeatedSubMessageField != null && message.hasOwnProperty(\"repeatedSubMessageField\")) {\n                        if (!Array.isArray(message.repeatedSubMessageField))\n                            return \"repeatedSubMessageField: array expected\";\n                        for (var i = 0; i < message.repeatedSubMessageField.length; ++i) {\n                            var error = $root.plexus.interop.testing.EchoRequest.SubMessage.verify(message.repeatedSubMessageField[i]);\n                            if (error)\n                                return \"repeatedSubMessageField.\" + error;\n                        }\n                    }\n                    return null;\n                };\n\n                /**\n                 * Creates an EchoRequest message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {plexus.interop.testing.EchoRequest} EchoRequest\n                 */\n                EchoRequest.fromObject = function fromObject(object) {\n                    if (object instanceof $root.plexus.interop.testing.EchoRequest)\n                        return object;\n                    var message = new $root.plexus.interop.testing.EchoRequest();\n                    if (object.stringField != null)\n                        message.stringField = String(object.stringField);\n                    if (object.int64Field != null)\n                        if ($util.Long)\n                            (message.int64Field = $util.Long.fromValue(object.int64Field)).unsigned = false;\n                        else if (typeof object.int64Field === \"string\")\n                            message.int64Field = parseInt(object.int64Field, 10);\n                        else if (typeof object.int64Field === \"number\")\n                            message.int64Field = object.int64Field;\n                        else if (typeof object.int64Field === \"object\")\n                            message.int64Field = new $util.LongBits(object.int64Field.low >>> 0, object.int64Field.high >>> 0).toNumber();\n                    if (object.uint32Field != null)\n                        message.uint32Field = object.uint32Field >>> 0;\n                    if (object.repeatedDoubleField) {\n                        if (!Array.isArray(object.repeatedDoubleField))\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedDoubleField: array expected\");\n                        message.repeatedDoubleField = [];\n                        for (var i = 0; i < object.repeatedDoubleField.length; ++i)\n                            message.repeatedDoubleField[i] = Number(object.repeatedDoubleField[i]);\n                    }\n                    switch (object.enumField) {\n                    case \"VALUE_ONE\":\n                    case 0:\n                        message.enumField = 0;\n                        break;\n                    case \"VALUE_TWO\":\n                    case 1:\n                        message.enumField = 1;\n                        break;\n                    }\n                    if (object.subMessageField != null) {\n                        if (typeof object.subMessageField !== \"object\")\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.subMessageField: object expected\");\n                        message.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.fromObject(object.subMessageField);\n                    }\n                    if (object.repeatedSubMessageField) {\n                        if (!Array.isArray(object.repeatedSubMessageField))\n                            throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedSubMessageField: array expected\");\n                        message.repeatedSubMessageField = [];\n                        for (var i = 0; i < object.repeatedSubMessageField.length; ++i) {\n                            if (typeof object.repeatedSubMessageField[i] !== \"object\")\n                                throw TypeError(\".plexus.interop.testing.EchoRequest.repeatedSubMessageField: object expected\");\n                            message.repeatedSubMessageField[i] = $root.plexus.interop.testing.EchoRequest.SubMessage.fromObject(object.repeatedSubMessageField[i]);\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an EchoRequest message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @static\n                 * @param {plexus.interop.testing.EchoRequest} message EchoRequest\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                EchoRequest.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults) {\n                        object.repeatedDoubleField = [];\n                        object.repeatedSubMessageField = [];\n                    }\n                    if (options.defaults) {\n                        object.stringField = \"\";\n                        if ($util.Long) {\n                            var long = new $util.Long(0, 0, false);\n                            object.int64Field = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                        } else\n                            object.int64Field = options.longs === String ? \"0\" : 0;\n                        object.uint32Field = 0;\n                        object.enumField = options.enums === String ? \"VALUE_ONE\" : 0;\n                        object.subMessageField = null;\n                    }\n                    if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                        object.stringField = message.stringField;\n                    if (message.int64Field != null && message.hasOwnProperty(\"int64Field\"))\n                        if (typeof message.int64Field === \"number\")\n                            object.int64Field = options.longs === String ? String(message.int64Field) : message.int64Field;\n                        else\n                            object.int64Field = options.longs === String ? $util.Long.prototype.toString.call(message.int64Field) : options.longs === Number ? new $util.LongBits(message.int64Field.low >>> 0, message.int64Field.high >>> 0).toNumber() : message.int64Field;\n                    if (message.uint32Field != null && message.hasOwnProperty(\"uint32Field\"))\n                        object.uint32Field = message.uint32Field;\n                    if (message.repeatedDoubleField && message.repeatedDoubleField.length) {\n                        object.repeatedDoubleField = [];\n                        for (var j = 0; j < message.repeatedDoubleField.length; ++j)\n                            object.repeatedDoubleField[j] = options.json && !isFinite(message.repeatedDoubleField[j]) ? String(message.repeatedDoubleField[j]) : message.repeatedDoubleField[j];\n                    }\n                    if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                        object.enumField = options.enums === String ? $root.plexus.interop.testing.EchoRequest.SubEnum[message.enumField] : message.enumField;\n                    if (message.subMessageField != null && message.hasOwnProperty(\"subMessageField\"))\n                        object.subMessageField = $root.plexus.interop.testing.EchoRequest.SubMessage.toObject(message.subMessageField, options);\n                    if (message.repeatedSubMessageField && message.repeatedSubMessageField.length) {\n                        object.repeatedSubMessageField = [];\n                        for (var j = 0; j < message.repeatedSubMessageField.length; ++j)\n                            object.repeatedSubMessageField[j] = $root.plexus.interop.testing.EchoRequest.SubMessage.toObject(message.repeatedSubMessageField[j], options);\n                    }\n                    return object;\n                };\n\n                /**\n                 * Converts this EchoRequest to JSON.\n                 * @function toJSON\n                 * @memberof plexus.interop.testing.EchoRequest\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                EchoRequest.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                EchoRequest.SubMessage = (function() {\n\n                    /**\n                     * Properties of a SubMessage.\n                     * @memberof plexus.interop.testing.EchoRequest\n                     * @interface ISubMessage\n                     * @property {Uint8Array|null} [bytesField] SubMessage bytesField\n                     * @property {string|null} [stringField] SubMessage stringField\n                     */\n\n                    /**\n                     * Constructs a new SubMessage.\n                     * @memberof plexus.interop.testing.EchoRequest\n                     * @classdesc Represents a SubMessage.\n                     * @implements ISubMessage\n                     * @constructor\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage=} [properties] Properties to set\n                     */\n                    function SubMessage(properties) {\n                        if (properties)\n                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                                if (properties[keys[i]] != null)\n                                    this[keys[i]] = properties[keys[i]];\n                    }\n\n                    /**\n                     * SubMessage bytesField.\n                     * @member {Uint8Array} bytesField\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     */\n                    SubMessage.prototype.bytesField = $util.newBuffer([]);\n\n                    /**\n                     * SubMessage stringField.\n                     * @member {string} stringField\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     */\n                    SubMessage.prototype.stringField = \"\";\n\n                    /**\n                     * Creates a new SubMessage instance using the specified properties.\n                     * @function create\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage=} [properties] Properties to set\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage instance\n                     */\n                    SubMessage.create = function create(properties) {\n                        return new SubMessage(properties);\n                    };\n\n                    /**\n                     * Encodes the specified SubMessage message. Does not implicitly {@link plexus.interop.testing.EchoRequest.SubMessage.verify|verify} messages.\n                     * @function encode\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.ISubMessage} message SubMessage message or plain object to encode\n                     * @param {$protobuf.Writer} [writer] Writer to encode to\n                     * @returns {$protobuf.Writer} Writer\n                     */\n                    SubMessage.encode = function encode(message, writer) {\n                        if (!writer)\n                            writer = $Writer.create();\n                        if (message.bytesField != null && Object.hasOwnProperty.call(message, \"bytesField\"))\n                            writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bytesField);\n                        if (message.stringField != null && Object.hasOwnProperty.call(message, \"stringField\"))\n                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringField);\n                        return writer;\n                    };\n\n                    /**\n                     * Decodes a SubMessage message from the specified reader or buffer.\n                     * @function decode\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                     * @param {number} [length] Message length if known beforehand\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    SubMessage.decode = function decode(reader, length) {\n                        if (!(reader instanceof $Reader))\n                            reader = $Reader.create(reader);\n                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.plexus.interop.testing.EchoRequest.SubMessage();\n                        while (reader.pos < end) {\n                            var tag = reader.uint32();\n                            switch (tag >>> 3) {\n                            case 1:\n                                message.bytesField = reader.bytes();\n                                break;\n                            case 2:\n                                message.stringField = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag & 7);\n                                break;\n                            }\n                        }\n                        return message;\n                    };\n\n                    /**\n                     * Verifies a SubMessage message.\n                     * @function verify\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {Object.<string,*>} message Plain object to verify\n                     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                     */\n                    SubMessage.verify = function verify(message) {\n                        if (typeof message !== \"object\" || message === null)\n                            return \"object expected\";\n                        if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                            if (!(message.bytesField && typeof message.bytesField.length === \"number\" || $util.isString(message.bytesField)))\n                                return \"bytesField: buffer expected\";\n                        if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                            if (!$util.isString(message.stringField))\n                                return \"stringField: string expected\";\n                        return null;\n                    };\n\n                    /**\n                     * Creates a SubMessage message from a plain object. Also converts values to their respective internal types.\n                     * @function fromObject\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {Object.<string,*>} object Plain object\n                     * @returns {plexus.interop.testing.EchoRequest.SubMessage} SubMessage\n                     */\n                    SubMessage.fromObject = function fromObject(object) {\n                        if (object instanceof $root.plexus.interop.testing.EchoRequest.SubMessage)\n                            return object;\n                        var message = new $root.plexus.interop.testing.EchoRequest.SubMessage();\n                        if (object.bytesField != null)\n                            if (typeof object.bytesField === \"string\")\n                                $util.base64.decode(object.bytesField, message.bytesField = $util.newBuffer($util.base64.length(object.bytesField)), 0);\n                            else if (object.bytesField.length)\n                                message.bytesField = object.bytesField;\n                        if (object.stringField != null)\n                            message.stringField = String(object.stringField);\n                        return message;\n                    };\n\n                    /**\n                     * Creates a plain object from a SubMessage message. Also converts values to other types if specified.\n                     * @function toObject\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @static\n                     * @param {plexus.interop.testing.EchoRequest.SubMessage} message SubMessage\n                     * @param {$protobuf.IConversionOptions} [options] Conversion options\n                     * @returns {Object.<string,*>} Plain object\n                     */\n                    SubMessage.toObject = function toObject(message, options) {\n                        if (!options)\n                            options = {};\n                        var object = {};\n                        if (options.defaults) {\n                            if (options.bytes === String)\n                                object.bytesField = \"\";\n                            else {\n                                object.bytesField = [];\n                                if (options.bytes !== Array)\n                                    object.bytesField = $util.newBuffer(object.bytesField);\n                            }\n                            object.stringField = \"\";\n                        }\n                        if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                            object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField;\n                        if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                            object.stringField = message.stringField;\n                        return object;\n                    };\n\n                    /**\n                     * Converts this SubMessage to JSON.\n                     * @function toJSON\n                     * @memberof plexus.interop.testing.EchoRequest.SubMessage\n                     * @instance\n                     * @returns {Object.<string,*>} JSON object\n                     */\n                    SubMessage.prototype.toJSON = function toJSON() {\n                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                    };\n\n                    return SubMessage;\n                })();\n\n                /**\n                 * SubEnum enum.\n                 * @name plexus.interop.testing.EchoRequest.SubEnum\n                 * @enum {number}\n                 * @property {number} VALUE_ONE=0 VALUE_ONE value\n                 * @property {number} VALUE_TWO=1 VALUE_TWO value\n                 */\n                EchoRequest.SubEnum = (function() {\n                    var valuesById = {}, values = Object.create(valuesById);\n                    values[valuesById[0] = \"VALUE_ONE\"] = 0;\n                    values[valuesById[1] = \"VALUE_TWO\"] = 1;\n                    return values;\n                })();\n\n                return EchoRequest;\n            })();\n\n            return testing;\n        })();\n\n        return interop;\n    })();\n\n    return plexus;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/e2e/src/polyfills.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport 'core-js/es6/promise';\nimport 'core-js/es6/symbol';\nimport 'core-js/es6/object';\nimport 'core-js/es6/function';\nimport 'core-js/es6/parse-int';\nimport 'core-js/es6/parse-float';\nimport 'core-js/es6/number';\nimport 'core-js/es6/math';\nimport 'core-js/es6/string';\nimport 'core-js/es6/date';\nimport 'core-js/es6/array';\nimport 'core-js/es6/regexp';\nimport 'core-js/es6/map';\nimport 'core-js/es6/weak-map';\nimport 'core-js/es6/set';\n"
  },
  {
    "path": "web/packages/e2e/src/views/proxyHost.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n    <title>Test Cross Domain Host Page</title>\n    <script src=\"../../tests/web/CrossDomainHost.bundle.js\" ></script>\n</head>\n    <body>\n        No content required\n    </body>\n</html>"
  },
  {
    "path": "web/packages/e2e/tests/common/BenchmarkResult.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodType } from '@plexus-interop/client';\n\nexport interface BenchmarkResult {\n    methodType: MethodType;\n    messagesSent: number;\n    periodInMillis: number;\n    bytesSent: number;\n    millisPerMessage: number;\n}\n"
  },
  {
    "path": "web/packages/e2e/tests/common/ClientsSetup.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EchoClientClient, EchoClientClientBuilder } from '../../src/echo/client/EchoClientGeneratedClient';\nimport { EchoServerClient, EchoServerClientBuilder, EchoServiceInvocationHandler } from '../../src/echo/server/EchoServerGeneratedClient';\nimport { ConnectionProvider } from './ConnectionProvider';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { TimeUtils } from '@plexus-interop/common';\nimport * as Long from 'long';\nimport { ConnectionSetup } from './ConnectionSetup';\nimport { GenericClientApi, ContainerAwareClientAPIBuilder, GenericClientApiBuilder } from '@plexus-interop/client';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\n\nexport class ClientsSetup {\n\n    private clientConnectionSetup: ConnectionSetup | null = null;\n    private serverConnectionSetup: ConnectionSetup | null = null;\n\n    public constructor(private readonly clientConnectionDelay: number = 0) { }\n\n    public async createEchoClients(\n        transportConnectionProvider: ConnectionProvider,\n        serviceHandler: EchoServiceInvocationHandler): Promise<[EchoClientClient, EchoServerClient]> {\n        const server = await this.createEchoServer(transportConnectionProvider, serviceHandler);\n        const client = await this.createEchoClient(transportConnectionProvider);\n        await TimeUtils.timeout(this.clientConnectionDelay);\n        return [client, server];\n    }\n\n    public createEchoClient(transportConnectionProvider: ConnectionProvider): Promise<EchoClientClient> {\n        return new EchoClientClientBuilder()\n            .withTransportConnectionProvider(async () => {\n                this.clientConnectionSetup = await transportConnectionProvider();\n                return this.clientConnectionSetup.getConnection();\n            })\n            .connect();\n    }\n\n    public async createGenericClientAndStaticServer(\n        clientMarshaller: BinaryMarshallerProvider,\n        transportConnectionProvider: ConnectionProvider,\n        serviceHandler: EchoServiceInvocationHandler): Promise<[GenericClientApi, EchoServerClient]> {\n        const server = await this.createEchoServer(transportConnectionProvider, serviceHandler);\n        const client = await this.createGenericEchoClient(transportConnectionProvider, clientMarshaller);\n        await TimeUtils.timeout(this.clientConnectionDelay);\n        return [client, server];\n    }\n\n    public createGenericEchoClient(transportConnectionProvider: ConnectionProvider, marhallerProvider: BinaryMarshallerProvider): Promise<GenericClientApi> {\n        return new GenericClientApiBuilder(marhallerProvider)\n            .withApplicationId('plexus.interop.testing.EchoClient')\n            .withTransportConnectionProvider(async () => {\n                this.clientConnectionSetup = await transportConnectionProvider();\n                return this.clientConnectionSetup.getConnection();\n            })\n            .connect();\n    }\n\n    public createEchoServer(\n        transportConnectionProvider: ConnectionProvider,\n        serviceHandler: EchoServiceInvocationHandler): Promise<EchoServerClient> {\n        return new EchoServerClientBuilder()\n            .withEchoServiceInvocationsHandler(serviceHandler)\n            .withTransportConnectionProvider(async () => {\n                this.serverConnectionSetup = await transportConnectionProvider();\n                return this.serverConnectionSetup.getConnection();\n            })\n            .connect();\n    }\n\n    public getClientConnectionSetup(): ConnectionSetup {\n        return (this.clientConnectionSetup as ConnectionSetup);\n    }\n\n    public getServerConnectionSetup(): ConnectionSetup {\n        return (this.serverConnectionSetup as ConnectionSetup);\n    }\n\n    public createRequestDto(): plexus.plexus.interop.testing.IEchoRequest {\n        return {\n            stringField: 'stringData',\n            int64Field: Long.fromInt(1234),\n            uint32Field: 4321,\n            repeatedDoubleField: [1, 2, 3],\n            enumField: plexus.plexus.interop.testing.EchoRequest.SubEnum.VALUE_ONE,\n            subMessageField: {\n                stringField: 'subString',\n                bytesField: new Uint8Array([5, 6, 7])\n            },\n            repeatedSubMessageField: [\n                {\n                    stringField: 'subString',\n                    bytesField: new Uint8Array([5, 6, 7])\n                },\n                {\n                    stringField: 'subString2',\n                    bytesField: new Uint8Array([8, 9, 10])\n                }\n            ]\n        };\n    }\n\n    public createRequestOfBytes(numberOfBytes: number): plexus.plexus.interop.testing.IEchoRequest {\n        const bytesField = Uint8Array.from(Array<number>(numberOfBytes).fill(1));\n        return {\n            subMessageField: {\n                bytesField\n            }\n        };\n    }\n\n    public createHugeRequestDto(strLength: number): plexus.plexus.interop.testing.IEchoRequest {\n        const text = (new Array(strLength)).join('x');\n        return {\n            stringField: text\n        };\n    }\n\n    public createSimpleRequestDto(text: string): plexus.plexus.interop.testing.IEchoRequest {\n        return {\n            stringField: text\n        };\n    }\n\n    public async disconnect(client: EchoClientClient, server: EchoServerClient): Promise<void> {\n        await client.disconnect();\n        await server.disconnect();\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/common/ConnectionProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionSetup } from './ConnectionSetup';\n\nexport type ConnectionProvider = () => Promise<ConnectionSetup>;"
  },
  {
    "path": "web/packages/e2e/tests/common/ConnectionSetup.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\n\nexport interface ConnectionSetup {\n\n    getConnection(): TransportConnection;\n    \n    dropConnection(): void;\n    \n}"
  },
  {
    "path": "web/packages/e2e/tests/common/RawMetadata.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class RawMetadata {\n\n    public static appsJson: string = `   \n    {\n        \"apps\": [\n            {\n            \"id\": \"plexus.interop.testing.TestAppLauncher\",\n            \"displayName\": \"Test App Launcher\"\n            },\n            {\n            \"id\": \"plexus.interop.testing.EchoServer\",\n            \"displayName\": \"Test Echo Server\",\n            \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n            \"launcherParams\": {}\n            },\n            {\n            \"id\": \"plexus.interop.testing.EchoClient\",\n            \"displayName\": \"Test Echo Client\",\n            \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n            \"launcherParams\": {}\n            }\n        ]\n    }\n    `;\n\n    public static interopJson: string = `   \n    {\n        \"messages\": {\n          \"nested\": {\n            \"plexus\": {\n              \"nested\": {\n                \"interop\": {\n                  \"nested\": {\n                    \"testing\": {\n                      \"options\": {\n                        \"csharp_namespace\": \"plexus\"\n                      },\n                      \"nested\": {\n                        \"EchoService\": {\n                          \"options\": {\n                            \"(.interop.service_id)\": \"plexus.interop.testing.EchoService\"\n                          },\n                          \"methods\": {\n                            \"Unary\": {\n                              \"requestType\": \"EchoRequest\",\n                              \"responseType\": \"EchoRequest\"\n                            },\n                            \"ServerStreaming\": {\n                              \"requestType\": \"EchoRequest\",\n                              \"responseType\": \"EchoRequest\",\n                              \"responseStream\": true\n                            },\n                            \"ClientStreaming\": {\n                              \"requestType\": \"EchoRequest\",\n                              \"requestStream\": true,\n                              \"responseType\": \"EchoRequest\"\n                            },\n                            \"DuplexStreaming\": {\n                              \"requestType\": \"EchoRequest\",\n                              \"requestStream\": true,\n                              \"responseType\": \"EchoRequest\",\n                              \"responseStream\": true\n                            }\n                          }\n                        },\n                        \"EchoRequest\": {\n                          \"options\": {\n                            \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest\"\n                          },\n                          \"fields\": {\n                            \"stringField\": {\n                              \"type\": \"string\",\n                              \"id\": 1\n                            },\n                            \"int64Field\": {\n                              \"type\": \"int64\",\n                              \"id\": 2\n                            },\n                            \"uint32Field\": {\n                              \"type\": \"uint32\",\n                              \"id\": 3\n                            },\n                            \"repeatedDoubleField\": {\n                              \"rule\": \"repeated\",\n                              \"type\": \"double\",\n                              \"id\": 4\n                            },\n                            \"enumField\": {\n                              \"type\": \"SubEnum\",\n                              \"id\": 5\n                            },\n                            \"subMessageField\": {\n                              \"type\": \"SubMessage\",\n                              \"id\": 6\n                            },\n                            \"repeatedSubMessageField\": {\n                              \"rule\": \"repeated\",\n                              \"type\": \"SubMessage\",\n                              \"id\": 7\n                            }\n                          },\n                          \"nested\": {\n                            \"SubMessage\": {\n                              \"options\": {\n                                \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest.SubMessage\"\n                              },\n                              \"fields\": {\n                                \"bytesField\": {\n                                  \"type\": \"bytes\",\n                                  \"id\": 1\n                                },\n                                \"stringField\": {\n                                  \"type\": \"string\",\n                                  \"id\": 2\n                                }\n                              }\n                            },\n                            \"SubEnum\": {\n                              \"values\": {\n                                \"value_one\": 0,\n                                \"value_two\": 1\n                              }\n                            }\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            },\n            \"interop\": {\n              \"options\": {\n                \"csharp_namespace\": \"plexus\"\n              },\n              \"nested\": {\n                \"messageId\": {\n                  \"type\": \"string\",\n                  \"id\": 9650,\n                  \"extend\": \"google.protobuf.MessageOptions\"\n                },\n                \"serviceId\": {\n                  \"type\": \"string\",\n                  \"id\": 9650,\n                  \"extend\": \"google.protobuf.ServiceOptions\"\n                },\n                \"methodId\": {\n                  \"type\": \"string\",\n                  \"id\": 9650,\n                  \"extend\": \"google.protobuf.MethodOptions\"\n                },\n                \"ApplicationOptions\": {\n                  \"fields\": {\n                    \"title\": {\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"launchOnCall\": {\n                      \"type\": \"ApplicationLaunchOnCallMode\",\n                      \"id\": 2\n                    }\n                  }\n                },\n                \"ProvidedServiceOptions\": {\n                  \"fields\": {\n                    \"title\": {\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"launchOnCall\": {\n                      \"type\": \"ApplicationLaunchOnCallMode\",\n                      \"id\": 2\n                    }\n                  }\n                },\n                \"ConsumedServiceOptions\": {\n                  \"fields\": {}\n                },\n                \"ProvidedMethodOptions\": {\n                  \"fields\": {\n                    \"title\": {\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"launchOnCall\": {\n                      \"type\": \"ApplicationLaunchOnCallMode\",\n                      \"id\": 2\n                    },\n                    \"timeoutMs\": {\n                      \"type\": \"uint32\",\n                      \"id\": 3\n                    }\n                  }\n                },\n                \"ConsumedMethodOptions\": {\n                  \"fields\": {}\n                },\n                \"ApplicationLaunchOnCallMode\": {\n                  \"options\": {\n                    \"allow_alias\": true\n                  },\n                  \"values\": {\n                    \"IF_NOT_LAUNCHED\": 0,\n                    \"DEFAULT\": 0,\n                    \"ALWAYS\": 1,\n                    \"ENABLED\": 1,\n                    \"NEVER\": 2,\n                    \"DISABLED\": 2\n                  }\n                },\n                \"AppLauncherService\": {\n                  \"options\": {\n                    \"(.interop.service_id)\": \"interop.AppLauncherService\"\n                  },\n                  \"methods\": {\n                    \"Launch\": {\n                      \"requestType\": \"AppLaunchRequest\",\n                      \"responseType\": \"AppLaunchResponse\"\n                    }\n                  }\n                },\n                \"AppLaunchRequest\": {\n                  \"options\": {\n                    \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n                  },\n                  \"fields\": {\n                    \"appId\": {\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"launchParamsJson\": {\n                      \"type\": \"string\",\n                      \"id\": 2\n                    },\n                    \"launchMode\": {\n                      \"type\": \"AppLaunchMode\",\n                      \"id\": 3\n                    },\n                    \"suggestedAppInstanceId\": {\n                      \"type\": \"UniqueId\",\n                      \"id\": 4\n                    }\n                  }\n                },\n                \"AppLaunchResponse\": {\n                  \"options\": {\n                    \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n                  },\n                  \"fields\": {\n                    \"appInstanceId\": {\n                      \"type\": \"UniqueId\",\n                      \"id\": 1\n                    }\n                  }\n                },\n                \"UniqueId\": {\n                  \"options\": {\n                    \"(.interop.message_id)\": \"interop.UniqueId\"\n                  },\n                  \"fields\": {\n                    \"lo\": {\n                      \"type\": \"fixed64\",\n                      \"id\": 1\n                    },\n                    \"hi\": {\n                      \"type\": \"fixed64\",\n                      \"id\": 2\n                    }\n                  }\n                },\n                \"AppLaunchMode\": {\n                  \"values\": {\n                    \"SINGLE_INSTANCE\": 0,\n                    \"MULTI_INSTANCE\": 1\n                  }\n                }\n              }\n            }\n          }\n        }\n        ,\n        \"services\": [\n          {\n            \"id\": \"plexus.interop.testing.EchoService\",\n            \"methods\": [\n              {\n                \"name\": \"Unary\",\n                \"request\": \"plexus.interop.testing.EchoRequest\",\n                \"response\": \"plexus.interop.testing.EchoRequest\",\n                \"type\": \"Unary\"\n              },\n              {\n                \"name\": \"ServerStreaming\",\n                \"request\": \"plexus.interop.testing.EchoRequest\",\n                \"response\": \"plexus.interop.testing.EchoRequest\",\n                \"type\": \"ServerStreaming\"\n              },\n              {\n                \"name\": \"ClientStreaming\",\n                \"request\": \"plexus.interop.testing.EchoRequest\",\n                \"response\": \"plexus.interop.testing.EchoRequest\",\n                \"type\": \"ClientStreaming\"\n              },\n              {\n                \"name\": \"DuplexStreaming\",\n                \"request\": \"plexus.interop.testing.EchoRequest\",\n                \"response\": \"plexus.interop.testing.EchoRequest\",\n                \"type\": \"DuplexStreaming\"\n              }\n            ],\n            \"options\": [\n              {\n                \"id\": \"interop.service_id\",\n                \"value\": \"plexus.interop.testing.EchoService\"\n              }\n            ]\n          },\n          {\n            \"id\": \"interop.AppLauncherService\",\n            \"methods\": [\n              {\n                \"name\": \"Launch\",\n                \"request\": \"interop.AppLaunchRequest\",\n                \"response\": \"interop.AppLaunchResponse\",\n                \"type\": \"Unary\"\n              }\n            ],\n            \"options\": [\n              {\n                \"id\": \"interop.service_id\",\n                \"value\": \"interop.AppLauncherService\"\n              }\n            ]\n          }\n        ],\n        \"applications\": [\n          {\n            \"id\": \"plexus.interop.testing.EchoClient\",\n            \"consumes\": [\n              {\n                \"service\": \"plexus.interop.testing.EchoService\",\n                \"methods\": [\n                  {\n                    \"name\": \"Unary\"\n                  },\n                  {\n                    \"name\": \"ServerStreaming\"\n                  },\n                  {\n                    \"name\": \"ClientStreaming\"\n                  },\n                  {\n                    \"name\": \"DuplexStreaming\"\n                  }\n                ],\n                \"from\": [\n                  \"plexus.interop.testing.*\"\n                ]\n              },\n              {\n                \"service\": \"plexus.interop.testing.EchoService\",\n                \"methods\": [\n                  {\n                    \"name\": \"Unary\"\n                  }\n                ],\n                \"alias\": \"ServiceAlias\",\n                \"from\": [\n                  \"plexus.interop.testing.*\"\n                ]\n              }\n            ]\n          },\n          {\n            \"id\": \"plexus.interop.testing.EchoServer\",\n            \"provides\": [\n              {\n                \"service\": \"plexus.interop.testing.EchoService\",\n                \"methods\": [\n                  {\n                    \"name\": \"Unary\",\n                    \"options\": [\n                      {\n                        \"id\": \"interop.ProvidedMethodOptions.title\",\n                        \"value\": \"Sample Unary Method\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"ServerStreaming\",\n                    \"options\": [\n                      {\n                        \"id\": \"interop.ProvidedMethodOptions.title\",\n                        \"value\": \"Sample Server Streaming Method\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"ClientStreaming\",\n                    \"options\": [\n                      {\n                        \"id\": \"interop.ProvidedMethodOptions.title\",\n                        \"value\": \"Sample Client Streaming Method\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"DuplexStreaming\",\n                    \"options\": [\n                      {\n                        \"id\": \"interop.ProvidedMethodOptions.title\",\n                        \"value\": \"Sample Duplex Streaming Method\"\n                      }\n                    ]\n                  }\n                ],\n                \"to\": [\n                  \"plexus.interop.testing.*\"\n                ],\n                \"options\": [\n                  {\n                    \"id\": \"interop.ProvidedServiceOptions.title\",\n                    \"value\": \"Sample Echo Service\"\n                  }\n                ]\n              },\n              {\n                \"service\": \"plexus.interop.testing.EchoService\",\n                \"methods\": [\n                  {\n                    \"name\": \"Unary\",\n                    \"options\": [\n                      {\n                        \"id\": \"interop.ProvidedMethodOptions.title\",\n                        \"value\": \"Sample Unary Method with Alias\"\n                      }\n                    ]\n                  }\n                ],\n                \"alias\": \"ServiceAlias\",\n                \"to\": [\n                  \"plexus.interop.testing.*\"\n                ],\n                \"options\": [\n                  {\n                    \"id\": \"interop.ProvidedServiceOptions.title\",\n                    \"value\": \"Sample Echo Service with Alias\"\n                  }\n                ]\n              }\n            ]\n          },\n          {\n            \"id\": \"plexus.interop.testing.TestAppLauncher\",\n            \"provides\": [\n              {\n                \"service\": \"interop.AppLauncherService\",\n                \"methods\": [\n                  {\n                    \"name\": \"Launch\"\n                  }\n                ],\n                \"to\": [\n                  \"interop.AppLifecycleManager\"\n                ]\n              }\n            ]\n          }\n        ]\n    }    \n    `;\n}"
  },
  {
    "path": "web/packages/e2e/tests/common/TestCrossDomainHost.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LoggerFactory, LogLevel } from '@plexus-interop/common';\nimport { CrossDomainHostBuilder } from '@plexus-interop/broker';\nimport 'core-js/es6/promise';\nimport 'core-js/fn/array/find';\nimport 'core-js/es6/symbol';\nimport 'core-js/es6/object';\nimport 'core-js/es6/function';\nimport 'core-js/es6/parse-int';\nimport 'core-js/es6/parse-float';\nimport 'core-js/es6/number';\nimport 'core-js/es6/math';\nimport 'core-js/es6/string';\nimport 'core-js/es6/date';\nimport 'core-js/es6/array';\nimport 'core-js/es6/regexp';\nimport 'core-js/es6/map';\nimport 'core-js/es6/set';\nimport 'core-js/es6/reflect';\n\nLoggerFactory.setLogLevel(LogLevel.TRACE);\n\nexport class TestCrossDomainHost {\n\n    public start(): void {\n        const logger: Logger = LoggerFactory.getLogger('CrossDomainHostPage');\n        new CrossDomainHostBuilder()\n            .withCrossDomainConfig({ whiteListedUrls: ['*'] })\n            .build()\n            .then(() => logger.info('Created'))\n            .catch(e => logger.error('Failed', e));\n    }\n\n}\nconst globalObject: any = window || global;\n// tslint:disable-next-line:no-string-literal\nconst host = globalObject['proxyHostVar'] = new TestCrossDomainHost();\n\nhost.start();\n"
  },
  {
    "path": "web/packages/e2e/tests/common/TransportsSetup.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport { ConnectionProvider } from './ConnectionProvider';\nimport { WebBrokerConnectionBuilder, EventBus } from '@plexus-interop/broker';\nimport { CrossDomainEventBusProvider, CrossDomainEventBus } from '@plexus-interop/broker';\nimport { JsonAppRegistryProvider, JsonInteropRegistryProvider } from '@plexus-interop/metadata';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { RawMetadata } from './RawMetadata';\n\nexport class TransportsSetup {\n\n    public createWebSocketTransportProvider(url: string): ConnectionProvider {\n        return async () => {\n            const socket = new WebSocket(url);\n            const connection = await new WebSocketConnectionFactory(socket).connect();\n            return {\n                getConnection: () => connection,\n                dropConnection: () => socket.close()\n            };\n        };\n    }\n\n    public createCrossDomainTransportProvider(proxyUrl: string): ConnectionProvider {\n        const eventBusProvider = async () => new CrossDomainEventBusProvider(async () => proxyUrl).connect();\n        return this.createWebBrokerTransportProvider(eventBusProvider);\n    }\n\n    public createWebBrokerTransportProvider(eventBusProvider: () => Promise<EventBus>): ConnectionProvider {\n        return async () => {\n            let eventBus: CrossDomainEventBus;\n            const connection: TransportConnection = await new WebBrokerConnectionBuilder()\n                .withAppRegistryProviderFactory(async () => new JsonAppRegistryProvider(RawMetadata.appsJson))\n                .withInteropRegistryProviderFactory(async () => new JsonInteropRegistryProvider(RawMetadata.interopJson))\n                .withEventBusProvider(eventBusProvider)\n                .connect();\n            return {\n                getConnection: () => connection,\n                // tslint:disable-next-line:no-console\n                dropConnection: () => eventBus.disconnect().catch(e => console.error('Failed to disconnect', e))\n            };\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/common/utils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst globalObj: any = global || window;\n\nexport function readEncodedConfig(): any {\n\n    // tslint:disable-next-line:no-string-literal\n    if (globalObj['__karma__']) {\n        // tslint:disable-next-line:no-string-literal        \n        return globalObj['__karma__'].config;\n    }\n\n    let env: any;\n    if (globalObj.require('is-electron-renderer')) {\n        env = globalObj.require('electron').remote.process.env;\n    } else {\n        env = process.env;\n    }\n    return {\n        wsUrl: env.PLEXUS_BROKER_WEBSOCKET_URL,\n        hostPath: env.PLEXUS_BROKER_HOST_URL\n    }\n}\n\nexport function readWsUrl(): string {\n    const wsUrl = readEncodedConfig().wsUrl;\n    if (wsUrl) {\n        return wsUrl;\n    } else {\n        throw Error('wsUrl is undefined');\n    }\n}\n\nexport function readHostUrl(): string {\n    const hostUrl = readEncodedConfig().hostPath;\n    if (hostUrl) {\n        return hostUrl;\n    } else {\n        throw Error('hostUrl is undefined');\n    }\n}\n"
  },
  {
    "path": "web/packages/e2e/tests/echo/BaseEchoTest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { expect } from 'chai';\nimport { MethodInvocationContext } from '@plexus-interop/client';\nimport { BinaryMarshallerProvider } from '@plexus-interop/io';\nimport { ProtoMarshallerProvider } from '@plexus-interop/io/dist/main/src/static';\nimport { Arrays, LoggerFactory, LogLevel, AsyncHelper } from '@plexus-interop/common';\nimport { ClientsSetup } from '../common/ClientsSetup';\n\nexport class BaseEchoTest {\n\n    protected marshallerProvider: BinaryMarshallerProvider = new ProtoMarshallerProvider();\n\n    public assertEqual(first: plexus.plexus.interop.testing.IEchoRequest, second: plexus.plexus.interop.testing.IEchoRequest): void {\n        let firstInt64;\n        let secondInt64;\n\n        if (!!first.int64Field && !!second.int64Field) {\n            // chai's deep equal breaks on Long\n            firstInt64 = first.int64Field;\n            secondInt64 = second.int64Field;\n            delete first.int64Field;\n            delete second.int64Field;\n            expect((firstInt64 as Long).high).is.eq((secondInt64 as Long).high);\n            expect((firstInt64 as Long).low).is.eq((secondInt64 as Long).low);\n        }\n\n        expect(first).to.be.deep.equal(second);\n\n        if (!!firstInt64 && !!secondInt64) {\n            // return fields back\n            first.int64Field = firstInt64;\n            second.int64Field = secondInt64;\n        }\n\n    }\n\n    public encodeRequestDto(request: plexus.plexus.interop.testing.IEchoRequest): ArrayBuffer {\n        return Arrays.toArrayBuffer(this.marshallerProvider.getMarshaller(plexus.plexus.interop.testing.EchoRequest).encode(request));\n    }\n\n    public decodeRequestDto(payload: ArrayBuffer): plexus.plexus.interop.testing.IEchoRequest {\n        return this.marshallerProvider.getMarshaller(plexus.plexus.interop.testing.EchoRequest).decode(new Uint8Array(payload));\n    }\n\n    public async verifyClientChannelsCleared(clientsSetup: ClientsSetup): Promise<void> {\n        expect(clientsSetup.getClientConnectionSetup().getConnection().getManagedChannels().length).to.eq(0);\n    }\n\n    public async verifyServerChannelsCleared(clientsSetup: ClientsSetup): Promise<void> {\n        expect(clientsSetup.getServerConnectionSetup().getConnection().getManagedChannels().length).to.eq(0);\n    }\n\n    public verifyInvocationContext(invocationContext: MethodInvocationContext): void {\n        expect(invocationContext).to.not.be.undefined;\n        expect(invocationContext.cancellationToken).to.not.be.undefined;\n        expect(invocationContext.consumerConnectionId).to.not.be.undefined;\n        expect(invocationContext.consumerApplicationId).to.be.eq('plexus.interop.testing.EchoClient');\n    }\n\n    public waitForClientConnectionCleared(clientsSetup: ClientsSetup): Promise<void> {\n        return AsyncHelper.waitFor(() => clientsSetup.getClientConnectionSetup().getConnection().getManagedChannels().length === 0);\n    }\n\n    public waitForServerConnectionCleared(clientsSetup: ClientsSetup): Promise<void> {\n        return AsyncHelper.waitFor(() => clientsSetup.getServerConnectionSetup().getConnection().getManagedChannels().length === 0);\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/BidiStreamingTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { ClientStreamingHandler } from './ClientStreamingHandler';\nimport { StreamingInvocationClient, MethodInvocationContext } from '@plexus-interop/client';\nimport { EchoClientClient } from '../../src/echo/client/EchoClientGeneratedClient';\nimport { EchoServerClient } from '../../src/echo/server/EchoServerGeneratedClient';\nimport { AsyncHelper } from '@plexus-interop/common';\n\nexport class BidiStreamingInvocationTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testClientCanCancelInvocation(): Promise<void> {\n\n        let invocationCompletedReceivedByServer = false;\n        let clientReceivedCompletion = false;\n        let serverReceivedMessage = false;\n        return new Promise<void>((resolve, reject) => {\n            const serverHandler = new ClientStreamingHandler(() => {\n                return {\n                    next: () => serverReceivedMessage = true,\n                    complete: () => invocationCompletedReceivedByServer = true,\n                    error: () => {},\n                    streamCompleted: () => {}\n                };\n            });\n            try {\n                (async () => {\n                    const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, serverHandler);\n                    const streamingClient = await client.getEchoServiceProxy().duplexStreaming({\n                        next: () => {},\n                        error: () => {},\n                        complete: () => clientReceivedCompletion = true,\n                        streamCompleted: () => { }\n                    });\n                    streamingClient.next(this.clientsSetup.createRequestDto());\n                    await AsyncHelper.waitFor(() => serverReceivedMessage === true);\n                    streamingClient.cancel();\n                    await AsyncHelper.waitFor(() => invocationCompletedReceivedByServer === true);\n                    await AsyncHelper.waitFor(() => clientReceivedCompletion === true);\n                    await this.waitForClientConnectionCleared(this.clientsSetup);\n                    await this.waitForServerConnectionCleared(this.clientsSetup);\n                    await this.clientsSetup.disconnect(client as EchoClientClient, server as EchoServerClient);\n                    resolve();\n                })();\n            } catch (error) {\n                reject(error);\n            }\n        });\n    }\n\n    public testClientAndServerCanSendMessages(): Promise<void> {\n        let client: EchoClientClient | null = null;\n        let server: EchoServerClient | null = null;\n        return new Promise<void>((resolve, reject) => {\n            const serverHandler = new ClientStreamingHandler((context: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>) => {\n                return {\n                    next: async (clientRequest) => {\n                        if (clientRequest.stringField === 'Hey') {\n                            hostClient.next(this.clientsSetup.createSimpleRequestDto('Hey'));\n                        } else if (clientRequest.stringField === 'Ping') {\n                            hostClient.next(this.clientsSetup.createSimpleRequestDto('Pong'));\n                            await hostClient.complete();\n                            this.verifyServerChannelsCleared(this.clientsSetup)\n                                .catch(e => reject(e));\n                        }\n                    },\n                    complete: () => { },\n                    error: (e) => {\n                        reject(e);\n                    },\n                    streamCompleted: () => { }\n                };\n            });\n            (async () => {\n                [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, serverHandler);\n                const streamingClient = await client.getEchoServiceProxy().duplexStreaming({\n                    next: (serverResponse) => {\n                        if (serverResponse.stringField === 'Hey') {\n                            streamingClient.next(this.clientsSetup.createSimpleRequestDto('Ping'));\n                        } else if (serverResponse.stringField === 'Pong') {\n                            streamingClient.complete().then(() => {\n                                this.verifyClientChannelsCleared(this.clientsSetup)\n                                    .catch(e => reject(e));\n                                return this.clientsSetup.disconnect(client as EchoClientClient, server as EchoServerClient);\n                            })\n                                .then(() => resolve())\n                                .catch(e => reject(e));\n                        }\n                    },\n                    error: (e) => {\n                        reject(e);\n                    },\n                    complete: () => { },\n                    streamCompleted: () => { }\n                });\n                streamingClient.next(this.clientsSetup.createSimpleRequestDto('Hey'));\n            })();\n\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/ClientConnectivityTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport { ServerStreamingHandler } from './ServerStreamingHandler';\nimport { EchoClientClient, EchoClientClientBuilder } from '../../src/echo/client/EchoClientGeneratedClient';\nimport { EchoServerClient } from '../../src/echo/server/EchoServerGeneratedClient';\nimport { MethodInvocationContext } from '@plexus-interop/client';\nimport { AsyncHelper } from '@plexus-interop/common';\n\nexport class ClientConnectivityTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testInvocationClientReceiveErrorOnClientDisconnect(): Promise<void> {\n        return this.testAllInvocationClientReceiveErrorOnDisconnect(true, false);\n    }\n\n    public async testClientReceiveErrorIfProvideWrongId(): Promise<void> {\n        const preparedBuilder = new EchoClientClientBuilder()\n            .withAppId('plexus.interop.testing.DoNotExist')\n            .withTransportConnectionProvider(() => this.connectionProvider().then(c => c.getConnection()));\n        try {\n            await preparedBuilder.connect();\n        } catch (error) {\n            return Promise.resolve();\n        }\n        throw new Error('Expect to fail to receive connection');\n    }\n\n    public async testServerReceivesErrorIfClientDroppedConnection(): Promise<void> {\n        return this.testRemoteSideReceivedErrorWhenConnectionDropped(true);\n    }\n\n    public async testClientReceivesErrorIfServerDroppedConnection(): Promise<void> {\n        return this.testRemoteSideReceivedErrorWhenConnectionDropped(false);\n    }\n\n    private async testRemoteSideReceivedErrorWhenConnectionDropped(isDroppedByClient: boolean): Promise<void> {\n\n        const echoRequest = this.clientsSetup.createRequestDto();\n        let client: EchoClientClient | null = null;\n        let server: EchoServerClient | null = null;\n        let serverInvocationContext: MethodInvocationContext | null = null;\n        return new Promise<void>(async (testResolve, testError) => {\n\n            let handler: ServerStreamingHandler | null = null;\n            let clientInvocationErrorReceived: Promise<void> | null = null;\n\n            const serverRequestReceived = new Promise(async (serverRequestResolve) => {\n                handler = new ServerStreamingHandler(async context => {\n                    serverInvocationContext = context;\n                    serverRequestResolve();\n                });\n                [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler as ServerStreamingHandler);\n                clientInvocationErrorReceived = new Promise<void>(clientComplete => {\n                    (client as EchoClientClient).getEchoServiceProxy().serverStreaming(echoRequest, {\n                        next: () => {},\n                        // client receives 'cancel' completion\n                        complete: () => {\n                            if  (!isDroppedByClient) {\n                                clientComplete();\n                            }\n                        },\n                        error: () => {\n                            if  (isDroppedByClient) {\n                                clientComplete();\n                            }\n                        },\n                        streamCompleted: () => { }\n                    });\n                });\n            });\n\n            // wait for server to receive request to ensure invocation established\n            await serverRequestReceived;\n\n            if (isDroppedByClient) {\n                this.clientsSetup.getClientConnectionSetup().dropConnection();\n            } else {\n                this.clientsSetup.getServerConnectionSetup().dropConnection();\n            }\n\n            // server's context must be cancelled\n            await AsyncHelper.waitFor(() => (serverInvocationContext as MethodInvocationContext).cancellationToken.isCancelled());\n\n            await clientInvocationErrorReceived;\n\n            if (isDroppedByClient) {\n                await (server as EchoServerClient).disconnect();\n            } else {\n                await (client as EchoClientClient).disconnect();\n            }\n\n            testResolve();\n\n        });\n    }\n\n    private testAllInvocationClientReceiveErrorOnDisconnect(isForcedByClient: boolean, isForcedByServer: boolean): Promise<void> {\n\n        const echoRequest = this.clientsSetup.createRequestDto();\n        let client: EchoClientClient | null = null;\n        let server: EchoServerClient | null = null;\n\n        return new Promise<void>(async (testResolve) => {\n\n            let handler: ServerStreamingHandler | null = null;\n            let clientInvocationErrorReceived: Promise<void> | null = null;\n\n            const serverRequestReceived = new Promise(async (serverRequestResolve) => {\n                handler = new ServerStreamingHandler(async () => {\n                    serverRequestResolve();\n                });\n                [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler as ServerStreamingHandler);\n                clientInvocationErrorReceived = new Promise<void>((clientErrorResolve, clientErrorReject) => {\n                    (client as EchoClientClient).getEchoServiceProxy().serverStreaming(echoRequest, {\n                        next: (r) => {\n                            clientErrorReject('Not expected to receive update');\n                        },\n                        complete: () => { },\n                        error: (e) => {\n                            clientErrorResolve();\n                        },\n                        streamCompleted: () => { }\n                    });\n                });\n            });\n\n            await serverRequestReceived;\n\n            if (isForcedByClient) {\n                (client as EchoClientClient).disconnect();\n            }\n\n            if (isForcedByServer) {\n                (server as EchoServerClient).disconnect();\n            }\n\n            await clientInvocationErrorReceived;\n\n            if (!isForcedByServer) {\n                await (server as EchoServerClient).disconnect();\n            }\n\n            if (!isForcedByClient) {\n                await (client as EchoClientClient).disconnect();\n            }\n\n            testResolve();\n\n        });\n    }\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/ClientStreamingHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NopServiceHandler } from './NopServiceHandler';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { Observer } from '@plexus-interop/common';\nimport { StreamingInvocationClient, MethodInvocationContext, InvocationObserver } from '@plexus-interop/client';\n\nexport class ClientStreamingHandler extends NopServiceHandler {\n\n    public constructor(private handler: (context: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>) => InvocationObserver<plexus.plexus.interop.testing.IEchoRequest>) {\n        super();\n    }\n\n    public onDuplexStreaming(context: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest> {\n        return this.handler(context, hostClient);\n    }\n\n    public onClientStreaming(\n        context: MethodInvocationContext,\n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest> {\n        return this.handler(context, hostClient);\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/ClientStreamingTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { ClientStreamingHandler } from './ClientStreamingHandler';\nimport { StreamingInvocationClient, MethodInvocationContext } from '@plexus-interop/client';\n\nexport class ClientStreamingTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testClientCanSendStreamToServer(): Promise<void> {\n        return new Promise<void>(async (resolve, reject) => {\n            const serverHandler = new ClientStreamingHandler((context: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>) => {\n                return {\n                    next: async clientRequest => {\n                        hostClient.next(clientRequest);\n                        hostClient.complete();\n                    },\n                    complete: () => { },\n                    error: (e) => {\n                        reject(e);\n                    },\n                    streamCompleted: () => { }\n                };\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, serverHandler);\n            let remoteCompleted = false;\n            const streamingClient = await client.getEchoServiceProxy().clientStreaming({\n                next: () => { },\n                error: (e) => {\n                    // tslint:disable-next-line: no-console\n                    console.error('Error received by client', e);\n                    reject(e);\n                },\n                complete: async () => remoteCompleted = true,\n                streamCompleted: () => { }\n            });\n            streamingClient.next(this.clientsSetup.createSimpleRequestDto('Hey'));\n            await streamingClient.complete();\n            if (!remoteCompleted) { reject('Server stream not completed'); }            \n            await this.clientsSetup.disconnect(client, server);\n            resolve();\n        });\n    }\n\n    public testServerReceivesClientCompletionBeforeResponse(): Promise<void> {\n        return new Promise<void>(async (resolve, reject) => {\n            const serverHandler = new ClientStreamingHandler((context: MethodInvocationContext, hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>) => {\n                let lastRequest: plexus.plexus.interop.testing.IEchoRequest | null = null;\n                return {\n                    next: async clientRequest => lastRequest = clientRequest,\n                    complete: () => { },\n                    error: e => reject(e),\n                    streamCompleted: () => {\n                        if (!lastRequest) {\n                            reject('Request not received');\n                        } else {\n                            hostClient.next(lastRequest);\n                            hostClient.complete();\n                        }\n                    }\n                };\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, serverHandler);\n            let serverCompleted = false;\n            let serverStreamCompleted = false;\n            const streamingClient = await client.getEchoServiceProxy().clientStreaming({\n                next: () => { },\n                error: e => reject(e),\n                complete: async () => serverCompleted = true,\n                streamCompleted: () => serverStreamCompleted = true\n            });\n            streamingClient.next(this.clientsSetup.createSimpleRequestDto('Hey'));\n            await streamingClient.complete();\n            if (!serverCompleted) { reject('Server not completed'); }\n            if (!serverStreamCompleted) { reject('Server stream not completed'); }\n            await this.clientsSetup.disconnect(client, server);\n            resolve();\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/DiscoveryTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { NopServiceHandler } from './NopServiceHandler';\nimport { expect } from 'chai';\nimport { DiscoveredMethod, ProvidedMethodReference, DiscoveredServiceMethod, DiscoveredService } from '@plexus-interop/client-api';\nimport { UnaryServiceHandler } from './UnaryServiceHandler';\nimport { ServerStreamingHandler } from './ServerStreamingHandler';\nimport { ClientStreamingHandler } from './ClientStreamingHandler';\n\n// tslint:disable:no-unused-expression\nexport class DiscoveryTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testMethodDiscoveredByInputMessageId(): Promise<void> {\n        return this.clientsSetup.createEchoClients(this.connectionProvider, new NopServiceHandler())\n            .then(clients => {\n                const client = clients[0];\n                return client.discoverMethod({ inputMessageId: 'plexus.interop.testing.EchoRequest' })\n                    .then(discoveryResponse => {\n                        if (discoveryResponse.methods) {\n                            expect(discoveryResponse.methods.length).to.be.eq(4);\n                            discoveryResponse.methods.forEach(method => this.assertDiscoveredMethodValid(method));\n                        } else {\n                            throw 'Empty response';\n                        }\n                    })\n                    .then(() => {\n                        return this.clientsSetup.disconnect(clients[0], clients[1]);\n                    });\n            });\n    }\n\n    public async testServiceDiscoveredById(): Promise<void> {\n        const serviceId = 'plexus.interop.testing.EchoService';\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, new NopServiceHandler());\n        const serviceDiscoveryResponse = await client.discoverService({\n            consumedService: {\n                serviceId\n            }\n        });\n        if (serviceDiscoveryResponse.services) {\n            expect(serviceDiscoveryResponse.services.length).to.be.eq(1);\n            const serviceRef = serviceDiscoveryResponse.services[0];\n            if (serviceRef.consumedService) {\n                expect(serviceRef.consumedService.serviceId).to.eq(serviceId);\n            } else {\n                throw 'Empty consumed service';\n            }\n            if (serviceRef.providedService) {\n                expect(serviceRef.providedService.applicationId).to.eq('plexus.interop.testing.EchoServer');\n                // tslint:disable-next-line:no-unused-expression\n                expect(serviceRef.providedService.connectionId).to.not.be.undefined;\n                expect(serviceRef.providedService.serviceId).to.eq(serviceId);\n            } else {\n                throw 'Empty provided service';\n            }\n            if (serviceRef.methods) {\n                expect(serviceRef.methods.length).to.be.greaterThan(0);\n                serviceRef.methods.forEach(method => this.assertDiscoveredServiceMethodValid(method));\n            } else {\n                throw 'Empty methods';\n            }\n        } else {\n            throw 'Empty Response';\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public async testServiceDiscoveryReceivesEmptyResponseForWrongId(): Promise<void> {\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, new NopServiceHandler());\n        const serviceDiscoveryResponse = await client.discoverService({\n            consumedService: {\n                serviceId: 'plexus.interop.testing.DoNotExist'\n            }\n        });\n        if (serviceDiscoveryResponse.services) {\n            expect(serviceDiscoveryResponse.services.length).to.be.eq(0);\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public async testClientCanInvokeDiscoveredServerStreamingRequest(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n            hostClient.next(echoRequest);\n            hostClient.complete();\n        });\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const discoveryResponse = await client.discoverMethod({\n            consumedMethod: {\n                consumedService: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'ServerStreaming'\n            }\n        });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(1);\n            const method = discoveryResponse.methods[0];\n            if (!method.providedMethod) {\n                throw new Error('Provided method is empty');\n            }\n            let receivedResponse: plexus.plexus.interop.testing.IEchoRequest | null = null;\n            return new Promise<void>((resolve, reject) => {\n                client.sendRawServerStreamingRequest(method.providedMethod as ProvidedMethodReference, this.encodeRequestDto(echoRequest), {\n                    next: response => {\n                        receivedResponse = this.decodeRequestDto(response);\n                    },\n                    complete: async () => {\n                        this.assertEqual(echoRequest, receivedResponse as plexus.plexus.interop.testing.IEchoRequest);\n                        await this.clientsSetup.disconnect(client, server);\n                        resolve();\n                    },\n                    error: e => reject(e),\n                    streamCompleted: () => {}\n                });\n            });\n\n        } else {\n            throw 'Empty response';\n        }\n    }\n\n    public async testClientCanInvokeDiscoveredBidiStreamingRequest(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new ClientStreamingHandler((context, hostClient) => {\n                return {\n                    next: clientRequest => hostClient.complete(),\n                    complete: () => {},\n                    // tslint:disable-next-line:no-console\n                    error: (e) => console.error('Error received by server', e),\n                    streamCompleted: () => {}\n                };\n            });\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const discoveryResponse = await client.discoverMethod({\n            consumedMethod: {\n                consumedService: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'DuplexStreaming'\n            }\n        });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(1);\n            const method = discoveryResponse.methods[0];\n            if (!method.providedMethod) {\n                throw new Error('Provided method is empty');\n            }\n            return new Promise<void>(async (resolve, reject) => {\n                const streamingClient = await client.sendRawBidirectionalStreamingRequest(method.providedMethod as ProvidedMethodReference, {\n                    next: serverResponse => {},\n                    error: (e) => {\n                        reject(e);\n                    },\n                    complete: async () => {\n                        await this.clientsSetup.disconnect(client, server);\n                        resolve();                        \n                    },\n                    streamCompleted: () => {}\n                });\n                streamingClient.next(this.encodeRequestDto(echoRequest));\n                streamingClient.complete();\n            });\n        } else {\n            throw 'Empty response';\n        }\n    }\n\n    public async testClientCanInvokeDiscoveredMethodPassingRawData(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new UnaryServiceHandler(async (context, request) => request);\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const discoveryResponse = await client.discoverMethod({\n            consumedMethod: {\n                consumedService: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'Unary'\n            }\n        });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(2);\n            const method = discoveryResponse.methods[0];\n            this.assertDiscoveredMethodValid(method);\n            // invoke discovered\n            await new Promise((invocationResolve, invocationReject) => {\n                client.sendRawUnaryRequest(\n                    method.providedMethod as ProvidedMethodReference,\n                    this.encodeRequestDto(echoRequest), {\n                        value: (response: ArrayBuffer) => {\n                            const echoResponse = this.decodeRequestDto(response);\n                            this.assertEqual(echoRequest, echoResponse);\n                            invocationResolve();\n                        },\n                        error: (e) => invocationReject(e)\n                    });\n            });\n        } else {\n            throw 'Empty response';\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public async testClientCanInvokeDiscoveredMethodPassingObject(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new UnaryServiceHandler(async (context, request) => request);\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const discoveryResponse = await client.discoverMethod({\n            consumedMethod: {\n                consumedService: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'Unary'\n            }\n        });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(2);\n            const method = discoveryResponse.methods[0];\n            this.assertDiscoveredMethodValid(method);\n            // invoke discovered\n            await new Promise((invocationResolve, invocationReject) => {\n                client.sendUnaryRequest(\n                    method.providedMethod as ProvidedMethodReference,\n                    echoRequest, {\n                        value: response => {\n                            this.assertEqual(echoRequest, response);\n                            invocationResolve();\n                        },\n                        error: (e) => invocationReject(e)\n                    }, \n                    plexus.plexus.interop.testing.EchoRequest, \n                    plexus.plexus.interop.testing.EchoRequest);\n            });\n        } else {\n            throw 'Empty response';\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public async testMethodDiscoveredByOutputMessageId(): Promise<void> {\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, new NopServiceHandler());\n        const discoveryResponse = await client.discoverMethod({ outputMessageId: 'plexus.interop.testing.EchoRequest' });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(4);\n            discoveryResponse.methods.forEach(\n                method => this.assertDiscoveredMethodValid(method));\n        } else {\n            throw 'Empty response';\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public async testMethodDiscoveredByReference(): Promise<void> {\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, new NopServiceHandler());\n        const discoveryResponse = await client.discoverMethod({\n            consumedMethod: {\n                consumedService: {\n                    serviceId: 'plexus.interop.testing.EchoService'\n                },\n                methodId: 'Unary'\n            }\n        });\n        if (discoveryResponse.methods) {\n            expect(discoveryResponse.methods.length).to.be.eq(2);\n            discoveryResponse.methods.forEach(\n                method => this.assertDiscoveredMethodValid(method));\n        } else {\n            throw 'Empty response';\n        }\n        await this.clientsSetup.disconnect(client, server);\n    }\n    \n    private assertDiscoveredMethodValid(discoveredMethod: DiscoveredMethod): void {\n        expect(discoveredMethod.providedMethod).to.not.be.undefined;\n        expect(discoveredMethod.inputMessageId).to.be.eq('plexus.interop.testing.EchoRequest');\n        expect(discoveredMethod.outputMessageId).to.be.eq('plexus.interop.testing.EchoRequest');\n        expect(discoveredMethod.options).to.not.be.undefined;\n        let options = discoveredMethod.options || [];\n        expect(options.length).to.be.greaterThan(0);\n        expect(options[0].id).to.be.eq('interop.ProvidedMethodOptions.title');\n        expect(options[0].value).to.be.eq(discoveredMethod.methodTitle);\n    }\n\n    private assertDiscoveredServiceMethodValid(discoveredMethod: DiscoveredServiceMethod): void {\n        expect(discoveredMethod.methodId).to.not.be.undefined;\n        expect(discoveredMethod.methodTitle).to.not.be.undefined;\n        expect(discoveredMethod.inputMessageId).to.be.eq('plexus.interop.testing.EchoRequest');\n        expect(discoveredMethod.outputMessageId).to.be.eq('plexus.interop.testing.EchoRequest');\n        let options = discoveredMethod.options || [];\n        expect(options.length).to.be.greaterThan(0);\n        expect(options[0].id).to.be.eq('interop.ProvidedMethodOptions.title');\n        expect(options[0].value).to.be.eq(discoveredMethod.methodTitle);\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/DynamicInvocationTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseEchoTest } from './BaseEchoTest';\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { UnaryServiceHandler } from './UnaryServiceHandler';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { ClientStreamingHandler } from './ClientStreamingHandler';\nimport { expect } from 'chai';\n\nexport class DynamicInvocationTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public async testClientCanSendDynamicPointToPointRequest(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new UnaryServiceHandler(async (context, request) => request);\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        return new Promise<void>(async (resolve, reject) => {\n            client.sendUnaryRequest({\n                methodId: 'Unary',\n                serviceId: 'plexus.interop.testing.EchoService'\n            }, echoRequest, {\n                    value: async response => {\n                        this.assertEqual(echoRequest, response);\n                        await this.clientsSetup.disconnect(client, server);\n                        resolve();\n                    },\n                    error: (e) => reject(e)\n                }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n        });\n    }\n\n    public async testClientCanSendDynamicStreamingRequest(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new ClientStreamingHandler((context, hostClient) => {\n            return {\n                next: async clientRequest => {\n                    this.assertEqual(echoRequest, clientRequest);\n                    hostClient.next(clientRequest);\n                    hostClient.complete();\n                },\n                complete: () => { },\n                error: (e) => { },\n                streamCompleted: () => { }\n            };\n        });\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        return new Promise<void>(async (resolve, reject) => {\n            let remoteCompleted = false;\n            let remoteStreamCompleted = false;\n            const invocationClient = await client.sendBidirectionalStreamingRequest({\n                methodId: 'DuplexStreaming',\n                serviceId: 'plexus.interop.testing.EchoService'\n            }, {\n                next: serverResponse => {\n                    try {\n                        this.assertEqual(echoRequest, serverResponse);\n                    } catch (error) {\n                        reject(error);\n                    }\n                },\n                error: e => reject(e),\n                complete: () => remoteCompleted = true,\n                streamCompleted: () => remoteStreamCompleted = true\n            }, plexus.plexus.interop.testing.EchoRequest, plexus.plexus.interop.testing.EchoRequest);\n\n            invocationClient.next(echoRequest);\n            await invocationClient.complete();\n            expect(remoteCompleted).to.be.true;\n            expect(remoteStreamCompleted).to.be.true;\n            await this.clientsSetup.disconnect(client, server);\n            resolve();\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/EchoClientBenchmark.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseEchoTest } from './BaseEchoTest';\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { BenchmarkResult } from '../common/BenchmarkResult';\nimport { UnaryServiceHandler } from './UnaryServiceHandler';\nimport { MethodInvocationContext, MethodType } from '@plexus-interop/client';\nimport { ServerStreamingHandler } from './ServerStreamingHandler';\nimport { CancellationToken } from '@plexus-interop/common';\n\nexport class EchoClientBenchmark extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public async testUnaryMessagesSentWithinPeriod(bytesPerMessage: number, periodInMillis: number): Promise<BenchmarkResult> {\n        const echoRequest = this.clientsSetup.createRequestOfBytes(bytesPerMessage);\n        const handler = new UnaryServiceHandler(async (context: MethodInvocationContext, request) => request);\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const start = Date.now();\n        const finish = start + periodInMillis;\n        let sentMessagesCount = 0;\n        let lastReceived = 0;\n        while (finish > lastReceived) {\n            await client.getEchoServiceProxy().unary(echoRequest);\n            lastReceived = Date.now();\n            sentMessagesCount++;\n        }\n        await this.clientsSetup.disconnect(client, server);\n        return {\n            periodInMillis,\n            methodType: MethodType.Unary,\n            messagesSent: sentMessagesCount,\n            bytesSent: sentMessagesCount * bytesPerMessage,\n            millisPerMessage: (lastReceived - start) / sentMessagesCount\n        };\n    }\n\n    public async testStreamingEventsSentWithinPeriod(bytesPerMessage: number, periodInMillis: number): Promise<BenchmarkResult> {\n        const echoRequest = this.clientsSetup.createRequestOfBytes(bytesPerMessage);\n        const cancellationToken = new CancellationToken();\n        const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n            function sendMessages() {\n                if (!cancellationToken.isCancelled()) {\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    setTimeout(sendMessages, 0);\n                } else {\n                    hostClient.complete();   \n                }\n            }\n            sendMessages();\n        });              \n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        return new Promise<BenchmarkResult>(async (resolve, reject) => {\n            const start = Date.now();\n            const finish = start + periodInMillis;\n            let sentMessagesCount = 0;\n            let lastReceived = 0;      \n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: response => {\n                    if (cancellationToken.isCancelled()) {\n                        return;\n                    }\n                    sentMessagesCount++;\n                    lastReceived = Date.now();\n                    if (finish < lastReceived) { \n                        cancellationToken.cancel();\n                    }\n                },\n                complete: async () => {\n                    await this.clientsSetup.disconnect(client, server);\n                    resolve({\n                        periodInMillis,\n                        methodType: MethodType.Unary,\n                        messagesSent: sentMessagesCount,\n                        bytesSent: sentMessagesCount * bytesPerMessage,\n                        millisPerMessage: (lastReceived - start) / sentMessagesCount\n                    });\n                },\n                error: (e) => {\n                    reject(e);\n                },\n                streamCompleted: () => {}\n            });\n        });\n        \n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/NopServiceHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EchoServiceInvocationHandler } from '../../src/echo/server/EchoServerGeneratedClient';\nimport { StreamingInvocationClient, MethodInvocationContext, InvocationObserver } from '@plexus-interop/client';\nimport { Observer } from '@plexus-interop/common';\n\nimport * as plexus from '../../src/echo/server/plexus-messages';\n\nexport class NopServiceHandler implements EchoServiceInvocationHandler {\n\n    public onUnary(context: MethodInvocationContext, request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest> {\n        throw new Error('Not implemented');\n    }\n\n    public onServerStreaming(\n        context: MethodInvocationContext, \n        request: plexus.plexus.interop.testing.IEchoRequest, \n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): void {\n        throw new Error('Not implemented');        \n    }\n\n    public onClientStreaming(\n        context: MethodInvocationContext, \n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest> {\n        throw new Error('Not implemented');        \n    }\n\n    public onDuplexStreaming(\n        context: MethodInvocationContext, \n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): InvocationObserver<plexus.plexus.interop.testing.IEchoRequest> {\n        throw new Error('Not implemented');        \n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/PointToPointInvocationTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { UnaryServiceHandler } from './UnaryServiceHandler';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { ClientError } from '@plexus-interop/protocol';\nimport { expect } from 'chai';\nimport { MethodInvocationContext } from '@plexus-interop/client';\nimport { NopServiceHandler } from './NopServiceHandler';\nimport { AsyncHelper } from '@plexus-interop/common';\n\nexport class PointToPointInvocationTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testMessageSent(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return this.testMessageSentInternal(echoRequest);\n    }\n\n    public testAliasedServiceInvoked(): Promise<void> {\n        return new Promise<void>((resolve, reject) => {\n            const echoRequest = this.clientsSetup.createRequestDto();\n            return this.clientsSetup\n                .createEchoClients(this.connectionProvider, new NopServiceHandler())\n                .then(clients => {\n                    return clients[0].getServiceAliasProxy()\n                        .unary(echoRequest)\n                        .then(echoResponse => {\n                            this.assertEqual(echoRequest, echoResponse);\n                            return this.clientsSetup.disconnect(clients[0], clients[1]);\n                        });\n                })\n                .then(() => resolve())\n                .catch(error => reject(error));\n        });\n    }\n\n    public testHugeMessageSent(): Promise<void> {\n        const echoRequest = this.clientsSetup.createHugeRequestDto(10 * 1024 * 1024);\n        return this.testMessageSentInternal(echoRequest);\n    }\n\n    public testHostExecutionExceptionReceived(): Promise<void> {\n        const errorText = 'Host error';\n        return this.testHostsExecutionErrorReceivedInternal(new Error(errorText), errorText, false);\n    }\n\n    public testHostsExecutionClientErrorReceived(): Promise<void> {\n        const errorText = 'Host error';\n        return this.testHostsExecutionErrorReceivedInternal(new ClientError(errorText), errorText);\n    }\n\n    public testHostsExecutionErrorReceived(): Promise<void> {\n        const errorText = 'Host error';\n        return this.testHostsExecutionErrorReceivedInternal(new Error(errorText), errorText);\n    }\n\n    public testHostsExecutionStringErrorReceived(): Promise<void> {\n        const errorText = 'Host error';\n        return this.testHostsExecutionErrorReceivedInternal(errorText, errorText);\n    }\n\n    public async testGeneratedClientCanCancelUnaryInvocation(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        let serverReceivedCancel = false;\n        const handler = new UnaryServiceHandler(context => {\n            return new Promise<plexus.plexus.interop.testing.IEchoRequest>(() => {\n                context.cancellationToken.onCancel(() => serverReceivedCancel = true);\n                // \"long running operation\" do not return any result\n            });\n        });\n        const [echoClient, echoServer] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const cancellableResponse = await echoClient.getEchoServiceProxy().unaryWithCancellation(echoRequest);\n        await cancellableResponse.invocation.cancel();\n        await this.clientsSetup.disconnect(echoClient, echoServer);\n        // tslint:disable-next-line: no-unused-expression\n        await AsyncHelper.waitFor(() => serverReceivedCancel === true, undefined, 10, 500);\n    }\n\n    public async testGeneratedClientCanGetResponseFromCancellableUnaryInvocation(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        const handler = new UnaryServiceHandler(async () => echoRequest);\n        const [echoClient, echoServer] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const cancellableResponse = await echoClient.getEchoServiceProxy().unaryWithCancellation(echoRequest);\n        const echoResponse = await cancellableResponse.response;\n        await this.clientsSetup.disconnect(echoClient, echoServer);\n        this.assertEqual(echoRequest, echoResponse);\n    }\n\n    public testFewMessagesSent(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return new Promise<void>((resolve, reject) => {\n            const handler = new UnaryServiceHandler(async (context: MethodInvocationContext, request) => request);\n            return this.clientsSetup.createEchoClients(this.connectionProvider, handler)\n                .then(clients => {\n                    return (async () => {\n                        let echoResponse = await clients[0].getEchoServiceProxy().unary(echoRequest);\n                        this.assertEqual(echoRequest, echoResponse);\n                        echoResponse = await clients[0].getEchoServiceProxy().unary(echoRequest);\n                        this.assertEqual(echoRequest, echoResponse);\n                        echoResponse = await clients[0].getEchoServiceProxy().unary(echoRequest);\n                        this.assertEqual(echoRequest, echoResponse);\n                    })()\n                        .then(() => {\n                            return this.clientsSetup.disconnect(clients[0], clients[1]);\n                        });\n                })\n                .then(() => resolve())\n                .catch(error => {\n                    reject(error);\n                });\n        });\n\n    }\n\n    private testMessageSentInternal(echoRequest: plexus.plexus.interop.testing.IEchoRequest): Promise<void> {\n        return new Promise<void>((resolve, reject) => {\n            const handler = new UnaryServiceHandler(async (context: MethodInvocationContext, request) => {\n                try {\n                    this.verifyInvocationContext(context);\n                    this.assertEqual(request, echoRequest);\n                } catch (error) {\n                    reject(error);\n                }\n                return request;\n            });\n            return this.clientsSetup.createEchoClients(this.connectionProvider, handler)\n                .then(clients => {\n                    return clients[0].getEchoServiceProxy()\n                        .unary(echoRequest)\n                        .then(echoResponse => {\n                            this.assertEqual(echoRequest, echoResponse);\n                            return this.clientsSetup.disconnect(clients[0], clients[1]);\n                        });\n                })\n                .then(() => resolve())\n                .catch(error => reject(error));\n        });\n    }\n\n    private testHostsExecutionErrorReceivedInternal(errorObj: any, errorText: string, isPromise: boolean = true): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return new Promise<void>((resolve, reject) => {\n            const handler = new UnaryServiceHandler((context: MethodInvocationContext, request) => {\n                if (isPromise) {\n                    return Promise.reject(errorObj);\n                }\n                throw errorObj;\n            });\n            this.clientsSetup.createEchoClients(this.connectionProvider, handler)\n                .then(clients => {\n                    return clients[0].getEchoServiceProxy()\n                        .unary(echoRequest)\n                        .then(echoResponse => {\n                            reject('Should not happen');\n                        })\n                        .catch(error => {\n                            expect(error.message).to.eq(errorText);\n                            return this.clientsSetup.disconnect(clients[0], clients[1]);\n                        });\n                })\n                .then(() => resolve())\n                .catch(error => reject(error));\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/ServerStreamingHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NopServiceHandler } from './NopServiceHandler';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { StreamingInvocationClient, MethodInvocationContext } from '@plexus-interop/client';\n\nexport class ServerStreamingHandler extends NopServiceHandler {\n\n    constructor(private handler: (\n        context: MethodInvocationContext,\n        request: plexus.plexus.interop.testing.IEchoRequest, \n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>) => void) {\n        super();\n    }\n\n    public onServerStreaming(\n        context: MethodInvocationContext,        \n        request: plexus.plexus.interop.testing.IEchoRequest, \n        hostClient: StreamingInvocationClient<plexus.plexus.interop.testing.IEchoRequest>): void {\n        this.handler(context, request, hostClient);        \n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/ServerStreamingInvocationTests.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionProvider } from '../common/ConnectionProvider';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { ServerStreamingHandler } from './ServerStreamingHandler';\nimport { BaseEchoTest } from './BaseEchoTest';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { ClientError } from '@plexus-interop/protocol';\nimport { expect } from 'chai';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\nimport { AsyncHelper } from '@plexus-interop/common';\n\nexport class ServerStreamingInvocationTests extends BaseEchoTest {\n\n    public constructor(\n        private connectionProvider: ConnectionProvider,\n        private clientsSetup: ClientsSetup = new ClientsSetup()) {\n        super();\n    }\n\n    public testServerSendsStreamToClient(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        let serverInvocationContext: MethodInvocationContext | null = null;\n        return new Promise<void>(async (resolve, reject) => {\n            const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n                try {\n                    this.verifyInvocationContext(context);\n                    serverInvocationContext = context;\n                    await this.assertEqual(request, echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.complete();\n                } catch (error) {\n                    reject(error);\n                }\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n            const responses: plexus.plexus.interop.testing.IEchoRequest[] = [];\n\n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: (response) => {\n                    responses.push(response);\n                },\n                complete: async () => {\n                    expect(responses.length).is.eq(3);\n                    responses.forEach(r => this.assertEqual(r, echoRequest));\n                    await this.clientsSetup.disconnect(client, server);\n                    if (serverInvocationContext && serverInvocationContext.cancellationToken.isCancelled()) {\n                        reject('Server should not receive cancel for success completion');\n                    } else {\n                        resolve();\n                    }\n                },\n                error: (e) => {\n                    reject(e);\n                },\n                streamCompleted: () => { }\n            });\n        });\n    }\n\n    public testServerSendsStreamWithErrorToClient(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return new Promise<void>(async (resolve, reject) => {\n            const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n                try {\n                    await this.assertEqual(request, echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.error(new ClientError('Host error', 'Error Details'));\n                } catch (error) {\n                    reject(error);\n                }\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: () => { },\n                complete: async () => {\n                    reject('Not expected to be completed');\n                },\n                error: async e => {\n                    await this.clientsSetup.disconnect(client, server);\n                    resolve();\n                },\n                streamCompleted: () => { }\n            });\n        });\n    }\n\n    public async testClientCanCancelServerStreamingRequest(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        let cancelReceivedByServer = false;\n        const handler = new ServerStreamingHandler((context, request, hostClient) => {\n            hostClient.next(echoRequest);\n            context.cancellationToken.onCancel(() => {\n                cancelReceivedByServer = true;\n            });\n        });\n        const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n        const invocationClient = await client.getEchoServiceProxy().serverStreaming(this.clientsSetup.createRequestDto(), {\n            next: () => { },\n            complete: async () => { },\n            error: async () => { },\n            streamCompleted: () => { }\n        });\n        await invocationClient.cancel();\n        await AsyncHelper.waitFor(() => cancelReceivedByServer === true);\n        await this.clientsSetup.disconnect(client, server);\n    }\n\n    public testServerExceptionReceivedByClient(): Promise<void> {\n        const errorText = 'Host error';\n        return new Promise<void>(async (resolve, reject) => {\n            const handler = new ServerStreamingHandler(() => {\n                throw new Error(errorText);\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n            client.getEchoServiceProxy().serverStreaming(this.clientsSetup.createRequestDto(), {\n                next: () => {\n                    reject('Not expected to receive update');\n                },\n                complete: async () => {\n                    reject('Not expected to be completed');\n                },\n                error: async e => {\n                    expect(e.message).to.eq(errorText);\n                    await this.clientsSetup.disconnect(client, server);\n                    resolve();\n                },\n                streamCompleted: () => { }\n            });\n        });\n    }\n\n    public testServerSendsFewStreamsInParrallelToClient(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return new Promise<void>(async (resolve, reject) => {\n            const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n                try {\n                    await this.assertEqual(request, echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.next(echoRequest);\n                    hostClient.complete();\n                } catch (error) {\n                    reject(error);\n                }\n            });\n\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n\n            let firstCompleted = false;\n            let secondCompleted = false;\n\n            // first\n            const firstResponses: plexus.plexus.interop.testing.IEchoRequest[] = [];\n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: response => firstResponses.push(response),\n                complete: async () => {\n                    firstCompleted = true;\n                    expect(firstResponses.length).is.eq(3);\n                    firstResponses.forEach(r => this.assertEqual(r, echoRequest));\n                    if (secondCompleted) {\n                        await this.clientsSetup.disconnect(client, server);\n                        resolve();\n                    }\n                },\n                error: e => reject(e),\n                streamCompleted: () => { }\n            });\n\n            // second\n            const secondResponses: plexus.plexus.interop.testing.IEchoRequest[] = [];\n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: response => secondResponses.push(response),\n                complete: async () => {\n                    secondCompleted = true;\n                    expect(secondResponses.length).is.eq(3);\n                    secondResponses.forEach(r => this.assertEqual(r, echoRequest));\n                    if (firstCompleted) {\n                        await this.clientsSetup.disconnect(client, server);\n                        resolve();\n                    }\n                },\n                error: e => reject(e),\n                streamCompleted: () => { }\n            });\n        });\n    }\n\n    public testServerSendsStreamWithCancelToClient(): Promise<void> {\n        const echoRequest = this.clientsSetup.createRequestDto();\n        return new Promise<void>(async (resolve, reject) => {\n            const handler = new ServerStreamingHandler(async (context, request, hostClient) => {\n                try {\n                    await this.assertEqual(request, echoRequest);\n                    await hostClient.cancel();\n                } catch (error) {\n                    reject(error);\n                }\n            });\n            const [client, server] = await this.clientsSetup.createEchoClients(this.connectionProvider, handler);\n\n            client.getEchoServiceProxy().serverStreaming(echoRequest, {\n                next: () => { },\n                complete: async () => {\n                    await this.clientsSetup.disconnect(client, server);\n                    resolve();\n                },\n                error: async () => { },\n                streamCompleted: () => { }\n            });\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/echo/UnaryServiceHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NopServiceHandler } from './NopServiceHandler';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { MethodInvocationContext } from '@plexus-interop/client';\n\nexport class UnaryServiceHandler extends NopServiceHandler {\n\n    public constructor(private handler: (context: MethodInvocationContext, request: plexus.plexus.interop.testing.IEchoRequest) => Promise<plexus.plexus.interop.testing.IEchoRequest>) {\n        super();\n    }\n\n    public onUnary(context: MethodInvocationContext, request: plexus.plexus.interop.testing.IEchoRequest): Promise<plexus.plexus.interop.testing.IEchoRequest> {\n        return this.handler(context, request);\n    }\n\n}"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketClientConnectivity.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { expect } from 'chai';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { ClientConnectivityTests } from '../echo/ClientConnectivityTests';\nimport { EchoClientClientBuilder } from '../../src/echo/client/EchoClientGeneratedClient';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\n\ndescribe('Web Socket Client connectivity', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n    const wsUrl = readWsUrl();\n\n    const connectivityTests = new ClientConnectivityTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    it('Can receive WS URL from Broker', () => {\n        expect(wsUrl).is.not.empty;\n    });\n\n    it('Can connect/disconnect from running Broker instance', function (done) {\n        this.timeout(5000);\n        let wsUrl = readWsUrl();\n        clientsSetup\n            .createEchoClient(transportsSetup.createWebSocketTransportProvider(wsUrl))\n            .then(client => {\n                expect(client).to.not.be.undefined;\n                client.disconnect().then(() => {\n                    done();\n                });\n            });\n    });\n\n    it('Connects when second connect is successfull', done => {\n        const wsUrl = readWsUrl();\n        const provider = transportsSetup.createWebSocketTransportProvider(wsUrl);\n        let count = 0;\n        const failAndSuccessProvider = () => {\n            if (count === 0) {\n                count++;\n                return Promise.reject('Failed');\n            } else {\n                return provider().then(setup => setup.getConnection());\n            }\n        }\n        new EchoClientClientBuilder()\n            .withTransportConnectionProvider(failAndSuccessProvider)\n            .connect()\n            .then(client => {\n                // tslint:disable-next-line: no-unused-expression\n                expect(client).to.not.be.undefined;\n                client.disconnect().then(() => {\n                    done();\n                });\n            });\n    });\n\n    it('Failed to connect if Web Socket server is not available', function (done) {\n        this.timeout(10000);    \n        new EchoClientClientBuilder()\n            .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket('ws://127.0.0.1:11111')).connect())\n            .connect()\n            .catch(e => {\n                // tslint:disable-next-line:no-console\n                console.log('Connection error', e);\n                done();\n            });\n    });\n\n    it('Received error for open invocation on disconnect', function () {\n        return connectivityTests.testInvocationClientReceiveErrorOnClientDisconnect();\n    });\n\n    it('Receives error if provide wrong client id to Broker', function () {\n        return connectivityTests.testClientReceiveErrorIfProvideWrongId();\n    });\n\n    it('Server receives error if client dropped connection', function () {\n        return connectivityTests.testServerReceivesErrorIfClientDroppedConnection();\n    });\n\n    it('Client receives error if server dropped connection', function () {\n        return connectivityTests.testClientReceivesErrorIfServerDroppedConnection();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketCommonApi.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { readWsUrl } from '../common/utils';\nimport { InteropPlatformFactory, MethodImplementation, InteropPeerDescriptor, Stream, StreamImplementation, StreamObserver, InteropPlatform } from '@plexus-interop/common-api-impl';\nimport { expect } from 'chai';\nimport { BaseEchoTest } from '../echo/BaseEchoTest';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport * as plexus from '../../src/echo/server/plexus-messages';\nimport { AsyncHelper } from '@plexus-interop/common';\n\n// tslint:disable:no-unused-expression\ndescribe('Client: Common API Implementation', () => {\n\n    const webSocketUrl = readWsUrl();\n\n    const factory = new InteropPlatformFactory();\n\n    const clientsSetup = new ClientsSetup();\n    const testUtils = new BaseEchoTest();\n\n    it('Creates Interop Platform Factory', async () => {\n\n        const platform = factory.createPlatform({ webSocketUrl });\n        expect(platform).to.not.be.undefined;\n\n    });\n\n    it('Connects to Broker', async () => {\n\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        const client = await platform.connect('echo-client');\n        expect(client).to.not.be.undefined;\n        await client.disconnect();\n\n    });\n\n    it('Subscribes to stream and receives data from provider', async () => {\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        const stream: StreamImplementation = {\n            name: 'server-stream',\n            onSubscriptionRequested: async (streamObserver: StreamObserver, caller: InteropPeerDescriptor, args?: any) => {\n                streamObserver.next(args);\n                streamObserver.next(args);\n                streamObserver.next(args);\n                streamObserver.completed();\n                return {\n                    unsubscribe: async () => { }\n                };\n            }\n        };\n\n        const client = await platform.connect('echo-client');\n        const server = await platform.connect('echo-server', undefined, [], [stream]);\n        const request = clientsSetup.createRequestDto();\n        const received: any[] = [];\n\n        let completed = false;\n        await client.subscribe('server-stream', {\n            next: async v => { received.push(v); },\n            error: async e => { },\n            completed: async () => {\n                completed = true;\n            }\n        }, request);\n\n        await AsyncHelper.waitFor(() => completed, undefined, 50, 2000);\n        expect(received.length).to.be.eq(3);\n\n        for (let response of received) {\n            testUtils.assertEqual(request, response as plexus.plexus.interop.testing.IEchoRequest);\n        }\n\n        await client.disconnect();\n        await server.disconnect();\n    });\n\n    it('Returns all peer descriptors', async () => {\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        const definitions = await platform.getPeerDefinitions();\n        // tslint:disable-next-line:no-console\n        const names = definitions.map(d => d.applicationName);\n        expect(names).to.have.members(['echo-server', 'echo-client']);\n    });\n\n    it('Discovers streams', async () => {\n\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        const stream: StreamImplementation = {\n            name: 'server-stream',\n            onSubscriptionRequested: async (streamObserver: StreamObserver, caller: InteropPeerDescriptor, args?: any) => {\n                streamObserver.completed();\n                return {\n                    unsubscribe: async () => { }\n                };\n            }\n        };\n\n        const client = await platform.connect('echo-client');\n        const server = await platform.connect('echo-server', undefined, [], [stream]);\n        const streams = await client.discoverStreams();\n\n        await client.disconnect();\n        await server.disconnect();\n\n        expect(streams.length).to.be.greaterThan(0);\n\n    });\n\n    it('Discovers methods', async () => {\n\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        const client = await platform.connect('echo-client');\n        const method: MethodImplementation = {\n            name: 'unary-method',\n            onInvoke: async (args: any, caller: InteropPeerDescriptor) => args\n        };\n        const server = await platform.connect('echo-server', undefined, [method]);\n        const methods = await client.discoverMethods();\n\n        await client.disconnect();\n        await server.disconnect();\n\n        expect(methods.length).to.be.greaterThan(0);\n\n    });\n\n\n    it('Sends request and receives response', async () => {\n\n        const platform: InteropPlatform = factory.createPlatform({ webSocketUrl });\n        let invoked = false;\n        const method: MethodImplementation = {\n            name: 'unary-method',\n            onInvoke: async (args: any, caller: InteropPeerDescriptor) => {\n                invoked = true;\n                return args;\n            }\n        };\n\n        const client = await platform.connect('echo-client');\n        const server = await platform.connect('echo-server', undefined, [method]);\n        const request = clientsSetup.createRequestDto();\n        const response = await client.invoke('unary-method', request);\n\n        expect(invoked).to.be.true;\n        expect(response).to.not.be.undefined;\n        testUtils.assertEqual(request, response.result as plexus.plexus.interop.testing.IEchoRequest);\n        expect(client).to.not.be.undefined;\n        expect(server).to.not.be.undefined;\n\n        await client.disconnect();\n        await server.disconnect();\n\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketDiscovery.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { DiscoveryTests } from '../echo/DiscoveryTests';\n\ndescribe('Client: Web Socket Discovery', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n\n    const wsUrl = readWsUrl();    \n    \n    const discoveryTests = new DiscoveryTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    it('Receives discovered methods by input message id', function() {\n        this.timeout(3000);\n        return discoveryTests.testMethodDiscoveredByInputMessageId();\n    });\n\n    it('Receives discovered methods by output message id', function() {\n        return discoveryTests.testMethodDiscoveredByOutputMessageId();\n    });\n\n    it('Receives discovered methods by method reference', function() {\n        return discoveryTests.testMethodDiscoveredByReference();\n    });\n\n    it('Receives discovered service by service ID', function() {\n        return discoveryTests.testServiceDiscoveredById();\n    });\n\n    it('Can invoke discovered unary method passing serialized data', function() {\n        this.timeout(3000);\n        return discoveryTests.testClientCanInvokeDiscoveredMethodPassingRawData();\n    });\n\n    it('Can invoke discovered unary method passing plain object', function() {\n        this.timeout(3000);\n        return discoveryTests.testClientCanInvokeDiscoveredMethodPassingObject();\n    });\n\n    it('Can invoke discovered server streaming method passing serialized data', function() {\n        return discoveryTests.testClientCanInvokeDiscoveredServerStreamingRequest();\n    });\n\n    it('Can invoke discovered bidi streaming method passing serialized data', function() {\n        return discoveryTests.testClientCanInvokeDiscoveredBidiStreamingRequest();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketDynamicInvocationTests.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { DynamicInvocationTests } from '../echo/DynamicInvocationTests';\n\ndescribe('Client: Web Socket Dynamic invocation', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n\n    const wsUrl = readWsUrl();    \n    \n    const dynamicInvocationTests = new DynamicInvocationTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    it('Sends dynamic unary invocation and receives response', function() {\n        return dynamicInvocationTests.testClientCanSendDynamicPointToPointRequest();\n    });\n\n    it('Sends dynamic streaming invocation and receives response', function() {\n        return dynamicInvocationTests.testClientCanSendDynamicStreamingRequest();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketMetadataLoader.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DefaultConnectionDetailsService } from '@plexus-interop/client';\nimport { readWsUrl } from '../common/utils';\nimport { UrlInteropRegistryProvider } from '@plexus-interop/metadata';\nimport { WebSocketDataProvider } from '@plexus-interop/remote';\nimport { expect } from 'chai';\n\nconst wsUrl = readWsUrl();\nconst metadataUrl = new DefaultConnectionDetailsService().getDefaultUrl(wsUrl);\n\ndescribe('WebSocket metadata loader', () => {\n\n    it('Loads metadata from default url', async () => {\n        const loader = new WebSocketDataProvider();\n        const metadata = await loader.getSingleMessage(metadataUrl);\n        expect(metadata).contains('applications');\n    });\n\n});\n\ndescribe('URL Metadata Data loader', () => {\n\n    it('Loads and parses metadata from Web Socket URL', async () => {\n        const wsUrl = readWsUrl();        \n        const urlMetadataProvider = new UrlInteropRegistryProvider(metadataUrl);\n        await urlMetadataProvider.start();\n        const registry = urlMetadataProvider.getCurrent();\n        expect(registry.applications.valuesArray().length).to.be.greaterThan(0);\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketPlainDtoTests.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { PointToPointInvocationTests } from '../echo/PointToPointInvocationTests';\nimport { UnaryServiceHandler } from '../echo/UnaryServiceHandler';\nimport { MethodInvocationContext } from '@plexus-interop/client-api';\nimport { InvocationRequestInfo } from '@plexus-interop/client';\nimport { BaseEchoTest } from '../echo/BaseEchoTest';\nimport { UrlInteropRegistryProvider } from '@plexus-interop/metadata';\nimport { DynamicBinaryMarshallerProvider } from '@plexus-interop/io/dist/main/src/dynamic';\n\ndescribe('Client: Web Socket Send Plain JS Object', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n\n    const wsUrl = readWsUrl();    \n    const metadataWsUrl = `${wsUrl}/metadata/interop`;\n    const connectionProvider = transportsSetup.createWebSocketTransportProvider(wsUrl);\n    const testUtils = new BaseEchoTest();\n\n    it('Sends invocation request and receives response', async () => {\n        const echoRequest = clientsSetup.createRequestDto();\n        const interopProvider = new UrlInteropRegistryProvider(metadataWsUrl);\n        await interopProvider.start();\n        const marshallerProvider = new DynamicBinaryMarshallerProvider(interopProvider.getCurrent());\n\n        return new Promise<void>((resolve, reject) => {\n            const handler = new UnaryServiceHandler(async (context: MethodInvocationContext, request) => {\n                try {\n                    testUtils.assertEqual(request, echoRequest);\n                } catch (error) {\n                    reject(error);\n                }\n                return request;\n            });\n            clientsSetup.createGenericClientAndStaticServer(marshallerProvider, connectionProvider, handler)\n                .then(clients => {\n                    const [genericClient, genericServer] = clients;\n                    const invocationInfo: InvocationRequestInfo = {\n                        methodId: 'Unary',\n                        serviceId: 'plexus.interop.testing.EchoService'\n                    };\n                    genericClient.sendUnaryRequest(invocationInfo, echoRequest, {\n                        value: echoResponse => {\n                            testUtils.assertEqual(echoRequest, echoResponse);\n                            genericClient.disconnect()\n                                .then(() => genericServer.disconnect())\n                                .then(() => resolve());\n                        },\n                        error: e => reject(e)\n                    }, 'plexus.interop.testing.EchoRequest', 'plexus.interop.testing.EchoRequest');\n                })\n                .catch(error => reject(error));\n        });      \n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketPointToPoint.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// tslint:disable: only-arrow-functions\n// tslint:disable: typedef\n// tslint:disable: no-invalid-this\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { PointToPointInvocationTests } from '../echo/PointToPointInvocationTests';\n\ndescribe('Client: Web Socket Point to Point invocation', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n\n    const wsUrl = readWsUrl();    \n    \n    const pointToPointTests = new PointToPointInvocationTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    it('Sends invocation request and receives response', function() {\n        return pointToPointTests.testMessageSent();\n    });\n\n    it('Sends invocation request to aliased service and receives response', function() {\n        return pointToPointTests.testAliasedServiceInvoked();\n    });\n\n    it('Sends invocation request with huge payload and receives response', function() {\n        this.timeout(10000);\n        return pointToPointTests.testHugeMessageSent();\n    });\n\n    it('Sends few invocations in a row', function() {\n        return pointToPointTests.testFewMessagesSent();\n    });\n\n    it('Receives error from host', function() {\n        return pointToPointTests.testHostsExecutionErrorReceived();\n    });\n\n    it('Receives Client Error from host', function() {\n        return pointToPointTests.testHostsExecutionClientErrorReceived();\n    });\n\n    it('Receives string error from host', function() {\n        return pointToPointTests.testHostsExecutionStringErrorReceived();\n    });\n\n    it('Receives exception from host', function() {\n        return pointToPointTests.testHostExecutionExceptionReceived();\n    });\n\n    it('Supports cancel of Unary Invocation by Generated Client', () => {\n        return pointToPointTests.testGeneratedClientCanCancelUnaryInvocation();\n    });\n\n    it('Supports receiving of result from cancellable Unary Invocation by Generated Client', () => {\n        return pointToPointTests.testGeneratedClientCanGetResponseFromCancellableUnaryInvocation();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/WebSocketStreaming.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readWsUrl } from '../common/utils';\nimport { ServerStreamingInvocationTests } from '../echo/ServerStreamingInvocationTests';\nimport { BidiStreamingInvocationTests } from '../echo/BidiStreamingTests';\nimport { ClientStreamingTests } from '../echo/ClientStreamingTests';\n\n// tslint:disable: only-arrow-functions\n// tslint:disable: typedef\n// tslint:disable: no-invalid-this\ndescribe('Client: Web Socket Streaming invocation', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n\n    const wsUrl = readWsUrl();\n\n    const serverStreamingTests = new ServerStreamingInvocationTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    const bidiStreamingTests = new BidiStreamingInvocationTests(\n        transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    const clientStreamingTests = new ClientStreamingTests(transportsSetup.createWebSocketTransportProvider(wsUrl),\n        clientsSetup);\n\n    it('Sends streaming response from server using serverStreaming invocation', function () {\n        return serverStreamingTests.testServerSendsStreamToClient();\n    });\n\n    it('Sends few streams in parrallel to client using serverStreaming invocation', function () {\n        return serverStreamingTests.testServerSendsFewStreamsInParrallelToClient();\n    });\n\n    it('Sends stream of messages and error to client', function () {\n        return serverStreamingTests.testServerSendsStreamWithErrorToClient();\n    });\n\n    it('Sends stream of messages and cancel operation to client', function () {\n        return serverStreamingTests.testServerSendsStreamWithCancelToClient();\n    });\n\n    it('Sends streaming messages in two directions', function () {\n        this.timeout(5000);\n        return bidiStreamingTests.testClientAndServerCanSendMessages();\n    });\n\n    it('Sends client stream messages to server', function () {\n        return clientStreamingTests.testClientCanSendStreamToServer();\n    });\n\n    it('Server receives client\\'s completion before response for Client Streaming', function () {\n        return clientStreamingTests.testServerReceivesClientCompletionBeforeResponse();\n    });\n\n    it('Client can cancel invocation', function() {\n        return bidiStreamingTests.testClientCanCancelInvocation();\n    });\n\n    it('Client receives exception from server', function() {\n        return serverStreamingTests.testServerExceptionReceivedByClient();\n    });\n\n    it('Client can cancel server streaming invocation', function() {\n        this.timeout(5000);\n        return serverStreamingTests.testClientCanCancelServerStreamingRequest();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/native/benchmarks/WebSocketTransportBenchmark.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { expect } from 'chai';\nimport { ClientsSetup } from '../../common/ClientsSetup';\nimport { TransportsSetup } from '../../common/TransportsSetup';\nimport { readWsUrl } from '../../common/utils';\nimport { EchoClientBenchmark } from '../../echo/EchoClientBenchmark';\n\ndescribe('Web Socket Client Benchmarks', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n    const wsUrl = readWsUrl();\n\n    const echoServiceBenchmark = new EchoClientBenchmark(\n        transportsSetup.createWebSocketTransportProvider(wsUrl), \n        clientsSetup);\n\n    it('Sends ~35 point to point requests in 1 second', function() {\n        this.timeout(5000);\n        return (async () => {\n            const result = await echoServiceBenchmark.testUnaryMessagesSentWithinPeriod(1024, 3000);\n            console.log('Benchmark result:', JSON.stringify(result));\n            expect(result.messagesSent).to.be.greaterThan(100);\n        })();\n    });\n\n    it('Sends ~200 streaming messages in 1 second', function() {\n        this.timeout(5000);\n        return (async () => {\n            const result = await echoServiceBenchmark.testStreamingEventsSentWithinPeriod(1024, 3000);\n            console.log('Benchmark result:', JSON.stringify(result));\n            expect(result.messagesSent).to.be.greaterThan(600);\n        })();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/web/WebBrokerClientConnectivity.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { expect } from 'chai';\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readHostUrl } from '../common/utils';\nimport { ClientConnectivityTests } from '../echo/ClientConnectivityTests';\n\ndescribe('Web Broker: Client connectivity', () => {\n\n    const clientsSetup = new ClientsSetup();\n    const transportsSetup = new TransportsSetup();\n    const proxyHost = readHostUrl();\n\n    const connectivityTests = new ClientConnectivityTests(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    it('Can receive Proxy Host from Broker', () => {\n        expect(proxyHost).is.not.empty;\n    });\n\n    it('Can connect/disconnect from running Broker instance', async function () {\n        this.timeout(5000);\n        return clientsSetup\n            .createEchoClient(transportsSetup.createCrossDomainTransportProvider(proxyHost))\n            .then(client => {\n                expect(client).to.not.be.undefined;\n                return client.disconnect();\n            })\n            .catch(e => {\n                console.error('Failed', e);\n                throw e;\n            });\n    });\n\n    it('Receives error if provide wrong client id to Broker', function () {\n        return connectivityTests.testClientReceiveErrorIfProvideWrongId();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/web/WebBrokerDiscovery.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readHostUrl } from '../common/utils';\nimport { DiscoveryTests } from '../echo/DiscoveryTests';\n\ndescribe('Web Broker: Discovery', () => {\n\n    const clientsSetup = new ClientsSetup(500);\n    const transportsSetup = new TransportsSetup();\n\n    const proxyHost = readHostUrl();\n\n    const discoveryTests = new DiscoveryTests(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    it('Receives discovered methods by input message id', function() {\n        this.timeout(3000);\n        return discoveryTests.testMethodDiscoveredByInputMessageId();\n    });\n\n    it('Receives discovered methods by output message id', function() {\n        return discoveryTests.testMethodDiscoveredByOutputMessageId();\n    });\n\n    it('Receives discovered methods by method reference', function() {\n        return discoveryTests.testMethodDiscoveredByReference();\n    });\n\n    it('Can invoke discovered unary method passing serialized data', function() {\n        this.timeout(3000);\n        return discoveryTests.testClientCanInvokeDiscoveredMethodPassingRawData();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/web/WebBrokerPointToPoint.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readHostUrl } from '../common/utils';\nimport { PointToPointInvocationTests } from '../echo/PointToPointInvocationTests';\n\ndescribe('Web Broker: Point to Point invocation', () => {\n\n    const clientsSetup = new ClientsSetup(500);\n    const transportsSetup = new TransportsSetup();\n\n    const proxyHost = readHostUrl();\n\n    const pointToPointTests = new PointToPointInvocationTests(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    it('Sends invocation request and receives response', function () {\n        this.timeout(5000);\n        return pointToPointTests.testMessageSent();\n    });\n\n    it('Sends few invocations in a row', function() {\n        this.timeout(10000);     \n        return pointToPointTests.testFewMessagesSent();\n    });\n\n    it('Receives error from host', function() {\n        this.timeout(10000);        \n        return pointToPointTests.testHostsExecutionErrorReceived();\n    });\n\n    it('Receives Client Error from host', function() {\n        this.timeout(10000);        \n        return pointToPointTests.testHostsExecutionClientErrorReceived();\n    });\n\n    it('Receives string error from host', function() {\n        this.timeout(10000);        \n        return pointToPointTests.testHostsExecutionStringErrorReceived();\n    });\n\n    it('Receives exception from host', function() {\n        this.timeout(10000);        \n        return pointToPointTests.testHostExecutionExceptionReceived();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/web/WebBrokerStreaming.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientsSetup } from '../common/ClientsSetup';\nimport { TransportsSetup } from '../common/TransportsSetup';\nimport { readHostUrl } from '../common/utils';\nimport { ServerStreamingInvocationTests } from '../echo/ServerStreamingInvocationTests';\nimport { BidiStreamingInvocationTests } from '../echo/BidiStreamingTests';\nimport { ClientStreamingTests } from '../echo/ClientStreamingTests';\n\ndescribe('Web Broker: Streaming invocations', () => {\n\n    const clientsSetup = new ClientsSetup(500);\n    const transportsSetup = new TransportsSetup();\n\n    const proxyHost = readHostUrl();\n\n    const serverStreamingTests = new ServerStreamingInvocationTests(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    const bidiStreamingTests = new BidiStreamingInvocationTests(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    const clientStreamingTests = new ClientStreamingTests(transportsSetup.createCrossDomainTransportProvider(proxyHost),\n        clientsSetup);\n\n    it('Sends streaming response from server using serverStreaming invocation', function () {\n        return serverStreamingTests.testServerSendsStreamToClient();\n    });\n\n    it('Sends few streams in parrallel to client using serverStreaming invocation', function () {\n        return serverStreamingTests.testServerSendsFewStreamsInParrallelToClient();\n    });\n\n    it('Sends stream of messages and error to client', function () {\n        return serverStreamingTests.testServerSendsStreamWithErrorToClient();\n    });\n\n    it('Sends stream of messages and cancel operation to client', function () {\n        return serverStreamingTests.testServerSendsStreamWithCancelToClient();\n    });\n\n    it('Sends streaming messages in two directions', function () {\n        this.timeout(5000);\n        return bidiStreamingTests.testClientAndServerCanSendMessages();\n    });\n\n    it('Sends client stream messages to server', function () {\n        return clientStreamingTests.testClientCanSendStreamToServer();\n    });\n\n    it('Client can cancel invocation', function () {\n        return bidiStreamingTests.testClientCanCancelInvocation();\n    });\n\n    it('Client receives exception from server', function () {\n        return serverStreamingTests.testServerExceptionReceivedByClient();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tests/web/benchmarks/WebBrokerTransportBenchmark.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { expect } from 'chai';\nimport { ClientsSetup } from '../../common/ClientsSetup';\nimport { TransportsSetup } from '../../common/TransportsSetup';\nimport { readHostUrl } from '../../common/utils';\nimport { EchoClientBenchmark } from '../../echo/EchoClientBenchmark';\n\ndescribe('Web Broker Client Benchmarks', () => {\n\n    const clientsSetup = new ClientsSetup(500);\n    const transportsSetup = new TransportsSetup();\n\n    const proxyHost = readHostUrl();\n\n    const echoServiceBenchmark = new EchoClientBenchmark(\n        transportsSetup.createCrossDomainTransportProvider(proxyHost), \n        clientsSetup);\n\n    it('Sends ~20 point to point requests in 1 second', function() {\n        this.timeout(6000);\n        return (async () => {\n            const result = await echoServiceBenchmark.testUnaryMessagesSentWithinPeriod(1024, 3000);\n            console.log('Benchmark result:', JSON.stringify(result));\n            expect(result.messagesSent).to.be.greaterThan(60);\n        })();\n    });\n\n    it('Sends ~200 streaming messages in 1 second', function() {\n        this.timeout(6000);\n        return (async () => {\n            const result = await echoServiceBenchmark.testStreamingEventsSentWithinPeriod(1024, 3000);\n            console.log('Benchmark result:', JSON.stringify(result));\n            expect(result.messagesSent).to.be.greaterThan(600);\n        })();\n    });\n\n});"
  },
  {
    "path": "web/packages/e2e/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"mocha\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/e2e/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/electron-launcher/ElectronAppLauncher.cmd",
    "content": "CD %~dp0apps\\ElectronAppLauncher\\\nstart cmd /c ElectronAppLauncher.exe %*"
  },
  {
    "path": "web/packages/electron-launcher/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/electron-app-launcher\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Plexus Electron App Launcher Example\",\n  \"productName\": \"Plexus Electron App Launcher\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"./dist/electronLauncher.bundle.js\",\n  \"private\": true,\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"build\": \"yarn build:main && npm run copy-gen-folders && npm run package && npm run build-binary\",\n    \"package\": \"browserify ./dist/main/src/launcher/Main.js -x electron --ignore-missing --node --outfile ./dist/electronLauncher.bundle.js\",\n    \"copy-gen-folders\": \"copyfiles src/launcher/gen/* dist/main\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\",\n    \"unit\": \"yarn build && jest --coverage\",\n    \"gen-launcher-js\": \"pbjs --force-long -t static-module -r launcher -w commonjs -o src/launcher/gen/plexus-messages.js ../../../plexus-desktop/src/Plexus.Interop.Samples.Configuration/metadata/interop/appLauncher.proto ../../../plexus-desktop/src/Plexus.Interop.Samples.Configuration/metadata/interop/common.proto\",\n    \"gen-launcher-ts\": \"pbts --force-long -o src/launcher/gen/plexus-messages.d.ts src/launcher/gen/plexus-messages.js\",\n    \"gen-launcher-protocol\": \"npm run gen-launcher-js && npm run gen-launcher-ts\",\n    \"build-binary\": \"electron-packager . ElectronAppLauncher --ignore node_modules\\\\/\\\\@plexus-interop\\\\/.+\\\\/node_modules --prune true --overwrite true --out=../../../bin/win-x86/samples/greeting/apps && npm run rename-packages && copyfiles ElectronAppLauncher.cmd ../../../bin/win-x86/samples/greeting\",\n    \"prestart\": \"npm run build\",\n    \"start\": \"node_modules/.bin/electron .\",\n    \"rename-packages\": \"trash ../../../bin/win-x86/samples/greeting/apps/ElectronAppLauncher && renamer --find ElectronAppLauncher-.* --regex --replace ElectronAppLauncher ../../../bin/win-x86/samples/greeting/apps/*\"\n  },\n  \"keywords\": [\n    \"plexus\",\n    \"electron\",\n    \"launcher\"\n  ],\n  \"dependencies\": {\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"minimist\": \"^1.2.0\",\n    \"strip-bom\": \"^3.0.0\",\n    \"rxjs\": \"^5.5.2\",\n    \"protobufjs\": \"6.11.3\",\n    \"@types/loglevel\": \"^1.4.29\",\n    \"ws\": \"^3.2.0\"\n  },\n  \"devDependencies\": {\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"@types/long\": \"^4.0.0\",\n    \"browserify\": \"^14.5.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"electron\": \"1.8.8\",\n    \"electron-log\": \"^2.2.9\",\n    \"electron-packager\": \"^13.1.1\",\n    \"jest\": \"^23.5.0\",\n    \"renamer\": \"^0.6.1\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"typescript\": \"3.7.2\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/electron-launcher/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/electron-launcher/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './launcher/ElectronAppLauncher';"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/ElectronAppLauncher.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { BrowserWindow } from 'electron';\nimport { ElectronAppLauncherClientBuilder, ElectronAppLauncherClient } from './client/ElectronAppLauncherGeneratedClient';\nimport * as plexus from './gen/plexus-messages';\nimport { UniqueId } from '@plexus-interop/transport-common';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport * as fs from 'fs';\nimport * as log from 'loglevel';\nimport { MethodInvocationContext } from '@plexus-interop/client';\nconst stripBom = require('strip-bom');\nconst path = require('path');\n\n/**\n * Simple launcher, open apps with provided URL and pass App Instance ID and Broker Web Socket URL to them.\n * Properties can be read in renderer process as below:\n * \n *   var electron = require('electron');\n *   const currentWindow = electron.remote.getCurrentWindow();\n *   const appInstanceId = currentWindow.plexusAppInstanceId;\n *   const plexusBrokerWsUrl = currentWindow.plexusBrokerWsUrl;\n * \n */\nexport class ElectronAppLauncher {\n\n    private plexusClient: ElectronAppLauncherClient | null = null;\n    private connected: boolean = false;\n\n    private readonly instanceIdEnvProperty: string = 'PLEXUS_APP_INSTANCE_ID';\n    private readonly brokerDirEnvProperty: string = 'PLEXUS_BROKER_WORKING_DIR';\n    private readonly brokerServerNameEnvProperty: string = 'PLEXUS_BROKER_SERVER_NAME';\n\n    private readonly defaultBrokerServerName = \"ws-v1\";\n    private webSocketAddress: string;\n    \n    public constructor(\n        private log: Logger = LoggerFactory.getLogger('ElectronAppLauncher'),\n        private launchOnStartup: string[],\n        private defaultBrokerWorkingDir: string) {}\n\n    public async start(): Promise<void> {\n\n        if (this.connected) {\n            throw new Error('Already started');\n        }\n\n        const brokerWorkingDir = this.readBrokerWorkingDir();\n        const brokerServerName = this.getBrokerServerName();\n        this.webSocketAddress = await this.readWebSocketUrl(brokerWorkingDir, brokerServerName);\n        const launcherAppInstanceId = this.getAppInstanceId();\n\n        this.log.info(`App Instance ID ${launcherAppInstanceId}`);\n        this.log.info(`Broker Working Directory ${brokerWorkingDir}`);\n        this.log.info(`Broker is running Web Socket Server on ${this.webSocketAddress}, connecting to broker`);\n\n        return new ElectronAppLauncherClientBuilder()\n            .withClientDetails({\n                applicationId: 'interop.ElectronAppLauncher',\n                applicationInstanceId: launcherAppInstanceId\n            })\n            .withAppLauncherServiceInvocationsHandler({\n                onLaunch: async (methodInvocationContext: MethodInvocationContext, request: plexus.interop.IAppLaunchRequest) => {\n                    this.log.info('Received launch request: ' + JSON.stringify(request));\n                    let launchPath = this.readPath(request);\n                    return this.launchApp(launchPath);\n                }\n            })\n            .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket(this.webSocketAddress)).connect())\n            .connect()\n            .then((client) => {\n                this.plexusClient = client;\n                this.connected = true;\n                log.info('Launcher client connected to Broker');\n                this.launchOnStartup.forEach(launchPath => {\n                    this.launchApp(launchPath)\n                        .then(() => log.info(`App Launched for ${launchPath} path`))\n                        .catch(() => log.error(`Could not launch app for ${launchPath} path`));\n                });\n            })\n            .catch(e => {\n                log.error('Error connecting to broker' + e);\n                throw e;\n            });\n\n    }\n    \n    public isCompleteUri(uriString: string): boolean {\n        return uriString.startsWith('file:/')\n            || uriString.startsWith('http:/')\n            || uriString.startsWith('https:/');\n    }\n\n    public async disconnect(): Promise<void> {\n        if (!this.connected || !this.plexusClient) {\n            throw new Error('Not connected');\n        }\n        return this.plexusClient.disconnect();\n    }\n\n    private launchApp(launchPath: string): Promise<plexus.interop.IAppLaunchResponse> {\n        this.log.info('Launching app for path: ' + launchPath);\n        if (!this.isCompleteUri(launchPath)) {\n            // relative file path\n            launchPath = this.toFileUri(launchPath);\n            this.log.info('Launch path resolved to absolute path: ' + launchPath);\n        }\n        const appInstanceId = UniqueId.generateNew();\n        this.log.info(`Launching instance [${appInstanceId.toString()}] with URL [${launchPath}]`);\n        return new Promise<plexus.interop.IAppLaunchResponse>((resolve, reject) => {\n            const window = new BrowserWindow();\n            // pass url and instance id to App's window\n            const windowAny: any = window;\n            windowAny.plexusBrokerWsUrl = this.webSocketAddress;\n            windowAny.plexusAppInstanceId = appInstanceId;\n            window.webContents.on('did-finish-load', () => {\n                this.log.debug('Window loaded');\n                resolve({\n                    appInstanceId\n                });\n            });\n            window.once('ready-to-show', () => {\n                this.log.debug('Window ready to show');\n                window.show();\n            });\n            window.loadURL(launchPath);\n        });\n    }\n\n    private toFileUri(filePath: string): string {\n        filePath = path.resolve(filePath).replace(/\\\\/g, '/');\n        // tslint:disable-next-line:quotemark\n        if (filePath[0] !== '/') {\n            // tslint:disable-next-line:quotemark\n            filePath = '/' + filePath;\n        }\n        return encodeURI('file://' + filePath);\n    }\n\n    private readPath(request: plexus.interop.IAppLaunchRequest): string {\n        if (!request.launchParamsJson) {\n            throw new Error('Request parameters empty, couldn\\'t detect launch URL');\n        }\n        const paramsObj = JSON.parse(request.launchParamsJson);\n        if (!paramsObj.path) {\n            throw new Error('url parameter empty');\n        }\n        return paramsObj.path;\n    }\n\n    private readBrokerWorkingDir(): string {\n        let brokerDir = process.env[this.brokerDirEnvProperty];\n        this.log.debug(`Received broker ID ${brokerDir}`);\n        if (!brokerDir) {\n            this.log.debug(`${this.brokerDirEnvProperty} env property is empty, resolving to default ${this.defaultBrokerWorkingDir}`);\n            brokerDir = path.resolve(this.defaultBrokerWorkingDir);\n        }\n        return brokerDir as string;\n    }\n\n    private getBrokerServerName(): string {\n        const serverName = process.env[this.brokerServerNameEnvProperty];\n        this.log.debug(`Received broker server name ${serverName}`);\n        if (!serverName) {\n            this.log.debug(`${this.brokerServerNameEnvProperty} env property is empty, resolving to default ${this.defaultBrokerServerName}`);\n            return this.defaultBrokerServerName;\n        }\n        return serverName as string;\n    }\n\n    private getAppInstanceId(): UniqueId {\n        const instanceId = process.env[this.instanceIdEnvProperty];\n        this.log.debug(`Received instance ID ${instanceId}`);\n        if (!instanceId) {\n            this.log.info('Instance ID not provided by broker, generate new');\n            return UniqueId.generateNew();\n        }\n        return UniqueId.fromString(instanceId);\n    }\n\n    private readWebSocketUrl(workingDir: string, serverName: string): Promise<string> {\n        const path = `${workingDir}/servers/${serverName}/address`;\n        this.log.info(`Reading WS URL from ${path}`);\n        return new Promise((resolve, reject) => {\n            fs.readFile(path, 'utf8', (err, data) => {\n                if (err) {\n                    this.log.error('Unable to read file', err);\n                    reject(err);\n                } else {\n                    data = stripBom(data);\n                    this.log.debug(`Loaded WS address ${data}`);\n                    resolve(data);\n                }\n            });\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/Main.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ndeclare var global: any;\n// tslint:disable-next-line:no-unused-variable\nglobal.WebSocket = global.WebSocket || require('ws');\nconst argv = require('minimist')(process.argv.slice(1));\n\nimport { app } from 'electron';\nimport { FileLogger } from './logger/FileLogger';\nimport { LoggerFactory, LogLevel, PrefixedLogger } from '@plexus-interop/common';\n\nLoggerFactory.setLogLevel(LogLevel.TRACE);\nlet log = new FileLogger(LoggerFactory.getLogger('ElectronLauncherMain'));\n\n// substitute logger implementation with simple file logger\nLoggerFactory.getLogger = (name: string) => new PrefixedLogger(log, name);\n\nimport { ElectronAppLauncher } from './ElectronAppLauncher';\n\nlog.info('Started');\n\nconst appsToLaunch = argv.apps ? argv.apps.split(';') : [];\nconst brokerDefaultDir = argv.brokerDir || '../..';\n\napp.on('ready', () => {\n    log.info('Connecting to Broker');\n    const electronAppLauncher = new ElectronAppLauncher(log, appsToLaunch, brokerDefaultDir);\n    electronAppLauncher.start()\n        .then(() => {\n            log.info('Connected to Broker');\n        })\n        .catch(e => {\n            log.error('Connection to broker failed', e);\n            app.quit();\n        })\n});"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/client/ElectronAppLauncherGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodInvocationContext, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient, GenericRequest, GenericClientApiBase } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer } from '@plexus-interop/common';\nimport { InvocationObserver, InvocationObserverConverter, ContainerAwareClientAPIBuilder } from '@plexus-interop/client';\n\nimport * as plexus from '../gen/plexus-messages';\n\n\n\n/**\n * Main client API\n */\nexport interface ElectronAppLauncherClient extends GenericClientApi  {\n\n\n}\n\n/**\n * Client's API internal implementation\n */\nclass ElectronAppLauncherClientImpl extends GenericClientApiBase implements ElectronAppLauncherClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi,\n    ) {\n        super(genericClient);\n    }\n\n\n}\n\n/**\n * Client invocation handler for AppLauncherService, to be implemented by Client\n */\nexport abstract class AppLauncherServiceInvocationHandler {\n\n    public abstract onLaunch(invocationContext: MethodInvocationContext, request: plexus.interop.IAppLaunchRequest): Promise<plexus.interop.IAppLaunchResponse>;\n}\n\n/**\n * Client API builder\n */\nexport class ElectronAppLauncherClientBuilder {\n\n    private clientDetails: ClientConnectRequest = {\n        applicationId: 'interop.ElectronAppLauncher'\n    };\n\n    private transportConnectionProvider: () => Promise<TransportConnection>;\n\n    private appLauncherServiceHandler: AppLauncherServiceInvocationHandler;\n\n    public withClientDetails(clientId: ClientConnectRequest): ElectronAppLauncherClientBuilder {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    public withAppInstanceId(appInstanceId: UniqueId): ElectronAppLauncherClientBuilder {\n        this.clientDetails.applicationInstanceId = appInstanceId;\n        return this;\n    }\n\n    public withAppId(appId: string): ElectronAppLauncherClientBuilder {\n        this.clientDetails.applicationId = appId;\n        return this;\n    }\n\n    public withAppLauncherServiceInvocationsHandler(invocationsHandler: AppLauncherServiceInvocationHandler): ElectronAppLauncherClientBuilder {\n        this.appLauncherServiceHandler = invocationsHandler;\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): ElectronAppLauncherClientBuilder {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    public connect(): Promise<ElectronAppLauncherClient> {\n        return new ContainerAwareClientAPIBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            .withTypeAwareUnaryHandler({\n                serviceInfo: {\n                    serviceId: 'interop.AppLauncherService'\n                },\n                methodId: 'Launch',\n                handle: this.appLauncherServiceHandler.onLaunch.bind(this.appLauncherServiceHandler)\n            }, plexus.interop.AppLaunchRequest, plexus.interop.AppLaunchResponse)\n            .connect()\n            .then((genericClient: GenericClientApi) => new ElectronAppLauncherClientImpl(\n                genericClient\n));\n    }\n}\n"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/gen/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from 'protobufjs';\n\n/** Namespace interop. */\nexport namespace interop {\n\n    /** Represents an AppLauncherService */\n    class AppLauncherService extends $protobuf.rpc.Service {\n\n        /**\n         * Constructs a new AppLauncherService service.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         */\n        constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n        /**\n         * Creates new AppLauncherService service using the specified rpc implementation.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         * @returns RPC service. Useful where requests and/or responses are streamed.\n         */\n        public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AppLauncherService;\n\n        /**\n         * Calls Launch.\n         * @param request AppLaunchRequest message or plain object\n         * @param callback Node-style callback called with the error, if any, and AppLaunchResponse\n         */\n        public launch(request: interop.IAppLaunchRequest, callback: interop.AppLauncherService.LaunchCallback): void;\n\n        /**\n         * Calls Launch.\n         * @param request AppLaunchRequest message or plain object\n         * @returns Promise\n         */\n        public launch(request: interop.IAppLaunchRequest): Promise<interop.AppLaunchResponse>;\n\n        /**\n         * Calls GetAvailableApps.\n         * @param request GetAvailableAppsRequest message or plain object\n         * @param callback Node-style callback called with the error, if any, and GetAvailableAppsResponse\n         */\n        public getAvailableApps(request: interop.IGetAvailableAppsRequest, callback: interop.AppLauncherService.GetAvailableAppsCallback): void;\n\n        /**\n         * Calls GetAvailableApps.\n         * @param request GetAvailableAppsRequest message or plain object\n         * @returns Promise\n         */\n        public getAvailableApps(request: interop.IGetAvailableAppsRequest): Promise<interop.GetAvailableAppsResponse>;\n\n        /**\n         * Calls GetAppInstanceStateStream.\n         * @param request GetAppInstanceStateRequest message or plain object\n         * @param callback Node-style callback called with the error, if any, and GetAppInstanceStateResponse\n         */\n        public getAppInstanceStateStream(request: interop.IGetAppInstanceStateRequest, callback: interop.AppLauncherService.GetAppInstanceStateStreamCallback): void;\n\n        /**\n         * Calls GetAppInstanceStateStream.\n         * @param request GetAppInstanceStateRequest message or plain object\n         * @returns Promise\n         */\n        public getAppInstanceStateStream(request: interop.IGetAppInstanceStateRequest): Promise<interop.GetAppInstanceStateResponse>;\n    }\n\n    namespace AppLauncherService {\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#launch}.\n         * @param error Error, if any\n         * @param [response] AppLaunchResponse\n         */\n        type LaunchCallback = (error: (Error|null), response?: interop.AppLaunchResponse) => void;\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#getAvailableApps}.\n         * @param error Error, if any\n         * @param [response] GetAvailableAppsResponse\n         */\n        type GetAvailableAppsCallback = (error: (Error|null), response?: interop.GetAvailableAppsResponse) => void;\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#getAppInstanceStateStream}.\n         * @param error Error, if any\n         * @param [response] GetAppInstanceStateResponse\n         */\n        type GetAppInstanceStateStreamCallback = (error: (Error|null), response?: interop.GetAppInstanceStateResponse) => void;\n    }\n\n    /** Properties of an AppLaunchRequest. */\n    interface IAppLaunchRequest {\n\n        /** AppLaunchRequest appId */\n        appId?: string;\n\n        /** AppLaunchRequest launchParamsJson */\n        launchParamsJson?: string;\n    }\n\n    /** Represents an AppLaunchRequest. */\n    class AppLaunchRequest {\n\n        /**\n         * Constructs a new AppLaunchRequest.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IAppLaunchRequest);\n\n        /** AppLaunchRequest appId. */\n        public appId: string;\n\n        /** AppLaunchRequest launchParamsJson. */\n        public launchParamsJson: string;\n\n        /**\n         * Creates a new AppLaunchRequest instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns AppLaunchRequest instance\n         */\n        public static create(properties?: interop.IAppLaunchRequest): interop.AppLaunchRequest;\n\n        /**\n         * Encodes the specified AppLaunchRequest message. Does not implicitly {@link interop.AppLaunchRequest.verify|verify} messages.\n         * @param message AppLaunchRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IAppLaunchRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified AppLaunchRequest message, length delimited. Does not implicitly {@link interop.AppLaunchRequest.verify|verify} messages.\n         * @param message AppLaunchRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IAppLaunchRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes an AppLaunchRequest message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns AppLaunchRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.AppLaunchRequest;\n\n        /**\n         * Decodes an AppLaunchRequest message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns AppLaunchRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.AppLaunchRequest;\n\n        /**\n         * Verifies an AppLaunchRequest message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates an AppLaunchRequest message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns AppLaunchRequest\n         */\n        public static fromObject(object: { [k: string]: any }): interop.AppLaunchRequest;\n\n        /**\n         * Creates a plain object from an AppLaunchRequest message. Also converts values to other types if specified.\n         * @param message AppLaunchRequest\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.AppLaunchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this AppLaunchRequest to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of an AppLaunchResponse. */\n    interface IAppLaunchResponse {\n\n        /** AppLaunchResponse appInstanceId */\n        appInstanceId?: interop.IUniqueId;\n    }\n\n    /** Represents an AppLaunchResponse. */\n    class AppLaunchResponse {\n\n        /**\n         * Constructs a new AppLaunchResponse.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IAppLaunchResponse);\n\n        /** AppLaunchResponse appInstanceId. */\n        public appInstanceId?: (interop.IUniqueId|null);\n\n        /**\n         * Creates a new AppLaunchResponse instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns AppLaunchResponse instance\n         */\n        public static create(properties?: interop.IAppLaunchResponse): interop.AppLaunchResponse;\n\n        /**\n         * Encodes the specified AppLaunchResponse message. Does not implicitly {@link interop.AppLaunchResponse.verify|verify} messages.\n         * @param message AppLaunchResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IAppLaunchResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified AppLaunchResponse message, length delimited. Does not implicitly {@link interop.AppLaunchResponse.verify|verify} messages.\n         * @param message AppLaunchResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IAppLaunchResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes an AppLaunchResponse message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns AppLaunchResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.AppLaunchResponse;\n\n        /**\n         * Decodes an AppLaunchResponse message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns AppLaunchResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.AppLaunchResponse;\n\n        /**\n         * Verifies an AppLaunchResponse message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates an AppLaunchResponse message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns AppLaunchResponse\n         */\n        public static fromObject(object: { [k: string]: any }): interop.AppLaunchResponse;\n\n        /**\n         * Creates a plain object from an AppLaunchResponse message. Also converts values to other types if specified.\n         * @param message AppLaunchResponse\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.AppLaunchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this AppLaunchResponse to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a GetAvailableAppsRequest. */\n    interface IGetAvailableAppsRequest {\n\n        /** GetAvailableAppsRequest appIds */\n        appIds?: string[];\n    }\n\n    /** Represents a GetAvailableAppsRequest. */\n    class GetAvailableAppsRequest {\n\n        /**\n         * Constructs a new GetAvailableAppsRequest.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IGetAvailableAppsRequest);\n\n        /** GetAvailableAppsRequest appIds. */\n        public appIds: string[];\n\n        /**\n         * Creates a new GetAvailableAppsRequest instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns GetAvailableAppsRequest instance\n         */\n        public static create(properties?: interop.IGetAvailableAppsRequest): interop.GetAvailableAppsRequest;\n\n        /**\n         * Encodes the specified GetAvailableAppsRequest message. Does not implicitly {@link interop.GetAvailableAppsRequest.verify|verify} messages.\n         * @param message GetAvailableAppsRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IGetAvailableAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified GetAvailableAppsRequest message, length delimited. Does not implicitly {@link interop.GetAvailableAppsRequest.verify|verify} messages.\n         * @param message GetAvailableAppsRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IGetAvailableAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a GetAvailableAppsRequest message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns GetAvailableAppsRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.GetAvailableAppsRequest;\n\n        /**\n         * Decodes a GetAvailableAppsRequest message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns GetAvailableAppsRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.GetAvailableAppsRequest;\n\n        /**\n         * Verifies a GetAvailableAppsRequest message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a GetAvailableAppsRequest message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns GetAvailableAppsRequest\n         */\n        public static fromObject(object: { [k: string]: any }): interop.GetAvailableAppsRequest;\n\n        /**\n         * Creates a plain object from a GetAvailableAppsRequest message. Also converts values to other types if specified.\n         * @param message GetAvailableAppsRequest\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.GetAvailableAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this GetAvailableAppsRequest to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a GetAvailableAppsResponse. */\n    interface IGetAvailableAppsResponse {\n\n        /** GetAvailableAppsResponse availableAppIds */\n        availableAppIds?: string[];\n    }\n\n    /** Represents a GetAvailableAppsResponse. */\n    class GetAvailableAppsResponse {\n\n        /**\n         * Constructs a new GetAvailableAppsResponse.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IGetAvailableAppsResponse);\n\n        /** GetAvailableAppsResponse availableAppIds. */\n        public availableAppIds: string[];\n\n        /**\n         * Creates a new GetAvailableAppsResponse instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns GetAvailableAppsResponse instance\n         */\n        public static create(properties?: interop.IGetAvailableAppsResponse): interop.GetAvailableAppsResponse;\n\n        /**\n         * Encodes the specified GetAvailableAppsResponse message. Does not implicitly {@link interop.GetAvailableAppsResponse.verify|verify} messages.\n         * @param message GetAvailableAppsResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IGetAvailableAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified GetAvailableAppsResponse message, length delimited. Does not implicitly {@link interop.GetAvailableAppsResponse.verify|verify} messages.\n         * @param message GetAvailableAppsResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IGetAvailableAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a GetAvailableAppsResponse message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns GetAvailableAppsResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.GetAvailableAppsResponse;\n\n        /**\n         * Decodes a GetAvailableAppsResponse message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns GetAvailableAppsResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.GetAvailableAppsResponse;\n\n        /**\n         * Verifies a GetAvailableAppsResponse message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a GetAvailableAppsResponse message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns GetAvailableAppsResponse\n         */\n        public static fromObject(object: { [k: string]: any }): interop.GetAvailableAppsResponse;\n\n        /**\n         * Creates a plain object from a GetAvailableAppsResponse message. Also converts values to other types if specified.\n         * @param message GetAvailableAppsResponse\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.GetAvailableAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this GetAvailableAppsResponse to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of a GetAppInstanceStateRequest. */\n    interface IGetAppInstanceStateRequest {\n\n        /** GetAppInstanceStateRequest appId */\n        appId?: string;\n\n        /** GetAppInstanceStateRequest appInstanceId */\n        appInstanceId?: interop.IUniqueId;\n    }\n\n    /** Represents a GetAppInstanceStateRequest. */\n    class GetAppInstanceStateRequest {\n\n        /**\n         * Constructs a new GetAppInstanceStateRequest.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IGetAppInstanceStateRequest);\n\n        /** GetAppInstanceStateRequest appId. */\n        public appId: string;\n\n        /** GetAppInstanceStateRequest appInstanceId. */\n        public appInstanceId?: (interop.IUniqueId|null);\n\n        /**\n         * Creates a new GetAppInstanceStateRequest instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns GetAppInstanceStateRequest instance\n         */\n        public static create(properties?: interop.IGetAppInstanceStateRequest): interop.GetAppInstanceStateRequest;\n\n        /**\n         * Encodes the specified GetAppInstanceStateRequest message. Does not implicitly {@link interop.GetAppInstanceStateRequest.verify|verify} messages.\n         * @param message GetAppInstanceStateRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IGetAppInstanceStateRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified GetAppInstanceStateRequest message, length delimited. Does not implicitly {@link interop.GetAppInstanceStateRequest.verify|verify} messages.\n         * @param message GetAppInstanceStateRequest message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IGetAppInstanceStateRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a GetAppInstanceStateRequest message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns GetAppInstanceStateRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.GetAppInstanceStateRequest;\n\n        /**\n         * Decodes a GetAppInstanceStateRequest message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns GetAppInstanceStateRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.GetAppInstanceStateRequest;\n\n        /**\n         * Verifies a GetAppInstanceStateRequest message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a GetAppInstanceStateRequest message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns GetAppInstanceStateRequest\n         */\n        public static fromObject(object: { [k: string]: any }): interop.GetAppInstanceStateRequest;\n\n        /**\n         * Creates a plain object from a GetAppInstanceStateRequest message. Also converts values to other types if specified.\n         * @param message GetAppInstanceStateRequest\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.GetAppInstanceStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this GetAppInstanceStateRequest to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** AppInstanceState enum. */\n    enum AppInstanceState {\n        Unknown = 0,\n        Starting = 1,\n        Running = 2,\n        Stopped = 3\n    }\n\n    /** Properties of a GetAppInstanceStateResponse. */\n    interface IGetAppInstanceStateResponse {\n\n        /** GetAppInstanceStateResponse state */\n        state?: interop.AppInstanceState;\n    }\n\n    /** Represents a GetAppInstanceStateResponse. */\n    class GetAppInstanceStateResponse {\n\n        /**\n         * Constructs a new GetAppInstanceStateResponse.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IGetAppInstanceStateResponse);\n\n        /** GetAppInstanceStateResponse state. */\n        public state: interop.AppInstanceState;\n\n        /**\n         * Creates a new GetAppInstanceStateResponse instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns GetAppInstanceStateResponse instance\n         */\n        public static create(properties?: interop.IGetAppInstanceStateResponse): interop.GetAppInstanceStateResponse;\n\n        /**\n         * Encodes the specified GetAppInstanceStateResponse message. Does not implicitly {@link interop.GetAppInstanceStateResponse.verify|verify} messages.\n         * @param message GetAppInstanceStateResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IGetAppInstanceStateResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified GetAppInstanceStateResponse message, length delimited. Does not implicitly {@link interop.GetAppInstanceStateResponse.verify|verify} messages.\n         * @param message GetAppInstanceStateResponse message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IGetAppInstanceStateResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes a GetAppInstanceStateResponse message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns GetAppInstanceStateResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.GetAppInstanceStateResponse;\n\n        /**\n         * Decodes a GetAppInstanceStateResponse message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns GetAppInstanceStateResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.GetAppInstanceStateResponse;\n\n        /**\n         * Verifies a GetAppInstanceStateResponse message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates a GetAppInstanceStateResponse message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns GetAppInstanceStateResponse\n         */\n        public static fromObject(object: { [k: string]: any }): interop.GetAppInstanceStateResponse;\n\n        /**\n         * Creates a plain object from a GetAppInstanceStateResponse message. Also converts values to other types if specified.\n         * @param message GetAppInstanceStateResponse\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.GetAppInstanceStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this GetAppInstanceStateResponse to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n\n    /** Properties of an UniqueId. */\n    interface IUniqueId {\n\n        /** UniqueId lo */\n        lo?: Long;\n\n        /** UniqueId hi */\n        hi?: Long;\n    }\n\n    /** Represents an UniqueId. */\n    class UniqueId {\n\n        /**\n         * Constructs a new UniqueId.\n         * @param [properties] Properties to set\n         */\n        constructor(properties?: interop.IUniqueId);\n\n        /** UniqueId lo. */\n        public lo: Long;\n\n        /** UniqueId hi. */\n        public hi: Long;\n\n        /**\n         * Creates a new UniqueId instance using the specified properties.\n         * @param [properties] Properties to set\n         * @returns UniqueId instance\n         */\n        public static create(properties?: interop.IUniqueId): interop.UniqueId;\n\n        /**\n         * Encodes the specified UniqueId message. Does not implicitly {@link interop.UniqueId.verify|verify} messages.\n         * @param message UniqueId message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encode(message: interop.IUniqueId, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Encodes the specified UniqueId message, length delimited. Does not implicitly {@link interop.UniqueId.verify|verify} messages.\n         * @param message UniqueId message or plain object to encode\n         * @param [writer] Writer to encode to\n         * @returns Writer\n         */\n        public static encodeDelimited(message: interop.IUniqueId, writer?: $protobuf.Writer): $protobuf.Writer;\n\n        /**\n         * Decodes an UniqueId message from the specified reader or buffer.\n         * @param reader Reader or buffer to decode from\n         * @param [length] Message length if known beforehand\n         * @returns UniqueId\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.UniqueId;\n\n        /**\n         * Decodes an UniqueId message from the specified reader or buffer, length delimited.\n         * @param reader Reader or buffer to decode from\n         * @returns UniqueId\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.UniqueId;\n\n        /**\n         * Verifies an UniqueId message.\n         * @param message Plain object to verify\n         * @returns `null` if valid, otherwise the reason why it is not\n         */\n        public static verify(message: { [k: string]: any }): (string|null);\n\n        /**\n         * Creates an UniqueId message from a plain object. Also converts values to their respective internal types.\n         * @param object Plain object\n         * @returns UniqueId\n         */\n        public static fromObject(object: { [k: string]: any }): interop.UniqueId;\n\n        /**\n         * Creates a plain object from an UniqueId message. Also converts values to other types if specified.\n         * @param message UniqueId\n         * @param [options] Conversion options\n         * @returns Plain object\n         */\n        public static toObject(message: interop.UniqueId, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n        /**\n         * Converts this UniqueId to JSON.\n         * @returns JSON object\n         */\n        public toJSON(): { [k: string]: any };\n    }\n}\n\n/** Namespace google. */\nexport namespace google {\n\n    /** Namespace protobuf. */\n    namespace protobuf {\n\n        /** Properties of a FileDescriptorSet. */\n        interface IFileDescriptorSet {\n\n            /** FileDescriptorSet file */\n            file?: google.protobuf.IFileDescriptorProto[];\n        }\n\n        /** Represents a FileDescriptorSet. */\n        class FileDescriptorSet {\n\n            /**\n             * Constructs a new FileDescriptorSet.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IFileDescriptorSet);\n\n            /** FileDescriptorSet file. */\n            public file: google.protobuf.IFileDescriptorProto[];\n\n            /**\n             * Creates a new FileDescriptorSet instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns FileDescriptorSet instance\n             */\n            public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet;\n\n            /**\n             * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @param message FileDescriptorSet message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @param message FileDescriptorSet message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet;\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet;\n\n            /**\n             * Verifies a FileDescriptorSet message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns FileDescriptorSet\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet;\n\n            /**\n             * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.\n             * @param message FileDescriptorSet\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this FileDescriptorSet to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a FileDescriptorProto. */\n        interface IFileDescriptorProto {\n\n            /** FileDescriptorProto name */\n            name?: string;\n\n            /** FileDescriptorProto package */\n            'package'?: string;\n\n            /** FileDescriptorProto dependency */\n            dependency?: string[];\n\n            /** FileDescriptorProto publicDependency */\n            publicDependency?: number[];\n\n            /** FileDescriptorProto weakDependency */\n            weakDependency?: number[];\n\n            /** FileDescriptorProto messageType */\n            messageType?: google.protobuf.IDescriptorProto[];\n\n            /** FileDescriptorProto enumType */\n            enumType?: google.protobuf.IEnumDescriptorProto[];\n\n            /** FileDescriptorProto service */\n            service?: google.protobuf.IServiceDescriptorProto[];\n\n            /** FileDescriptorProto extension */\n            extension?: google.protobuf.IFieldDescriptorProto[];\n\n            /** FileDescriptorProto options */\n            options?: google.protobuf.IFileOptions;\n\n            /** FileDescriptorProto sourceCodeInfo */\n            sourceCodeInfo?: google.protobuf.ISourceCodeInfo;\n\n            /** FileDescriptorProto syntax */\n            syntax?: string;\n        }\n\n        /** Represents a FileDescriptorProto. */\n        class FileDescriptorProto {\n\n            /**\n             * Constructs a new FileDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IFileDescriptorProto);\n\n            /** FileDescriptorProto name. */\n            public name: string;\n\n            /** FileDescriptorProto package. */\n            public package_: string;\n\n            /** FileDescriptorProto dependency. */\n            public dependency: string[];\n\n            /** FileDescriptorProto publicDependency. */\n            public publicDependency: number[];\n\n            /** FileDescriptorProto weakDependency. */\n            public weakDependency: number[];\n\n            /** FileDescriptorProto messageType. */\n            public messageType: google.protobuf.IDescriptorProto[];\n\n            /** FileDescriptorProto enumType. */\n            public enumType: google.protobuf.IEnumDescriptorProto[];\n\n            /** FileDescriptorProto service. */\n            public service: google.protobuf.IServiceDescriptorProto[];\n\n            /** FileDescriptorProto extension. */\n            public extension: google.protobuf.IFieldDescriptorProto[];\n\n            /** FileDescriptorProto options. */\n            public options?: (google.protobuf.IFileOptions|null);\n\n            /** FileDescriptorProto sourceCodeInfo. */\n            public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null);\n\n            /** FileDescriptorProto syntax. */\n            public syntax: string;\n\n            /**\n             * Creates a new FileDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns FileDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto;\n\n            /**\n             * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @param message FileDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @param message FileDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto;\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto;\n\n            /**\n             * Verifies a FileDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns FileDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto;\n\n            /**\n             * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.\n             * @param message FileDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this FileDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a DescriptorProto. */\n        interface IDescriptorProto {\n\n            /** DescriptorProto name */\n            name?: string;\n\n            /** DescriptorProto field */\n            field?: google.protobuf.IFieldDescriptorProto[];\n\n            /** DescriptorProto extension */\n            extension?: google.protobuf.IFieldDescriptorProto[];\n\n            /** DescriptorProto nestedType */\n            nestedType?: google.protobuf.IDescriptorProto[];\n\n            /** DescriptorProto enumType */\n            enumType?: google.protobuf.IEnumDescriptorProto[];\n\n            /** DescriptorProto extensionRange */\n            extensionRange?: google.protobuf.DescriptorProto.IExtensionRange[];\n\n            /** DescriptorProto oneofDecl */\n            oneofDecl?: google.protobuf.IOneofDescriptorProto[];\n\n            /** DescriptorProto options */\n            options?: google.protobuf.IMessageOptions;\n\n            /** DescriptorProto reservedRange */\n            reservedRange?: google.protobuf.DescriptorProto.IReservedRange[];\n\n            /** DescriptorProto reservedName */\n            reservedName?: string[];\n        }\n\n        /** Represents a DescriptorProto. */\n        class DescriptorProto {\n\n            /**\n             * Constructs a new DescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IDescriptorProto);\n\n            /** DescriptorProto name. */\n            public name: string;\n\n            /** DescriptorProto field. */\n            public field: google.protobuf.IFieldDescriptorProto[];\n\n            /** DescriptorProto extension. */\n            public extension: google.protobuf.IFieldDescriptorProto[];\n\n            /** DescriptorProto nestedType. */\n            public nestedType: google.protobuf.IDescriptorProto[];\n\n            /** DescriptorProto enumType. */\n            public enumType: google.protobuf.IEnumDescriptorProto[];\n\n            /** DescriptorProto extensionRange. */\n            public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[];\n\n            /** DescriptorProto oneofDecl. */\n            public oneofDecl: google.protobuf.IOneofDescriptorProto[];\n\n            /** DescriptorProto options. */\n            public options?: (google.protobuf.IMessageOptions|null);\n\n            /** DescriptorProto reservedRange. */\n            public reservedRange: google.protobuf.DescriptorProto.IReservedRange[];\n\n            /** DescriptorProto reservedName. */\n            public reservedName: string[];\n\n            /**\n             * Creates a new DescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns DescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto;\n\n            /**\n             * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @param message DescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @param message DescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto;\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto;\n\n            /**\n             * Verifies a DescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns DescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto;\n\n            /**\n             * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.\n             * @param message DescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this DescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace DescriptorProto {\n\n            /** Properties of an ExtensionRange. */\n            interface IExtensionRange {\n\n                /** ExtensionRange start */\n                start?: number;\n\n                /** ExtensionRange end */\n                end?: number;\n            }\n\n            /** Represents an ExtensionRange. */\n            class ExtensionRange {\n\n                /**\n                 * Constructs a new ExtensionRange.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange);\n\n                /** ExtensionRange start. */\n                public start: number;\n\n                /** ExtensionRange end. */\n                public end: number;\n\n                /**\n                 * Creates a new ExtensionRange instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns ExtensionRange instance\n                 */\n                public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange;\n\n                /**\n                 * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @param message ExtensionRange message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @param message ExtensionRange message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange;\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.\n                 * @param reader Reader or buffer to decode from\n                 * @returns ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange;\n\n                /**\n                 * Verifies an ExtensionRange message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns ExtensionRange\n                 */\n                public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange;\n\n                /**\n                 * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.\n                 * @param message ExtensionRange\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this ExtensionRange to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n\n            /** Properties of a ReservedRange. */\n            interface IReservedRange {\n\n                /** ReservedRange start */\n                start?: number;\n\n                /** ReservedRange end */\n                end?: number;\n            }\n\n            /** Represents a ReservedRange. */\n            class ReservedRange {\n\n                /**\n                 * Constructs a new ReservedRange.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: google.protobuf.DescriptorProto.IReservedRange);\n\n                /** ReservedRange start. */\n                public start: number;\n\n                /** ReservedRange end. */\n                public end: number;\n\n                /**\n                 * Creates a new ReservedRange instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns ReservedRange instance\n                 */\n                public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange;\n\n                /**\n                 * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @param message ReservedRange message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @param message ReservedRange message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange;\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer, length delimited.\n                 * @param reader Reader or buffer to decode from\n                 * @returns ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange;\n\n                /**\n                 * Verifies a ReservedRange message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns ReservedRange\n                 */\n                public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange;\n\n                /**\n                 * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.\n                 * @param message ReservedRange\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this ReservedRange to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n        }\n\n        /** Properties of a FieldDescriptorProto. */\n        interface IFieldDescriptorProto {\n\n            /** FieldDescriptorProto name */\n            name?: string;\n\n            /** FieldDescriptorProto number */\n            number?: number;\n\n            /** FieldDescriptorProto label */\n            label?: google.protobuf.FieldDescriptorProto.Label;\n\n            /** FieldDescriptorProto type */\n            type?: google.protobuf.FieldDescriptorProto.Type;\n\n            /** FieldDescriptorProto typeName */\n            typeName?: string;\n\n            /** FieldDescriptorProto extendee */\n            extendee?: string;\n\n            /** FieldDescriptorProto defaultValue */\n            defaultValue?: string;\n\n            /** FieldDescriptorProto oneofIndex */\n            oneofIndex?: number;\n\n            /** FieldDescriptorProto jsonName */\n            jsonName?: string;\n\n            /** FieldDescriptorProto options */\n            options?: google.protobuf.IFieldOptions;\n        }\n\n        /** Represents a FieldDescriptorProto. */\n        class FieldDescriptorProto {\n\n            /**\n             * Constructs a new FieldDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IFieldDescriptorProto);\n\n            /** FieldDescriptorProto name. */\n            public name: string;\n\n            /** FieldDescriptorProto number. */\n            public number: number;\n\n            /** FieldDescriptorProto label. */\n            public label: google.protobuf.FieldDescriptorProto.Label;\n\n            /** FieldDescriptorProto type. */\n            public type: google.protobuf.FieldDescriptorProto.Type;\n\n            /** FieldDescriptorProto typeName. */\n            public typeName: string;\n\n            /** FieldDescriptorProto extendee. */\n            public extendee: string;\n\n            /** FieldDescriptorProto defaultValue. */\n            public defaultValue: string;\n\n            /** FieldDescriptorProto oneofIndex. */\n            public oneofIndex: number;\n\n            /** FieldDescriptorProto jsonName. */\n            public jsonName: string;\n\n            /** FieldDescriptorProto options. */\n            public options?: (google.protobuf.IFieldOptions|null);\n\n            /**\n             * Creates a new FieldDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns FieldDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto;\n\n            /**\n             * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @param message FieldDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @param message FieldDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto;\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto;\n\n            /**\n             * Verifies a FieldDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns FieldDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto;\n\n            /**\n             * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.\n             * @param message FieldDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this FieldDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace FieldDescriptorProto {\n\n            /** Type enum. */\n            enum Type {\n                TYPE_DOUBLE = 1,\n                TYPE_FLOAT = 2,\n                TYPE_INT64 = 3,\n                TYPE_UINT64 = 4,\n                TYPE_INT32 = 5,\n                TYPE_FIXED64 = 6,\n                TYPE_FIXED32 = 7,\n                TYPE_BOOL = 8,\n                TYPE_STRING = 9,\n                TYPE_GROUP = 10,\n                TYPE_MESSAGE = 11,\n                TYPE_BYTES = 12,\n                TYPE_UINT32 = 13,\n                TYPE_ENUM = 14,\n                TYPE_SFIXED32 = 15,\n                TYPE_SFIXED64 = 16,\n                TYPE_SINT32 = 17,\n                TYPE_SINT64 = 18\n            }\n\n            /** Label enum. */\n            enum Label {\n                LABEL_OPTIONAL = 1,\n                LABEL_REQUIRED = 2,\n                LABEL_REPEATED = 3\n            }\n        }\n\n        /** Properties of an OneofDescriptorProto. */\n        interface IOneofDescriptorProto {\n\n            /** OneofDescriptorProto name */\n            name?: string;\n\n            /** OneofDescriptorProto options */\n            options?: google.protobuf.IOneofOptions;\n        }\n\n        /** Represents an OneofDescriptorProto. */\n        class OneofDescriptorProto {\n\n            /**\n             * Constructs a new OneofDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IOneofDescriptorProto);\n\n            /** OneofDescriptorProto name. */\n            public name: string;\n\n            /** OneofDescriptorProto options. */\n            public options?: (google.protobuf.IOneofOptions|null);\n\n            /**\n             * Creates a new OneofDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns OneofDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto;\n\n            /**\n             * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @param message OneofDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @param message OneofDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto;\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto;\n\n            /**\n             * Verifies an OneofDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns OneofDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto;\n\n            /**\n             * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.\n             * @param message OneofDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this OneofDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of an EnumDescriptorProto. */\n        interface IEnumDescriptorProto {\n\n            /** EnumDescriptorProto name */\n            name?: string;\n\n            /** EnumDescriptorProto value */\n            value?: google.protobuf.IEnumValueDescriptorProto[];\n\n            /** EnumDescriptorProto options */\n            options?: google.protobuf.IEnumOptions;\n        }\n\n        /** Represents an EnumDescriptorProto. */\n        class EnumDescriptorProto {\n\n            /**\n             * Constructs a new EnumDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IEnumDescriptorProto);\n\n            /** EnumDescriptorProto name. */\n            public name: string;\n\n            /** EnumDescriptorProto value. */\n            public value: google.protobuf.IEnumValueDescriptorProto[];\n\n            /** EnumDescriptorProto options. */\n            public options?: (google.protobuf.IEnumOptions|null);\n\n            /**\n             * Creates a new EnumDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns EnumDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto;\n\n            /**\n             * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @param message EnumDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @param message EnumDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto;\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto;\n\n            /**\n             * Verifies an EnumDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns EnumDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto;\n\n            /**\n             * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.\n             * @param message EnumDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this EnumDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of an EnumValueDescriptorProto. */\n        interface IEnumValueDescriptorProto {\n\n            /** EnumValueDescriptorProto name */\n            name?: string;\n\n            /** EnumValueDescriptorProto number */\n            number?: number;\n\n            /** EnumValueDescriptorProto options */\n            options?: google.protobuf.IEnumValueOptions;\n        }\n\n        /** Represents an EnumValueDescriptorProto. */\n        class EnumValueDescriptorProto {\n\n            /**\n             * Constructs a new EnumValueDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IEnumValueDescriptorProto);\n\n            /** EnumValueDescriptorProto name. */\n            public name: string;\n\n            /** EnumValueDescriptorProto number. */\n            public number: number;\n\n            /** EnumValueDescriptorProto options. */\n            public options?: (google.protobuf.IEnumValueOptions|null);\n\n            /**\n             * Creates a new EnumValueDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns EnumValueDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto;\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @param message EnumValueDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @param message EnumValueDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto;\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto;\n\n            /**\n             * Verifies an EnumValueDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns EnumValueDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto;\n\n            /**\n             * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.\n             * @param message EnumValueDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this EnumValueDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a ServiceDescriptorProto. */\n        interface IServiceDescriptorProto {\n\n            /** ServiceDescriptorProto name */\n            name?: string;\n\n            /** ServiceDescriptorProto method */\n            method?: google.protobuf.IMethodDescriptorProto[];\n\n            /** ServiceDescriptorProto options */\n            options?: google.protobuf.IServiceOptions;\n        }\n\n        /** Represents a ServiceDescriptorProto. */\n        class ServiceDescriptorProto {\n\n            /**\n             * Constructs a new ServiceDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IServiceDescriptorProto);\n\n            /** ServiceDescriptorProto name. */\n            public name: string;\n\n            /** ServiceDescriptorProto method. */\n            public method: google.protobuf.IMethodDescriptorProto[];\n\n            /** ServiceDescriptorProto options. */\n            public options?: (google.protobuf.IServiceOptions|null);\n\n            /**\n             * Creates a new ServiceDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns ServiceDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto;\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @param message ServiceDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @param message ServiceDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto;\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto;\n\n            /**\n             * Verifies a ServiceDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns ServiceDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto;\n\n            /**\n             * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.\n             * @param message ServiceDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this ServiceDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a MethodDescriptorProto. */\n        interface IMethodDescriptorProto {\n\n            /** MethodDescriptorProto name */\n            name?: string;\n\n            /** MethodDescriptorProto inputType */\n            inputType?: string;\n\n            /** MethodDescriptorProto outputType */\n            outputType?: string;\n\n            /** MethodDescriptorProto options */\n            options?: google.protobuf.IMethodOptions;\n\n            /** MethodDescriptorProto clientStreaming */\n            clientStreaming?: boolean;\n\n            /** MethodDescriptorProto serverStreaming */\n            serverStreaming?: boolean;\n        }\n\n        /** Represents a MethodDescriptorProto. */\n        class MethodDescriptorProto {\n\n            /**\n             * Constructs a new MethodDescriptorProto.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IMethodDescriptorProto);\n\n            /** MethodDescriptorProto name. */\n            public name: string;\n\n            /** MethodDescriptorProto inputType. */\n            public inputType: string;\n\n            /** MethodDescriptorProto outputType. */\n            public outputType: string;\n\n            /** MethodDescriptorProto options. */\n            public options?: (google.protobuf.IMethodOptions|null);\n\n            /** MethodDescriptorProto clientStreaming. */\n            public clientStreaming: boolean;\n\n            /** MethodDescriptorProto serverStreaming. */\n            public serverStreaming: boolean;\n\n            /**\n             * Creates a new MethodDescriptorProto instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns MethodDescriptorProto instance\n             */\n            public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto;\n\n            /**\n             * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @param message MethodDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @param message MethodDescriptorProto message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto;\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto;\n\n            /**\n             * Verifies a MethodDescriptorProto message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns MethodDescriptorProto\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto;\n\n            /**\n             * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.\n             * @param message MethodDescriptorProto\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this MethodDescriptorProto to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a FileOptions. */\n        interface IFileOptions {\n\n            /** FileOptions javaPackage */\n            javaPackage?: string;\n\n            /** FileOptions javaOuterClassname */\n            javaOuterClassname?: string;\n\n            /** FileOptions javaMultipleFiles */\n            javaMultipleFiles?: boolean;\n\n            /** FileOptions javaGenerateEqualsAndHash */\n            javaGenerateEqualsAndHash?: boolean;\n\n            /** FileOptions javaStringCheckUtf8 */\n            javaStringCheckUtf8?: boolean;\n\n            /** FileOptions optimizeFor */\n            optimizeFor?: google.protobuf.FileOptions.OptimizeMode;\n\n            /** FileOptions goPackage */\n            goPackage?: string;\n\n            /** FileOptions ccGenericServices */\n            ccGenericServices?: boolean;\n\n            /** FileOptions javaGenericServices */\n            javaGenericServices?: boolean;\n\n            /** FileOptions pyGenericServices */\n            pyGenericServices?: boolean;\n\n            /** FileOptions deprecated */\n            deprecated?: boolean;\n\n            /** FileOptions ccEnableArenas */\n            ccEnableArenas?: boolean;\n\n            /** FileOptions objcClassPrefix */\n            objcClassPrefix?: string;\n\n            /** FileOptions csharpNamespace */\n            csharpNamespace?: string;\n\n            /** FileOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents a FileOptions. */\n        class FileOptions {\n\n            /**\n             * Constructs a new FileOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IFileOptions);\n\n            /** FileOptions javaPackage. */\n            public javaPackage: string;\n\n            /** FileOptions javaOuterClassname. */\n            public javaOuterClassname: string;\n\n            /** FileOptions javaMultipleFiles. */\n            public javaMultipleFiles: boolean;\n\n            /** FileOptions javaGenerateEqualsAndHash. */\n            public javaGenerateEqualsAndHash: boolean;\n\n            /** FileOptions javaStringCheckUtf8. */\n            public javaStringCheckUtf8: boolean;\n\n            /** FileOptions optimizeFor. */\n            public optimizeFor: google.protobuf.FileOptions.OptimizeMode;\n\n            /** FileOptions goPackage. */\n            public goPackage: string;\n\n            /** FileOptions ccGenericServices. */\n            public ccGenericServices: boolean;\n\n            /** FileOptions javaGenericServices. */\n            public javaGenericServices: boolean;\n\n            /** FileOptions pyGenericServices. */\n            public pyGenericServices: boolean;\n\n            /** FileOptions deprecated. */\n            public deprecated: boolean;\n\n            /** FileOptions ccEnableArenas. */\n            public ccEnableArenas: boolean;\n\n            /** FileOptions objcClassPrefix. */\n            public objcClassPrefix: string;\n\n            /** FileOptions csharpNamespace. */\n            public csharpNamespace: string;\n\n            /** FileOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new FileOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns FileOptions instance\n             */\n            public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions;\n\n            /**\n             * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @param message FileOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @param message FileOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions;\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions;\n\n            /**\n             * Verifies a FileOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns FileOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions;\n\n            /**\n             * Creates a plain object from a FileOptions message. Also converts values to other types if specified.\n             * @param message FileOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this FileOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace FileOptions {\n\n            /** OptimizeMode enum. */\n            enum OptimizeMode {\n                SPEED = 1,\n                CODE_SIZE = 2,\n                LITE_RUNTIME = 3\n            }\n        }\n\n        /** Properties of a MessageOptions. */\n        interface IMessageOptions {\n\n            /** MessageOptions messageSetWireFormat */\n            messageSetWireFormat?: boolean;\n\n            /** MessageOptions noStandardDescriptorAccessor */\n            noStandardDescriptorAccessor?: boolean;\n\n            /** MessageOptions deprecated */\n            deprecated?: boolean;\n\n            /** MessageOptions mapEntry */\n            mapEntry?: boolean;\n\n            /** MessageOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n\n            /** MessageOptions .interop.messageId */\n            '.interop.messageId'?: string;\n        }\n\n        /** Represents a MessageOptions. */\n        class MessageOptions {\n\n            /**\n             * Constructs a new MessageOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IMessageOptions);\n\n            /** MessageOptions messageSetWireFormat. */\n            public messageSetWireFormat: boolean;\n\n            /** MessageOptions noStandardDescriptorAccessor. */\n            public noStandardDescriptorAccessor: boolean;\n\n            /** MessageOptions deprecated. */\n            public deprecated: boolean;\n\n            /** MessageOptions mapEntry. */\n            public mapEntry: boolean;\n\n            /** MessageOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new MessageOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns MessageOptions instance\n             */\n            public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions;\n\n            /**\n             * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @param message MessageOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @param message MessageOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions;\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions;\n\n            /**\n             * Verifies a MessageOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns MessageOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions;\n\n            /**\n             * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.\n             * @param message MessageOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this MessageOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a FieldOptions. */\n        interface IFieldOptions {\n\n            /** FieldOptions ctype */\n            ctype?: google.protobuf.FieldOptions.CType;\n\n            /** FieldOptions packed */\n            packed?: boolean;\n\n            /** FieldOptions jstype */\n            jstype?: google.protobuf.FieldOptions.JSType;\n\n            /** FieldOptions lazy */\n            lazy?: boolean;\n\n            /** FieldOptions deprecated */\n            deprecated?: boolean;\n\n            /** FieldOptions weak */\n            weak?: boolean;\n\n            /** FieldOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents a FieldOptions. */\n        class FieldOptions {\n\n            /**\n             * Constructs a new FieldOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IFieldOptions);\n\n            /** FieldOptions ctype. */\n            public ctype: google.protobuf.FieldOptions.CType;\n\n            /** FieldOptions packed. */\n            public packed: boolean;\n\n            /** FieldOptions jstype. */\n            public jstype: google.protobuf.FieldOptions.JSType;\n\n            /** FieldOptions lazy. */\n            public lazy: boolean;\n\n            /** FieldOptions deprecated. */\n            public deprecated: boolean;\n\n            /** FieldOptions weak. */\n            public weak: boolean;\n\n            /** FieldOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new FieldOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns FieldOptions instance\n             */\n            public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions;\n\n            /**\n             * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @param message FieldOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @param message FieldOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions;\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions;\n\n            /**\n             * Verifies a FieldOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns FieldOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions;\n\n            /**\n             * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.\n             * @param message FieldOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this FieldOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace FieldOptions {\n\n            /** CType enum. */\n            enum CType {\n                STRING = 0,\n                CORD = 1,\n                STRING_PIECE = 2\n            }\n\n            /** JSType enum. */\n            enum JSType {\n                JS_NORMAL = 0,\n                JS_STRING = 1,\n                JS_NUMBER = 2\n            }\n        }\n\n        /** Properties of an OneofOptions. */\n        interface IOneofOptions {\n\n            /** OneofOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents an OneofOptions. */\n        class OneofOptions {\n\n            /**\n             * Constructs a new OneofOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IOneofOptions);\n\n            /** OneofOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new OneofOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns OneofOptions instance\n             */\n            public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions;\n\n            /**\n             * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @param message OneofOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @param message OneofOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions;\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions;\n\n            /**\n             * Verifies an OneofOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns OneofOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions;\n\n            /**\n             * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.\n             * @param message OneofOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this OneofOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of an EnumOptions. */\n        interface IEnumOptions {\n\n            /** EnumOptions allowAlias */\n            allowAlias?: boolean;\n\n            /** EnumOptions deprecated */\n            deprecated?: boolean;\n\n            /** EnumOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents an EnumOptions. */\n        class EnumOptions {\n\n            /**\n             * Constructs a new EnumOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IEnumOptions);\n\n            /** EnumOptions allowAlias. */\n            public allowAlias: boolean;\n\n            /** EnumOptions deprecated. */\n            public deprecated: boolean;\n\n            /** EnumOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new EnumOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns EnumOptions instance\n             */\n            public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions;\n\n            /**\n             * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @param message EnumOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @param message EnumOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions;\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions;\n\n            /**\n             * Verifies an EnumOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns EnumOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions;\n\n            /**\n             * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.\n             * @param message EnumOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this EnumOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of an EnumValueOptions. */\n        interface IEnumValueOptions {\n\n            /** EnumValueOptions deprecated */\n            deprecated?: boolean;\n\n            /** EnumValueOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents an EnumValueOptions. */\n        class EnumValueOptions {\n\n            /**\n             * Constructs a new EnumValueOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IEnumValueOptions);\n\n            /** EnumValueOptions deprecated. */\n            public deprecated: boolean;\n\n            /** EnumValueOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new EnumValueOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns EnumValueOptions instance\n             */\n            public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions;\n\n            /**\n             * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @param message EnumValueOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @param message EnumValueOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions;\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions;\n\n            /**\n             * Verifies an EnumValueOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns EnumValueOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions;\n\n            /**\n             * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.\n             * @param message EnumValueOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this EnumValueOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a ServiceOptions. */\n        interface IServiceOptions {\n\n            /** ServiceOptions deprecated */\n            deprecated?: boolean;\n\n            /** ServiceOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n\n            /** ServiceOptions .interop.serviceId */\n            '.interop.serviceId'?: string;\n        }\n\n        /** Represents a ServiceOptions. */\n        class ServiceOptions {\n\n            /**\n             * Constructs a new ServiceOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IServiceOptions);\n\n            /** ServiceOptions deprecated. */\n            public deprecated: boolean;\n\n            /** ServiceOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new ServiceOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns ServiceOptions instance\n             */\n            public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions;\n\n            /**\n             * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @param message ServiceOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @param message ServiceOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions;\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions;\n\n            /**\n             * Verifies a ServiceOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns ServiceOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions;\n\n            /**\n             * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.\n             * @param message ServiceOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this ServiceOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a MethodOptions. */\n        interface IMethodOptions {\n\n            /** MethodOptions deprecated */\n            deprecated?: boolean;\n\n            /** MethodOptions uninterpretedOption */\n            uninterpretedOption?: google.protobuf.IUninterpretedOption[];\n        }\n\n        /** Represents a MethodOptions. */\n        class MethodOptions {\n\n            /**\n             * Constructs a new MethodOptions.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IMethodOptions);\n\n            /** MethodOptions deprecated. */\n            public deprecated: boolean;\n\n            /** MethodOptions uninterpretedOption. */\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n\n            /**\n             * Creates a new MethodOptions instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns MethodOptions instance\n             */\n            public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions;\n\n            /**\n             * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @param message MethodOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @param message MethodOptions message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions;\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions;\n\n            /**\n             * Verifies a MethodOptions message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns MethodOptions\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions;\n\n            /**\n             * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.\n             * @param message MethodOptions\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this MethodOptions to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of an UninterpretedOption. */\n        interface IUninterpretedOption {\n\n            /** UninterpretedOption name */\n            name?: google.protobuf.UninterpretedOption.INamePart[];\n\n            /** UninterpretedOption identifierValue */\n            identifierValue?: string;\n\n            /** UninterpretedOption positiveIntValue */\n            positiveIntValue?: Long;\n\n            /** UninterpretedOption negativeIntValue */\n            negativeIntValue?: Long;\n\n            /** UninterpretedOption doubleValue */\n            doubleValue?: number;\n\n            /** UninterpretedOption stringValue */\n            stringValue?: Uint8Array;\n\n            /** UninterpretedOption aggregateValue */\n            aggregateValue?: string;\n        }\n\n        /** Represents an UninterpretedOption. */\n        class UninterpretedOption {\n\n            /**\n             * Constructs a new UninterpretedOption.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IUninterpretedOption);\n\n            /** UninterpretedOption name. */\n            public name: google.protobuf.UninterpretedOption.INamePart[];\n\n            /** UninterpretedOption identifierValue. */\n            public identifierValue: string;\n\n            /** UninterpretedOption positiveIntValue. */\n            public positiveIntValue: Long;\n\n            /** UninterpretedOption negativeIntValue. */\n            public negativeIntValue: Long;\n\n            /** UninterpretedOption doubleValue. */\n            public doubleValue: number;\n\n            /** UninterpretedOption stringValue. */\n            public stringValue: Uint8Array;\n\n            /** UninterpretedOption aggregateValue. */\n            public aggregateValue: string;\n\n            /**\n             * Creates a new UninterpretedOption instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns UninterpretedOption instance\n             */\n            public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption;\n\n            /**\n             * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @param message UninterpretedOption message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @param message UninterpretedOption message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption;\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption;\n\n            /**\n             * Verifies an UninterpretedOption message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns UninterpretedOption\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption;\n\n            /**\n             * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.\n             * @param message UninterpretedOption\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this UninterpretedOption to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace UninterpretedOption {\n\n            /** Properties of a NamePart. */\n            interface INamePart {\n\n                /** NamePart namePart */\n                namePart: string;\n\n                /** NamePart isExtension */\n                isExtension: boolean;\n            }\n\n            /** Represents a NamePart. */\n            class NamePart {\n\n                /**\n                 * Constructs a new NamePart.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: google.protobuf.UninterpretedOption.INamePart);\n\n                /** NamePart namePart. */\n                public namePart: string;\n\n                /** NamePart isExtension. */\n                public isExtension: boolean;\n\n                /**\n                 * Creates a new NamePart instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns NamePart instance\n                 */\n                public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart;\n\n                /**\n                 * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @param message NamePart message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @param message NamePart message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart;\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer, length delimited.\n                 * @param reader Reader or buffer to decode from\n                 * @returns NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart;\n\n                /**\n                 * Verifies a NamePart message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates a NamePart message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns NamePart\n                 */\n                public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart;\n\n                /**\n                 * Creates a plain object from a NamePart message. Also converts values to other types if specified.\n                 * @param message NamePart\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this NamePart to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n        }\n\n        /** Properties of a SourceCodeInfo. */\n        interface ISourceCodeInfo {\n\n            /** SourceCodeInfo location */\n            location?: google.protobuf.SourceCodeInfo.ILocation[];\n        }\n\n        /** Represents a SourceCodeInfo. */\n        class SourceCodeInfo {\n\n            /**\n             * Constructs a new SourceCodeInfo.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.ISourceCodeInfo);\n\n            /** SourceCodeInfo location. */\n            public location: google.protobuf.SourceCodeInfo.ILocation[];\n\n            /**\n             * Creates a new SourceCodeInfo instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns SourceCodeInfo instance\n             */\n            public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo;\n\n            /**\n             * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @param message SourceCodeInfo message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @param message SourceCodeInfo message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo;\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo;\n\n            /**\n             * Verifies a SourceCodeInfo message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns SourceCodeInfo\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo;\n\n            /**\n             * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.\n             * @param message SourceCodeInfo\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this SourceCodeInfo to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace SourceCodeInfo {\n\n            /** Properties of a Location. */\n            interface ILocation {\n\n                /** Location path */\n                path?: number[];\n\n                /** Location span */\n                span?: number[];\n\n                /** Location leadingComments */\n                leadingComments?: string;\n\n                /** Location trailingComments */\n                trailingComments?: string;\n\n                /** Location leadingDetachedComments */\n                leadingDetachedComments?: string[];\n            }\n\n            /** Represents a Location. */\n            class Location {\n\n                /**\n                 * Constructs a new Location.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: google.protobuf.SourceCodeInfo.ILocation);\n\n                /** Location path. */\n                public path: number[];\n\n                /** Location span. */\n                public span: number[];\n\n                /** Location leadingComments. */\n                public leadingComments: string;\n\n                /** Location trailingComments. */\n                public trailingComments: string;\n\n                /** Location leadingDetachedComments. */\n                public leadingDetachedComments: string[];\n\n                /**\n                 * Creates a new Location instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns Location instance\n                 */\n                public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location;\n\n                /**\n                 * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @param message Location message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @param message Location message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location;\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer, length delimited.\n                 * @param reader Reader or buffer to decode from\n                 * @returns Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location;\n\n                /**\n                 * Verifies a Location message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates a Location message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns Location\n                 */\n                public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location;\n\n                /**\n                 * Creates a plain object from a Location message. Also converts values to other types if specified.\n                 * @param message Location\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this Location to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n        }\n\n        /** Properties of a GeneratedCodeInfo. */\n        interface IGeneratedCodeInfo {\n\n            /** GeneratedCodeInfo annotation */\n            annotation?: google.protobuf.GeneratedCodeInfo.IAnnotation[];\n        }\n\n        /** Represents a GeneratedCodeInfo. */\n        class GeneratedCodeInfo {\n\n            /**\n             * Constructs a new GeneratedCodeInfo.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: google.protobuf.IGeneratedCodeInfo);\n\n            /** GeneratedCodeInfo annotation. */\n            public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[];\n\n            /**\n             * Creates a new GeneratedCodeInfo instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns GeneratedCodeInfo instance\n             */\n            public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo;\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @param message GeneratedCodeInfo message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @param message GeneratedCodeInfo message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo;\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo;\n\n            /**\n             * Verifies a GeneratedCodeInfo message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns GeneratedCodeInfo\n             */\n            public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo;\n\n            /**\n             * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.\n             * @param message GeneratedCodeInfo\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this GeneratedCodeInfo to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        namespace GeneratedCodeInfo {\n\n            /** Properties of an Annotation. */\n            interface IAnnotation {\n\n                /** Annotation path */\n                path?: number[];\n\n                /** Annotation sourceFile */\n                sourceFile?: string;\n\n                /** Annotation begin */\n                begin?: number;\n\n                /** Annotation end */\n                end?: number;\n            }\n\n            /** Represents an Annotation. */\n            class Annotation {\n\n                /**\n                 * Constructs a new Annotation.\n                 * @param [properties] Properties to set\n                 */\n                constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation);\n\n                /** Annotation path. */\n                public path: number[];\n\n                /** Annotation sourceFile. */\n                public sourceFile: string;\n\n                /** Annotation begin. */\n                public begin: number;\n\n                /** Annotation end. */\n                public end: number;\n\n                /**\n                 * Creates a new Annotation instance using the specified properties.\n                 * @param [properties] Properties to set\n                 * @returns Annotation instance\n                 */\n                public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation;\n\n                /**\n                 * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @param message Annotation message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @param message Annotation message or plain object to encode\n                 * @param [writer] Writer to encode to\n                 * @returns Writer\n                 */\n                public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer;\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer.\n                 * @param reader Reader or buffer to decode from\n                 * @param [length] Message length if known beforehand\n                 * @returns Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation;\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer, length delimited.\n                 * @param reader Reader or buffer to decode from\n                 * @returns Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation;\n\n                /**\n                 * Verifies an Annotation message.\n                 * @param message Plain object to verify\n                 * @returns `null` if valid, otherwise the reason why it is not\n                 */\n                public static verify(message: { [k: string]: any }): (string|null);\n\n                /**\n                 * Creates an Annotation message from a plain object. Also converts values to their respective internal types.\n                 * @param object Plain object\n                 * @returns Annotation\n                 */\n                public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation;\n\n                /**\n                 * Creates a plain object from an Annotation message. Also converts values to other types if specified.\n                 * @param message Annotation\n                 * @param [options] Conversion options\n                 * @returns Plain object\n                 */\n                public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n                /**\n                 * Converts this Annotation to JSON.\n                 * @returns JSON object\n                 */\n                public toJSON(): { [k: string]: any };\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/gen/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.launcher || ($protobuf.roots.launcher = {});\n\n$root.interop = (function() {\n\n    /**\n     * Namespace interop.\n     * @exports interop\n     * @namespace\n     */\n    var interop = {};\n\n    interop.AppLauncherService = (function() {\n\n        /**\n         * Constructs a new AppLauncherService service.\n         * @memberof interop\n         * @classdesc Represents an AppLauncherService\n         * @extends $protobuf.rpc.Service\n         * @constructor\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         */\n        function AppLauncherService(rpcImpl, requestDelimited, responseDelimited) {\n            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n        }\n\n        (AppLauncherService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AppLauncherService;\n\n        /**\n         * Creates new AppLauncherService service using the specified rpc implementation.\n         * @function create\n         * @memberof interop.AppLauncherService\n         * @static\n         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n         * @returns {AppLauncherService} RPC service. Useful where requests and/or responses are streamed.\n         */\n        AppLauncherService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n            return new this(rpcImpl, requestDelimited, responseDelimited);\n        };\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#launch}.\n         * @memberof interop.AppLauncherService\n         * @typedef LaunchCallback\n         * @type {function}\n         * @param {Error|null} error Error, if any\n         * @param {interop.AppLaunchResponse} [response] AppLaunchResponse\n         */\n\n        /**\n         * Calls Launch.\n         * @function .launch\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IAppLaunchRequest} request AppLaunchRequest message or plain object\n         * @param {interop.AppLauncherService.LaunchCallback} callback Node-style callback called with the error, if any, and AppLaunchResponse\n         * @returns {undefined}\n         * @variation 1\n         */\n        AppLauncherService.prototype.launch = function launch(request, callback) {\n            return this.rpcCall(launch, $root.interop.AppLaunchRequest, $root.interop.AppLaunchResponse, request, callback);\n        };\n\n        /**\n         * Calls Launch.\n         * @function launch\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IAppLaunchRequest} request AppLaunchRequest message or plain object\n         * @returns {Promise<interop.AppLaunchResponse>} Promise\n         * @variation 2\n         */\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#getAvailableApps}.\n         * @memberof interop.AppLauncherService\n         * @typedef GetAvailableAppsCallback\n         * @type {function}\n         * @param {Error|null} error Error, if any\n         * @param {interop.GetAvailableAppsResponse} [response] GetAvailableAppsResponse\n         */\n\n        /**\n         * Calls GetAvailableApps.\n         * @function .getAvailableApps\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IGetAvailableAppsRequest} request GetAvailableAppsRequest message or plain object\n         * @param {interop.AppLauncherService.GetAvailableAppsCallback} callback Node-style callback called with the error, if any, and GetAvailableAppsResponse\n         * @returns {undefined}\n         * @variation 1\n         */\n        AppLauncherService.prototype.getAvailableApps = function getAvailableApps(request, callback) {\n            return this.rpcCall(getAvailableApps, $root.interop.GetAvailableAppsRequest, $root.interop.GetAvailableAppsResponse, request, callback);\n        };\n\n        /**\n         * Calls GetAvailableApps.\n         * @function getAvailableApps\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IGetAvailableAppsRequest} request GetAvailableAppsRequest message or plain object\n         * @returns {Promise<interop.GetAvailableAppsResponse>} Promise\n         * @variation 2\n         */\n\n        /**\n         * Callback as used by {@link interop.AppLauncherService#getAppInstanceStateStream}.\n         * @memberof interop.AppLauncherService\n         * @typedef GetAppInstanceStateStreamCallback\n         * @type {function}\n         * @param {Error|null} error Error, if any\n         * @param {interop.GetAppInstanceStateResponse} [response] GetAppInstanceStateResponse\n         */\n\n        /**\n         * Calls GetAppInstanceStateStream.\n         * @function .getAppInstanceStateStream\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IGetAppInstanceStateRequest} request GetAppInstanceStateRequest message or plain object\n         * @param {interop.AppLauncherService.GetAppInstanceStateStreamCallback} callback Node-style callback called with the error, if any, and GetAppInstanceStateResponse\n         * @returns {undefined}\n         * @variation 1\n         */\n        AppLauncherService.prototype.getAppInstanceStateStream = function getAppInstanceStateStream(request, callback) {\n            return this.rpcCall(getAppInstanceStateStream, $root.interop.GetAppInstanceStateRequest, $root.interop.GetAppInstanceStateResponse, request, callback);\n        };\n\n        /**\n         * Calls GetAppInstanceStateStream.\n         * @function getAppInstanceStateStream\n         * @memberof interop.AppLauncherService\n         * @instance\n         * @param {interop.IGetAppInstanceStateRequest} request GetAppInstanceStateRequest message or plain object\n         * @returns {Promise<interop.GetAppInstanceStateResponse>} Promise\n         * @variation 2\n         */\n\n        return AppLauncherService;\n    })();\n\n    interop.AppLaunchRequest = (function() {\n\n        /**\n         * Properties of an AppLaunchRequest.\n         * @memberof interop\n         * @interface IAppLaunchRequest\n         * @property {string} [appId] AppLaunchRequest appId\n         * @property {string} [launchParamsJson] AppLaunchRequest launchParamsJson\n         */\n\n        /**\n         * Constructs a new AppLaunchRequest.\n         * @memberof interop\n         * @classdesc Represents an AppLaunchRequest.\n         * @constructor\n         * @param {interop.IAppLaunchRequest=} [properties] Properties to set\n         */\n        function AppLaunchRequest(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * AppLaunchRequest appId.\n         * @member {string}appId\n         * @memberof interop.AppLaunchRequest\n         * @instance\n         */\n        AppLaunchRequest.prototype.appId = \"\";\n\n        /**\n         * AppLaunchRequest launchParamsJson.\n         * @member {string}launchParamsJson\n         * @memberof interop.AppLaunchRequest\n         * @instance\n         */\n        AppLaunchRequest.prototype.launchParamsJson = \"\";\n\n        /**\n         * Creates a new AppLaunchRequest instance using the specified properties.\n         * @function create\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {interop.IAppLaunchRequest=} [properties] Properties to set\n         * @returns {interop.AppLaunchRequest} AppLaunchRequest instance\n         */\n        AppLaunchRequest.create = function create(properties) {\n            return new AppLaunchRequest(properties);\n        };\n\n        /**\n         * Encodes the specified AppLaunchRequest message. Does not implicitly {@link interop.AppLaunchRequest.verify|verify} messages.\n         * @function encode\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {interop.IAppLaunchRequest} message AppLaunchRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        AppLaunchRequest.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.appId);\n            if (message.launchParamsJson != null && message.hasOwnProperty(\"launchParamsJson\"))\n                writer.uint32(/* id 2, wireType 2 =*/18).string(message.launchParamsJson);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified AppLaunchRequest message, length delimited. Does not implicitly {@link interop.AppLaunchRequest.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {interop.IAppLaunchRequest} message AppLaunchRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        AppLaunchRequest.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes an AppLaunchRequest message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.AppLaunchRequest} AppLaunchRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        AppLaunchRequest.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.AppLaunchRequest();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.appId = reader.string();\n                    break;\n                case 2:\n                    message.launchParamsJson = reader.string();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes an AppLaunchRequest message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.AppLaunchRequest} AppLaunchRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        AppLaunchRequest.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies an AppLaunchRequest message.\n         * @function verify\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        AppLaunchRequest.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                if (!$util.isString(message.appId))\n                    return \"appId: string expected\";\n            if (message.launchParamsJson != null && message.hasOwnProperty(\"launchParamsJson\"))\n                if (!$util.isString(message.launchParamsJson))\n                    return \"launchParamsJson: string expected\";\n            return null;\n        };\n\n        /**\n         * Creates an AppLaunchRequest message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.AppLaunchRequest} AppLaunchRequest\n         */\n        AppLaunchRequest.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.AppLaunchRequest)\n                return object;\n            var message = new $root.interop.AppLaunchRequest();\n            if (object.appId != null)\n                message.appId = String(object.appId);\n            if (object.launchParamsJson != null)\n                message.launchParamsJson = String(object.launchParamsJson);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from an AppLaunchRequest message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.AppLaunchRequest\n         * @static\n         * @param {interop.AppLaunchRequest} message AppLaunchRequest\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        AppLaunchRequest.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.appId = \"\";\n                object.launchParamsJson = \"\";\n            }\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                object.appId = message.appId;\n            if (message.launchParamsJson != null && message.hasOwnProperty(\"launchParamsJson\"))\n                object.launchParamsJson = message.launchParamsJson;\n            return object;\n        };\n\n        /**\n         * Converts this AppLaunchRequest to JSON.\n         * @function toJSON\n         * @memberof interop.AppLaunchRequest\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        AppLaunchRequest.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return AppLaunchRequest;\n    })();\n\n    interop.AppLaunchResponse = (function() {\n\n        /**\n         * Properties of an AppLaunchResponse.\n         * @memberof interop\n         * @interface IAppLaunchResponse\n         * @property {interop.IUniqueId} [appInstanceId] AppLaunchResponse appInstanceId\n         */\n\n        /**\n         * Constructs a new AppLaunchResponse.\n         * @memberof interop\n         * @classdesc Represents an AppLaunchResponse.\n         * @constructor\n         * @param {interop.IAppLaunchResponse=} [properties] Properties to set\n         */\n        function AppLaunchResponse(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * AppLaunchResponse appInstanceId.\n         * @member {(interop.IUniqueId|null|undefined)}appInstanceId\n         * @memberof interop.AppLaunchResponse\n         * @instance\n         */\n        AppLaunchResponse.prototype.appInstanceId = null;\n\n        /**\n         * Creates a new AppLaunchResponse instance using the specified properties.\n         * @function create\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {interop.IAppLaunchResponse=} [properties] Properties to set\n         * @returns {interop.AppLaunchResponse} AppLaunchResponse instance\n         */\n        AppLaunchResponse.create = function create(properties) {\n            return new AppLaunchResponse(properties);\n        };\n\n        /**\n         * Encodes the specified AppLaunchResponse message. Does not implicitly {@link interop.AppLaunchResponse.verify|verify} messages.\n         * @function encode\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {interop.IAppLaunchResponse} message AppLaunchResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        AppLaunchResponse.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\"))\n                $root.interop.UniqueId.encode(message.appInstanceId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n            return writer;\n        };\n\n        /**\n         * Encodes the specified AppLaunchResponse message, length delimited. Does not implicitly {@link interop.AppLaunchResponse.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {interop.IAppLaunchResponse} message AppLaunchResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        AppLaunchResponse.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes an AppLaunchResponse message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.AppLaunchResponse} AppLaunchResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        AppLaunchResponse.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.AppLaunchResponse();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.appInstanceId = $root.interop.UniqueId.decode(reader, reader.uint32());\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes an AppLaunchResponse message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.AppLaunchResponse} AppLaunchResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        AppLaunchResponse.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies an AppLaunchResponse message.\n         * @function verify\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        AppLaunchResponse.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\")) {\n                var error = $root.interop.UniqueId.verify(message.appInstanceId);\n                if (error)\n                    return \"appInstanceId.\" + error;\n            }\n            return null;\n        };\n\n        /**\n         * Creates an AppLaunchResponse message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.AppLaunchResponse} AppLaunchResponse\n         */\n        AppLaunchResponse.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.AppLaunchResponse)\n                return object;\n            var message = new $root.interop.AppLaunchResponse();\n            if (object.appInstanceId != null) {\n                if (typeof object.appInstanceId !== \"object\")\n                    throw TypeError(\".interop.AppLaunchResponse.appInstanceId: object expected\");\n                message.appInstanceId = $root.interop.UniqueId.fromObject(object.appInstanceId);\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from an AppLaunchResponse message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.AppLaunchResponse\n         * @static\n         * @param {interop.AppLaunchResponse} message AppLaunchResponse\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        AppLaunchResponse.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults)\n                object.appInstanceId = null;\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\"))\n                object.appInstanceId = $root.interop.UniqueId.toObject(message.appInstanceId, options);\n            return object;\n        };\n\n        /**\n         * Converts this AppLaunchResponse to JSON.\n         * @function toJSON\n         * @memberof interop.AppLaunchResponse\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        AppLaunchResponse.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return AppLaunchResponse;\n    })();\n\n    interop.GetAvailableAppsRequest = (function() {\n\n        /**\n         * Properties of a GetAvailableAppsRequest.\n         * @memberof interop\n         * @interface IGetAvailableAppsRequest\n         * @property {Array.<string>} [appIds] GetAvailableAppsRequest appIds\n         */\n\n        /**\n         * Constructs a new GetAvailableAppsRequest.\n         * @memberof interop\n         * @classdesc Represents a GetAvailableAppsRequest.\n         * @constructor\n         * @param {interop.IGetAvailableAppsRequest=} [properties] Properties to set\n         */\n        function GetAvailableAppsRequest(properties) {\n            this.appIds = [];\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * GetAvailableAppsRequest appIds.\n         * @member {Array.<string>}appIds\n         * @memberof interop.GetAvailableAppsRequest\n         * @instance\n         */\n        GetAvailableAppsRequest.prototype.appIds = $util.emptyArray;\n\n        /**\n         * Creates a new GetAvailableAppsRequest instance using the specified properties.\n         * @function create\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {interop.IGetAvailableAppsRequest=} [properties] Properties to set\n         * @returns {interop.GetAvailableAppsRequest} GetAvailableAppsRequest instance\n         */\n        GetAvailableAppsRequest.create = function create(properties) {\n            return new GetAvailableAppsRequest(properties);\n        };\n\n        /**\n         * Encodes the specified GetAvailableAppsRequest message. Does not implicitly {@link interop.GetAvailableAppsRequest.verify|verify} messages.\n         * @function encode\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {interop.IGetAvailableAppsRequest} message GetAvailableAppsRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAvailableAppsRequest.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.appIds != null && message.appIds.length)\n                for (var i = 0; i < message.appIds.length; ++i)\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.appIds[i]);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified GetAvailableAppsRequest message, length delimited. Does not implicitly {@link interop.GetAvailableAppsRequest.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {interop.IGetAvailableAppsRequest} message GetAvailableAppsRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAvailableAppsRequest.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a GetAvailableAppsRequest message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.GetAvailableAppsRequest} GetAvailableAppsRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAvailableAppsRequest.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.GetAvailableAppsRequest();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    if (!(message.appIds && message.appIds.length))\n                        message.appIds = [];\n                    message.appIds.push(reader.string());\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a GetAvailableAppsRequest message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.GetAvailableAppsRequest} GetAvailableAppsRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAvailableAppsRequest.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a GetAvailableAppsRequest message.\n         * @function verify\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        GetAvailableAppsRequest.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.appIds != null && message.hasOwnProperty(\"appIds\")) {\n                if (!Array.isArray(message.appIds))\n                    return \"appIds: array expected\";\n                for (var i = 0; i < message.appIds.length; ++i)\n                    if (!$util.isString(message.appIds[i]))\n                        return \"appIds: string[] expected\";\n            }\n            return null;\n        };\n\n        /**\n         * Creates a GetAvailableAppsRequest message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.GetAvailableAppsRequest} GetAvailableAppsRequest\n         */\n        GetAvailableAppsRequest.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.GetAvailableAppsRequest)\n                return object;\n            var message = new $root.interop.GetAvailableAppsRequest();\n            if (object.appIds) {\n                if (!Array.isArray(object.appIds))\n                    throw TypeError(\".interop.GetAvailableAppsRequest.appIds: array expected\");\n                message.appIds = [];\n                for (var i = 0; i < object.appIds.length; ++i)\n                    message.appIds[i] = String(object.appIds[i]);\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a GetAvailableAppsRequest message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.GetAvailableAppsRequest\n         * @static\n         * @param {interop.GetAvailableAppsRequest} message GetAvailableAppsRequest\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        GetAvailableAppsRequest.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.arrays || options.defaults)\n                object.appIds = [];\n            if (message.appIds && message.appIds.length) {\n                object.appIds = [];\n                for (var j = 0; j < message.appIds.length; ++j)\n                    object.appIds[j] = message.appIds[j];\n            }\n            return object;\n        };\n\n        /**\n         * Converts this GetAvailableAppsRequest to JSON.\n         * @function toJSON\n         * @memberof interop.GetAvailableAppsRequest\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        GetAvailableAppsRequest.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return GetAvailableAppsRequest;\n    })();\n\n    interop.GetAvailableAppsResponse = (function() {\n\n        /**\n         * Properties of a GetAvailableAppsResponse.\n         * @memberof interop\n         * @interface IGetAvailableAppsResponse\n         * @property {Array.<string>} [availableAppIds] GetAvailableAppsResponse availableAppIds\n         */\n\n        /**\n         * Constructs a new GetAvailableAppsResponse.\n         * @memberof interop\n         * @classdesc Represents a GetAvailableAppsResponse.\n         * @constructor\n         * @param {interop.IGetAvailableAppsResponse=} [properties] Properties to set\n         */\n        function GetAvailableAppsResponse(properties) {\n            this.availableAppIds = [];\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * GetAvailableAppsResponse availableAppIds.\n         * @member {Array.<string>}availableAppIds\n         * @memberof interop.GetAvailableAppsResponse\n         * @instance\n         */\n        GetAvailableAppsResponse.prototype.availableAppIds = $util.emptyArray;\n\n        /**\n         * Creates a new GetAvailableAppsResponse instance using the specified properties.\n         * @function create\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {interop.IGetAvailableAppsResponse=} [properties] Properties to set\n         * @returns {interop.GetAvailableAppsResponse} GetAvailableAppsResponse instance\n         */\n        GetAvailableAppsResponse.create = function create(properties) {\n            return new GetAvailableAppsResponse(properties);\n        };\n\n        /**\n         * Encodes the specified GetAvailableAppsResponse message. Does not implicitly {@link interop.GetAvailableAppsResponse.verify|verify} messages.\n         * @function encode\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {interop.IGetAvailableAppsResponse} message GetAvailableAppsResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAvailableAppsResponse.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.availableAppIds != null && message.availableAppIds.length)\n                for (var i = 0; i < message.availableAppIds.length; ++i)\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.availableAppIds[i]);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified GetAvailableAppsResponse message, length delimited. Does not implicitly {@link interop.GetAvailableAppsResponse.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {interop.IGetAvailableAppsResponse} message GetAvailableAppsResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAvailableAppsResponse.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a GetAvailableAppsResponse message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.GetAvailableAppsResponse} GetAvailableAppsResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAvailableAppsResponse.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.GetAvailableAppsResponse();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    if (!(message.availableAppIds && message.availableAppIds.length))\n                        message.availableAppIds = [];\n                    message.availableAppIds.push(reader.string());\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a GetAvailableAppsResponse message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.GetAvailableAppsResponse} GetAvailableAppsResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAvailableAppsResponse.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a GetAvailableAppsResponse message.\n         * @function verify\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        GetAvailableAppsResponse.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.availableAppIds != null && message.hasOwnProperty(\"availableAppIds\")) {\n                if (!Array.isArray(message.availableAppIds))\n                    return \"availableAppIds: array expected\";\n                for (var i = 0; i < message.availableAppIds.length; ++i)\n                    if (!$util.isString(message.availableAppIds[i]))\n                        return \"availableAppIds: string[] expected\";\n            }\n            return null;\n        };\n\n        /**\n         * Creates a GetAvailableAppsResponse message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.GetAvailableAppsResponse} GetAvailableAppsResponse\n         */\n        GetAvailableAppsResponse.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.GetAvailableAppsResponse)\n                return object;\n            var message = new $root.interop.GetAvailableAppsResponse();\n            if (object.availableAppIds) {\n                if (!Array.isArray(object.availableAppIds))\n                    throw TypeError(\".interop.GetAvailableAppsResponse.availableAppIds: array expected\");\n                message.availableAppIds = [];\n                for (var i = 0; i < object.availableAppIds.length; ++i)\n                    message.availableAppIds[i] = String(object.availableAppIds[i]);\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a GetAvailableAppsResponse message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.GetAvailableAppsResponse\n         * @static\n         * @param {interop.GetAvailableAppsResponse} message GetAvailableAppsResponse\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        GetAvailableAppsResponse.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.arrays || options.defaults)\n                object.availableAppIds = [];\n            if (message.availableAppIds && message.availableAppIds.length) {\n                object.availableAppIds = [];\n                for (var j = 0; j < message.availableAppIds.length; ++j)\n                    object.availableAppIds[j] = message.availableAppIds[j];\n            }\n            return object;\n        };\n\n        /**\n         * Converts this GetAvailableAppsResponse to JSON.\n         * @function toJSON\n         * @memberof interop.GetAvailableAppsResponse\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        GetAvailableAppsResponse.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return GetAvailableAppsResponse;\n    })();\n\n    interop.GetAppInstanceStateRequest = (function() {\n\n        /**\n         * Properties of a GetAppInstanceStateRequest.\n         * @memberof interop\n         * @interface IGetAppInstanceStateRequest\n         * @property {string} [appId] GetAppInstanceStateRequest appId\n         * @property {interop.IUniqueId} [appInstanceId] GetAppInstanceStateRequest appInstanceId\n         */\n\n        /**\n         * Constructs a new GetAppInstanceStateRequest.\n         * @memberof interop\n         * @classdesc Represents a GetAppInstanceStateRequest.\n         * @constructor\n         * @param {interop.IGetAppInstanceStateRequest=} [properties] Properties to set\n         */\n        function GetAppInstanceStateRequest(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * GetAppInstanceStateRequest appId.\n         * @member {string}appId\n         * @memberof interop.GetAppInstanceStateRequest\n         * @instance\n         */\n        GetAppInstanceStateRequest.prototype.appId = \"\";\n\n        /**\n         * GetAppInstanceStateRequest appInstanceId.\n         * @member {(interop.IUniqueId|null|undefined)}appInstanceId\n         * @memberof interop.GetAppInstanceStateRequest\n         * @instance\n         */\n        GetAppInstanceStateRequest.prototype.appInstanceId = null;\n\n        /**\n         * Creates a new GetAppInstanceStateRequest instance using the specified properties.\n         * @function create\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {interop.IGetAppInstanceStateRequest=} [properties] Properties to set\n         * @returns {interop.GetAppInstanceStateRequest} GetAppInstanceStateRequest instance\n         */\n        GetAppInstanceStateRequest.create = function create(properties) {\n            return new GetAppInstanceStateRequest(properties);\n        };\n\n        /**\n         * Encodes the specified GetAppInstanceStateRequest message. Does not implicitly {@link interop.GetAppInstanceStateRequest.verify|verify} messages.\n         * @function encode\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {interop.IGetAppInstanceStateRequest} message GetAppInstanceStateRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAppInstanceStateRequest.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.appId);\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\"))\n                $root.interop.UniqueId.encode(message.appInstanceId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n            return writer;\n        };\n\n        /**\n         * Encodes the specified GetAppInstanceStateRequest message, length delimited. Does not implicitly {@link interop.GetAppInstanceStateRequest.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {interop.IGetAppInstanceStateRequest} message GetAppInstanceStateRequest message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAppInstanceStateRequest.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a GetAppInstanceStateRequest message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.GetAppInstanceStateRequest} GetAppInstanceStateRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAppInstanceStateRequest.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.GetAppInstanceStateRequest();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.appId = reader.string();\n                    break;\n                case 2:\n                    message.appInstanceId = $root.interop.UniqueId.decode(reader, reader.uint32());\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a GetAppInstanceStateRequest message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.GetAppInstanceStateRequest} GetAppInstanceStateRequest\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAppInstanceStateRequest.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a GetAppInstanceStateRequest message.\n         * @function verify\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        GetAppInstanceStateRequest.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                if (!$util.isString(message.appId))\n                    return \"appId: string expected\";\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\")) {\n                var error = $root.interop.UniqueId.verify(message.appInstanceId);\n                if (error)\n                    return \"appInstanceId.\" + error;\n            }\n            return null;\n        };\n\n        /**\n         * Creates a GetAppInstanceStateRequest message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.GetAppInstanceStateRequest} GetAppInstanceStateRequest\n         */\n        GetAppInstanceStateRequest.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.GetAppInstanceStateRequest)\n                return object;\n            var message = new $root.interop.GetAppInstanceStateRequest();\n            if (object.appId != null)\n                message.appId = String(object.appId);\n            if (object.appInstanceId != null) {\n                if (typeof object.appInstanceId !== \"object\")\n                    throw TypeError(\".interop.GetAppInstanceStateRequest.appInstanceId: object expected\");\n                message.appInstanceId = $root.interop.UniqueId.fromObject(object.appInstanceId);\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a GetAppInstanceStateRequest message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.GetAppInstanceStateRequest\n         * @static\n         * @param {interop.GetAppInstanceStateRequest} message GetAppInstanceStateRequest\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        GetAppInstanceStateRequest.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.appId = \"\";\n                object.appInstanceId = null;\n            }\n            if (message.appId != null && message.hasOwnProperty(\"appId\"))\n                object.appId = message.appId;\n            if (message.appInstanceId != null && message.hasOwnProperty(\"appInstanceId\"))\n                object.appInstanceId = $root.interop.UniqueId.toObject(message.appInstanceId, options);\n            return object;\n        };\n\n        /**\n         * Converts this GetAppInstanceStateRequest to JSON.\n         * @function toJSON\n         * @memberof interop.GetAppInstanceStateRequest\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        GetAppInstanceStateRequest.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return GetAppInstanceStateRequest;\n    })();\n\n    /**\n     * AppInstanceState enum.\n     * @enum {string}\n     * @property {number} Unknown=0 Unknown value\n     * @property {number} Starting=1 Starting value\n     * @property {number} Running=2 Running value\n     * @property {number} Stopped=3 Stopped value\n     */\n    interop.AppInstanceState = (function() {\n        var valuesById = {}, values = Object.create(valuesById);\n        values[valuesById[0] = \"Unknown\"] = 0;\n        values[valuesById[1] = \"Starting\"] = 1;\n        values[valuesById[2] = \"Running\"] = 2;\n        values[valuesById[3] = \"Stopped\"] = 3;\n        return values;\n    })();\n\n    interop.GetAppInstanceStateResponse = (function() {\n\n        /**\n         * Properties of a GetAppInstanceStateResponse.\n         * @memberof interop\n         * @interface IGetAppInstanceStateResponse\n         * @property {interop.AppInstanceState} [state] GetAppInstanceStateResponse state\n         */\n\n        /**\n         * Constructs a new GetAppInstanceStateResponse.\n         * @memberof interop\n         * @classdesc Represents a GetAppInstanceStateResponse.\n         * @constructor\n         * @param {interop.IGetAppInstanceStateResponse=} [properties] Properties to set\n         */\n        function GetAppInstanceStateResponse(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * GetAppInstanceStateResponse state.\n         * @member {interop.AppInstanceState}state\n         * @memberof interop.GetAppInstanceStateResponse\n         * @instance\n         */\n        GetAppInstanceStateResponse.prototype.state = 0;\n\n        /**\n         * Creates a new GetAppInstanceStateResponse instance using the specified properties.\n         * @function create\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {interop.IGetAppInstanceStateResponse=} [properties] Properties to set\n         * @returns {interop.GetAppInstanceStateResponse} GetAppInstanceStateResponse instance\n         */\n        GetAppInstanceStateResponse.create = function create(properties) {\n            return new GetAppInstanceStateResponse(properties);\n        };\n\n        /**\n         * Encodes the specified GetAppInstanceStateResponse message. Does not implicitly {@link interop.GetAppInstanceStateResponse.verify|verify} messages.\n         * @function encode\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {interop.IGetAppInstanceStateResponse} message GetAppInstanceStateResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAppInstanceStateResponse.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.state != null && message.hasOwnProperty(\"state\"))\n                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified GetAppInstanceStateResponse message, length delimited. Does not implicitly {@link interop.GetAppInstanceStateResponse.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {interop.IGetAppInstanceStateResponse} message GetAppInstanceStateResponse message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        GetAppInstanceStateResponse.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a GetAppInstanceStateResponse message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.GetAppInstanceStateResponse} GetAppInstanceStateResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAppInstanceStateResponse.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.GetAppInstanceStateResponse();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.state = reader.int32();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a GetAppInstanceStateResponse message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.GetAppInstanceStateResponse} GetAppInstanceStateResponse\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        GetAppInstanceStateResponse.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a GetAppInstanceStateResponse message.\n         * @function verify\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        GetAppInstanceStateResponse.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.state != null && message.hasOwnProperty(\"state\"))\n                switch (message.state) {\n                default:\n                    return \"state: enum value expected\";\n                case 0:\n                case 1:\n                case 2:\n                case 3:\n                    break;\n                }\n            return null;\n        };\n\n        /**\n         * Creates a GetAppInstanceStateResponse message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.GetAppInstanceStateResponse} GetAppInstanceStateResponse\n         */\n        GetAppInstanceStateResponse.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.GetAppInstanceStateResponse)\n                return object;\n            var message = new $root.interop.GetAppInstanceStateResponse();\n            switch (object.state) {\n            case \"Unknown\":\n            case 0:\n                message.state = 0;\n                break;\n            case \"Starting\":\n            case 1:\n                message.state = 1;\n                break;\n            case \"Running\":\n            case 2:\n                message.state = 2;\n                break;\n            case \"Stopped\":\n            case 3:\n                message.state = 3;\n                break;\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a GetAppInstanceStateResponse message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.GetAppInstanceStateResponse\n         * @static\n         * @param {interop.GetAppInstanceStateResponse} message GetAppInstanceStateResponse\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        GetAppInstanceStateResponse.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults)\n                object.state = options.enums === String ? \"Unknown\" : 0;\n            if (message.state != null && message.hasOwnProperty(\"state\"))\n                object.state = options.enums === String ? $root.interop.AppInstanceState[message.state] : message.state;\n            return object;\n        };\n\n        /**\n         * Converts this GetAppInstanceStateResponse to JSON.\n         * @function toJSON\n         * @memberof interop.GetAppInstanceStateResponse\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        GetAppInstanceStateResponse.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return GetAppInstanceStateResponse;\n    })();\n\n    interop.UniqueId = (function() {\n\n        /**\n         * Properties of an UniqueId.\n         * @memberof interop\n         * @interface IUniqueId\n         * @property {Long} [lo] UniqueId lo\n         * @property {Long} [hi] UniqueId hi\n         */\n\n        /**\n         * Constructs a new UniqueId.\n         * @memberof interop\n         * @classdesc Represents an UniqueId.\n         * @constructor\n         * @param {interop.IUniqueId=} [properties] Properties to set\n         */\n        function UniqueId(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * UniqueId lo.\n         * @member {Long}lo\n         * @memberof interop.UniqueId\n         * @instance\n         */\n        UniqueId.prototype.lo = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n        /**\n         * UniqueId hi.\n         * @member {Long}hi\n         * @memberof interop.UniqueId\n         * @instance\n         */\n        UniqueId.prototype.hi = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n        /**\n         * Creates a new UniqueId instance using the specified properties.\n         * @function create\n         * @memberof interop.UniqueId\n         * @static\n         * @param {interop.IUniqueId=} [properties] Properties to set\n         * @returns {interop.UniqueId} UniqueId instance\n         */\n        UniqueId.create = function create(properties) {\n            return new UniqueId(properties);\n        };\n\n        /**\n         * Encodes the specified UniqueId message. Does not implicitly {@link interop.UniqueId.verify|verify} messages.\n         * @function encode\n         * @memberof interop.UniqueId\n         * @static\n         * @param {interop.IUniqueId} message UniqueId message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        UniqueId.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.lo != null && message.hasOwnProperty(\"lo\"))\n                writer.uint32(/* id 1, wireType 1 =*/9).fixed64(message.lo);\n            if (message.hi != null && message.hasOwnProperty(\"hi\"))\n                writer.uint32(/* id 2, wireType 1 =*/17).fixed64(message.hi);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified UniqueId message, length delimited. Does not implicitly {@link interop.UniqueId.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof interop.UniqueId\n         * @static\n         * @param {interop.IUniqueId} message UniqueId message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        UniqueId.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes an UniqueId message from the specified reader or buffer.\n         * @function decode\n         * @memberof interop.UniqueId\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {interop.UniqueId} UniqueId\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        UniqueId.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.UniqueId();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.lo = reader.fixed64();\n                    break;\n                case 2:\n                    message.hi = reader.fixed64();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes an UniqueId message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof interop.UniqueId\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {interop.UniqueId} UniqueId\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        UniqueId.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies an UniqueId message.\n         * @function verify\n         * @memberof interop.UniqueId\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        UniqueId.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.lo != null && message.hasOwnProperty(\"lo\"))\n                if (!$util.isInteger(message.lo) && !(message.lo && $util.isInteger(message.lo.low) && $util.isInteger(message.lo.high)))\n                    return \"lo: integer|Long expected\";\n            if (message.hi != null && message.hasOwnProperty(\"hi\"))\n                if (!$util.isInteger(message.hi) && !(message.hi && $util.isInteger(message.hi.low) && $util.isInteger(message.hi.high)))\n                    return \"hi: integer|Long expected\";\n            return null;\n        };\n\n        /**\n         * Creates an UniqueId message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof interop.UniqueId\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {interop.UniqueId} UniqueId\n         */\n        UniqueId.fromObject = function fromObject(object) {\n            if (object instanceof $root.interop.UniqueId)\n                return object;\n            var message = new $root.interop.UniqueId();\n            if (object.lo != null)\n                if ($util.Long)\n                    (message.lo = $util.Long.fromValue(object.lo)).unsigned = false;\n                else if (typeof object.lo === \"string\")\n                    message.lo = parseInt(object.lo, 10);\n                else if (typeof object.lo === \"number\")\n                    message.lo = object.lo;\n                else if (typeof object.lo === \"object\")\n                    message.lo = new $util.LongBits(object.lo.low >>> 0, object.lo.high >>> 0).toNumber();\n            if (object.hi != null)\n                if ($util.Long)\n                    (message.hi = $util.Long.fromValue(object.hi)).unsigned = false;\n                else if (typeof object.hi === \"string\")\n                    message.hi = parseInt(object.hi, 10);\n                else if (typeof object.hi === \"number\")\n                    message.hi = object.hi;\n                else if (typeof object.hi === \"object\")\n                    message.hi = new $util.LongBits(object.hi.low >>> 0, object.hi.high >>> 0).toNumber();\n            return message;\n        };\n\n        /**\n         * Creates a plain object from an UniqueId message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof interop.UniqueId\n         * @static\n         * @param {interop.UniqueId} message UniqueId\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        UniqueId.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                if ($util.Long) {\n                    var long = new $util.Long(0, 0, false);\n                    object.lo = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                } else\n                    object.lo = options.longs === String ? \"0\" : 0;\n                if ($util.Long) {\n                    var long = new $util.Long(0, 0, false);\n                    object.hi = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                } else\n                    object.hi = options.longs === String ? \"0\" : 0;\n            }\n            if (message.lo != null && message.hasOwnProperty(\"lo\"))\n                if (typeof message.lo === \"number\")\n                    object.lo = options.longs === String ? String(message.lo) : message.lo;\n                else\n                    object.lo = options.longs === String ? $util.Long.prototype.toString.call(message.lo) : options.longs === Number ? new $util.LongBits(message.lo.low >>> 0, message.lo.high >>> 0).toNumber() : message.lo;\n            if (message.hi != null && message.hasOwnProperty(\"hi\"))\n                if (typeof message.hi === \"number\")\n                    object.hi = options.longs === String ? String(message.hi) : message.hi;\n                else\n                    object.hi = options.longs === String ? $util.Long.prototype.toString.call(message.hi) : options.longs === Number ? new $util.LongBits(message.hi.low >>> 0, message.hi.high >>> 0).toNumber() : message.hi;\n            return object;\n        };\n\n        /**\n         * Converts this UniqueId to JSON.\n         * @function toJSON\n         * @memberof interop.UniqueId\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        UniqueId.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        return UniqueId;\n    })();\n\n    return interop;\n})();\n\n$root.google = (function() {\n\n    /**\n     * Namespace google.\n     * @exports google\n     * @namespace\n     */\n    var google = {};\n\n    google.protobuf = (function() {\n\n        /**\n         * Namespace protobuf.\n         * @memberof google\n         * @namespace\n         */\n        var protobuf = {};\n\n        protobuf.FileDescriptorSet = (function() {\n\n            /**\n             * Properties of a FileDescriptorSet.\n             * @memberof google.protobuf\n             * @interface IFileDescriptorSet\n             * @property {Array.<google.protobuf.IFileDescriptorProto>} [file] FileDescriptorSet file\n             */\n\n            /**\n             * Constructs a new FileDescriptorSet.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileDescriptorSet.\n             * @constructor\n             * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n             */\n            function FileDescriptorSet(properties) {\n                this.file = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileDescriptorSet file.\n             * @member {Array.<google.protobuf.IFileDescriptorProto>}file\n             * @memberof google.protobuf.FileDescriptorSet\n             * @instance\n             */\n            FileDescriptorSet.prototype.file = $util.emptyArray;\n\n            /**\n             * Creates a new FileDescriptorSet instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance\n             */\n            FileDescriptorSet.create = function create(properties) {\n                return new FileDescriptorSet(properties);\n            };\n\n            /**\n             * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorSet.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.file != null && message.file.length)\n                    for (var i = 0; i < message.file.length; ++i)\n                        $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorSet.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.file && message.file.length))\n                            message.file = [];\n                        message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileDescriptorSet message.\n             * @function verify\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileDescriptorSet.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.file != null && message.hasOwnProperty(\"file\")) {\n                    if (!Array.isArray(message.file))\n                        return \"file: array expected\";\n                    for (var i = 0; i < message.file.length; ++i) {\n                        var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);\n                        if (error)\n                            return \"file.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             */\n            FileDescriptorSet.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileDescriptorSet)\n                    return object;\n                var message = new $root.google.protobuf.FileDescriptorSet();\n                if (object.file) {\n                    if (!Array.isArray(object.file))\n                        throw TypeError(\".google.protobuf.FileDescriptorSet.file: array expected\");\n                    message.file = [];\n                    for (var i = 0; i < object.file.length; ++i) {\n                        if (typeof object.file[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorSet.file: object expected\");\n                        message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileDescriptorSet.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.file = [];\n                if (message.file && message.file.length) {\n                    object.file = [];\n                    for (var j = 0; j < message.file.length; ++j)\n                        object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FileDescriptorSet to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileDescriptorSet\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileDescriptorSet.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return FileDescriptorSet;\n        })();\n\n        protobuf.FileDescriptorProto = (function() {\n\n            /**\n             * Properties of a FileDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IFileDescriptorProto\n             * @property {string} [name] FileDescriptorProto name\n             * @property {string} [\"package\"] FileDescriptorProto package\n             * @property {Array.<string>} [dependency] FileDescriptorProto dependency\n             * @property {Array.<number>} [publicDependency] FileDescriptorProto publicDependency\n             * @property {Array.<number>} [weakDependency] FileDescriptorProto weakDependency\n             * @property {Array.<google.protobuf.IDescriptorProto>} [messageType] FileDescriptorProto messageType\n             * @property {Array.<google.protobuf.IEnumDescriptorProto>} [enumType] FileDescriptorProto enumType\n             * @property {Array.<google.protobuf.IServiceDescriptorProto>} [service] FileDescriptorProto service\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>} [extension] FileDescriptorProto extension\n             * @property {google.protobuf.IFileOptions} [options] FileDescriptorProto options\n             * @property {google.protobuf.ISourceCodeInfo} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo\n             * @property {string} [syntax] FileDescriptorProto syntax\n             */\n\n            /**\n             * Constructs a new FileDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n             */\n            function FileDescriptorProto(properties) {\n                this.dependency = [];\n                this.publicDependency = [];\n                this.weakDependency = [];\n                this.messageType = [];\n                this.enumType = [];\n                this.service = [];\n                this.extension = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.name = \"\";\n\n            /**\n             * FileDescriptorProto package.\n             * @member {string}package_\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype[\"package\"] = \"\";\n\n            /**\n             * FileDescriptorProto dependency.\n             * @member {Array.<string>}dependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.dependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto publicDependency.\n             * @member {Array.<number>}publicDependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.publicDependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto weakDependency.\n             * @member {Array.<number>}weakDependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.weakDependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto messageType.\n             * @member {Array.<google.protobuf.IDescriptorProto>}messageType\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.messageType = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto enumType.\n             * @member {Array.<google.protobuf.IEnumDescriptorProto>}enumType\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.enumType = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto service.\n             * @member {Array.<google.protobuf.IServiceDescriptorProto>}service\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.service = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto extension.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>}extension\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.extension = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto options.\n             * @member {(google.protobuf.IFileOptions|null|undefined)}options\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.options = null;\n\n            /**\n             * FileDescriptorProto sourceCodeInfo.\n             * @member {(google.protobuf.ISourceCodeInfo|null|undefined)}sourceCodeInfo\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.sourceCodeInfo = null;\n\n            /**\n             * FileDescriptorProto syntax.\n             * @member {string}syntax\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.syntax = \"\";\n\n            /**\n             * Creates a new FileDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance\n             */\n            FileDescriptorProto.create = function create(properties) {\n                return new FileDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message[\"package\"]);\n                if (message.dependency != null && message.dependency.length)\n                    for (var i = 0; i < message.dependency.length; ++i)\n                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);\n                if (message.messageType != null && message.messageType.length)\n                    for (var i = 0; i < message.messageType.length; ++i)\n                        $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.enumType != null && message.enumType.length)\n                    for (var i = 0; i < message.enumType.length; ++i)\n                        $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.service != null && message.service.length)\n                    for (var i = 0; i < message.service.length; ++i)\n                        $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                if (message.extension != null && message.extension.length)\n                    for (var i = 0; i < message.extension.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\"))\n                    $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n                if (message.publicDependency != null && message.publicDependency.length)\n                    for (var i = 0; i < message.publicDependency.length; ++i)\n                        writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);\n                if (message.weakDependency != null && message.weakDependency.length)\n                    for (var i = 0; i < message.weakDependency.length; ++i)\n                        writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);\n                if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n                    writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message[\"package\"] = reader.string();\n                        break;\n                    case 3:\n                        if (!(message.dependency && message.dependency.length))\n                            message.dependency = [];\n                        message.dependency.push(reader.string());\n                        break;\n                    case 10:\n                        if (!(message.publicDependency && message.publicDependency.length))\n                            message.publicDependency = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.publicDependency.push(reader.int32());\n                        } else\n                            message.publicDependency.push(reader.int32());\n                        break;\n                    case 11:\n                        if (!(message.weakDependency && message.weakDependency.length))\n                            message.weakDependency = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.weakDependency.push(reader.int32());\n                        } else\n                            message.weakDependency.push(reader.int32());\n                        break;\n                    case 4:\n                        if (!(message.messageType && message.messageType.length))\n                            message.messageType = [];\n                        message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        if (!(message.enumType && message.enumType.length))\n                            message.enumType = [];\n                        message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 6:\n                        if (!(message.service && message.service.length))\n                            message.service = [];\n                        message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 7:\n                        if (!(message.extension && message.extension.length))\n                            message.extension = [];\n                        message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 8:\n                        message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());\n                        break;\n                    case 9:\n                        message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());\n                        break;\n                    case 12:\n                        message.syntax = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n                    if (!$util.isString(message[\"package\"]))\n                        return \"package: string expected\";\n                if (message.dependency != null && message.hasOwnProperty(\"dependency\")) {\n                    if (!Array.isArray(message.dependency))\n                        return \"dependency: array expected\";\n                    for (var i = 0; i < message.dependency.length; ++i)\n                        if (!$util.isString(message.dependency[i]))\n                            return \"dependency: string[] expected\";\n                }\n                if (message.publicDependency != null && message.hasOwnProperty(\"publicDependency\")) {\n                    if (!Array.isArray(message.publicDependency))\n                        return \"publicDependency: array expected\";\n                    for (var i = 0; i < message.publicDependency.length; ++i)\n                        if (!$util.isInteger(message.publicDependency[i]))\n                            return \"publicDependency: integer[] expected\";\n                }\n                if (message.weakDependency != null && message.hasOwnProperty(\"weakDependency\")) {\n                    if (!Array.isArray(message.weakDependency))\n                        return \"weakDependency: array expected\";\n                    for (var i = 0; i < message.weakDependency.length; ++i)\n                        if (!$util.isInteger(message.weakDependency[i]))\n                            return \"weakDependency: integer[] expected\";\n                }\n                if (message.messageType != null && message.hasOwnProperty(\"messageType\")) {\n                    if (!Array.isArray(message.messageType))\n                        return \"messageType: array expected\";\n                    for (var i = 0; i < message.messageType.length; ++i) {\n                        var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);\n                        if (error)\n                            return \"messageType.\" + error;\n                    }\n                }\n                if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n                    if (!Array.isArray(message.enumType))\n                        return \"enumType: array expected\";\n                    for (var i = 0; i < message.enumType.length; ++i) {\n                        error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n                        if (error)\n                            return \"enumType.\" + error;\n                    }\n                }\n                if (message.service != null && message.hasOwnProperty(\"service\")) {\n                    if (!Array.isArray(message.service))\n                        return \"service: array expected\";\n                    for (var i = 0; i < message.service.length; ++i) {\n                        error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);\n                        if (error)\n                            return \"service.\" + error;\n                    }\n                }\n                if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n                    if (!Array.isArray(message.extension))\n                        return \"extension: array expected\";\n                    for (var i = 0; i < message.extension.length; ++i) {\n                        error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n                        if (error)\n                            return \"extension.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    error = $root.google.protobuf.FileOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\")) {\n                    error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);\n                    if (error)\n                        return \"sourceCodeInfo.\" + error;\n                }\n                if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n                    if (!$util.isString(message.syntax))\n                        return \"syntax: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             */\n            FileDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.FileDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object[\"package\"] != null)\n                    message[\"package\"] = String(object[\"package\"]);\n                if (object.dependency) {\n                    if (!Array.isArray(object.dependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.dependency: array expected\");\n                    message.dependency = [];\n                    for (var i = 0; i < object.dependency.length; ++i)\n                        message.dependency[i] = String(object.dependency[i]);\n                }\n                if (object.publicDependency) {\n                    if (!Array.isArray(object.publicDependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.publicDependency: array expected\");\n                    message.publicDependency = [];\n                    for (var i = 0; i < object.publicDependency.length; ++i)\n                        message.publicDependency[i] = object.publicDependency[i] | 0;\n                }\n                if (object.weakDependency) {\n                    if (!Array.isArray(object.weakDependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.weakDependency: array expected\");\n                    message.weakDependency = [];\n                    for (var i = 0; i < object.weakDependency.length; ++i)\n                        message.weakDependency[i] = object.weakDependency[i] | 0;\n                }\n                if (object.messageType) {\n                    if (!Array.isArray(object.messageType))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: array expected\");\n                    message.messageType = [];\n                    for (var i = 0; i < object.messageType.length; ++i) {\n                        if (typeof object.messageType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: object expected\");\n                        message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);\n                    }\n                }\n                if (object.enumType) {\n                    if (!Array.isArray(object.enumType))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: array expected\");\n                    message.enumType = [];\n                    for (var i = 0; i < object.enumType.length; ++i) {\n                        if (typeof object.enumType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: object expected\");\n                        message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n                    }\n                }\n                if (object.service) {\n                    if (!Array.isArray(object.service))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.service: array expected\");\n                    message.service = [];\n                    for (var i = 0; i < object.service.length; ++i) {\n                        if (typeof object.service[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.service: object expected\");\n                        message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);\n                    }\n                }\n                if (object.extension) {\n                    if (!Array.isArray(object.extension))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.extension: array expected\");\n                    message.extension = [];\n                    for (var i = 0; i < object.extension.length; ++i) {\n                        if (typeof object.extension[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.extension: object expected\");\n                        message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.FileOptions.fromObject(object.options);\n                }\n                if (object.sourceCodeInfo != null) {\n                    if (typeof object.sourceCodeInfo !== \"object\")\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected\");\n                    message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);\n                }\n                if (object.syntax != null)\n                    message.syntax = String(object.syntax);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.dependency = [];\n                    object.messageType = [];\n                    object.enumType = [];\n                    object.service = [];\n                    object.extension = [];\n                    object.publicDependency = [];\n                    object.weakDependency = [];\n                }\n                if (options.defaults) {\n                    object.name = \"\";\n                    object[\"package\"] = \"\";\n                    object.options = null;\n                    object.sourceCodeInfo = null;\n                    object.syntax = \"\";\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n                    object[\"package\"] = message[\"package\"];\n                if (message.dependency && message.dependency.length) {\n                    object.dependency = [];\n                    for (var j = 0; j < message.dependency.length; ++j)\n                        object.dependency[j] = message.dependency[j];\n                }\n                if (message.messageType && message.messageType.length) {\n                    object.messageType = [];\n                    for (var j = 0; j < message.messageType.length; ++j)\n                        object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);\n                }\n                if (message.enumType && message.enumType.length) {\n                    object.enumType = [];\n                    for (var j = 0; j < message.enumType.length; ++j)\n                        object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n                }\n                if (message.service && message.service.length) {\n                    object.service = [];\n                    for (var j = 0; j < message.service.length; ++j)\n                        object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);\n                }\n                if (message.extension && message.extension.length) {\n                    object.extension = [];\n                    for (var j = 0; j < message.extension.length; ++j)\n                        object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);\n                if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\"))\n                    object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);\n                if (message.publicDependency && message.publicDependency.length) {\n                    object.publicDependency = [];\n                    for (var j = 0; j < message.publicDependency.length; ++j)\n                        object.publicDependency[j] = message.publicDependency[j];\n                }\n                if (message.weakDependency && message.weakDependency.length) {\n                    object.weakDependency = [];\n                    for (var j = 0; j < message.weakDependency.length; ++j)\n                        object.weakDependency[j] = message.weakDependency[j];\n                }\n                if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n                    object.syntax = message.syntax;\n                return object;\n            };\n\n            /**\n             * Converts this FileDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return FileDescriptorProto;\n        })();\n\n        protobuf.DescriptorProto = (function() {\n\n            /**\n             * Properties of a DescriptorProto.\n             * @memberof google.protobuf\n             * @interface IDescriptorProto\n             * @property {string} [name] DescriptorProto name\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>} [field] DescriptorProto field\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>} [extension] DescriptorProto extension\n             * @property {Array.<google.protobuf.IDescriptorProto>} [nestedType] DescriptorProto nestedType\n             * @property {Array.<google.protobuf.IEnumDescriptorProto>} [enumType] DescriptorProto enumType\n             * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>} [extensionRange] DescriptorProto extensionRange\n             * @property {Array.<google.protobuf.IOneofDescriptorProto>} [oneofDecl] DescriptorProto oneofDecl\n             * @property {google.protobuf.IMessageOptions} [options] DescriptorProto options\n             * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>} [reservedRange] DescriptorProto reservedRange\n             * @property {Array.<string>} [reservedName] DescriptorProto reservedName\n             */\n\n            /**\n             * Constructs a new DescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a DescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n             */\n            function DescriptorProto(properties) {\n                this.field = [];\n                this.extension = [];\n                this.nestedType = [];\n                this.enumType = [];\n                this.extensionRange = [];\n                this.oneofDecl = [];\n                this.reservedRange = [];\n                this.reservedName = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * DescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.name = \"\";\n\n            /**\n             * DescriptorProto field.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>}field\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.field = $util.emptyArray;\n\n            /**\n             * DescriptorProto extension.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>}extension\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.extension = $util.emptyArray;\n\n            /**\n             * DescriptorProto nestedType.\n             * @member {Array.<google.protobuf.IDescriptorProto>}nestedType\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.nestedType = $util.emptyArray;\n\n            /**\n             * DescriptorProto enumType.\n             * @member {Array.<google.protobuf.IEnumDescriptorProto>}enumType\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.enumType = $util.emptyArray;\n\n            /**\n             * DescriptorProto extensionRange.\n             * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>}extensionRange\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.extensionRange = $util.emptyArray;\n\n            /**\n             * DescriptorProto oneofDecl.\n             * @member {Array.<google.protobuf.IOneofDescriptorProto>}oneofDecl\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.oneofDecl = $util.emptyArray;\n\n            /**\n             * DescriptorProto options.\n             * @member {(google.protobuf.IMessageOptions|null|undefined)}options\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.options = null;\n\n            /**\n             * DescriptorProto reservedRange.\n             * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>}reservedRange\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.reservedRange = $util.emptyArray;\n\n            /**\n             * DescriptorProto reservedName.\n             * @member {Array.<string>}reservedName\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.reservedName = $util.emptyArray;\n\n            /**\n             * Creates a new DescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto instance\n             */\n            DescriptorProto.create = function create(properties) {\n                return new DescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.field != null && message.field.length)\n                    for (var i = 0; i < message.field.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.nestedType != null && message.nestedType.length)\n                    for (var i = 0; i < message.nestedType.length; ++i)\n                        $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                if (message.enumType != null && message.enumType.length)\n                    for (var i = 0; i < message.enumType.length; ++i)\n                        $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.extensionRange != null && message.extensionRange.length)\n                    for (var i = 0; i < message.extensionRange.length; ++i)\n                        $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.extension != null && message.extension.length)\n                    for (var i = 0; i < message.extension.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                if (message.oneofDecl != null && message.oneofDecl.length)\n                    for (var i = 0; i < message.oneofDecl.length; ++i)\n                        $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.reservedRange != null && message.reservedRange.length)\n                    for (var i = 0; i < message.reservedRange.length; ++i)\n                        $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n                if (message.reservedName != null && message.reservedName.length)\n                    for (var i = 0; i < message.reservedName.length; ++i)\n                        writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.field && message.field.length))\n                            message.field = [];\n                        message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 6:\n                        if (!(message.extension && message.extension.length))\n                            message.extension = [];\n                        message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        if (!(message.nestedType && message.nestedType.length))\n                            message.nestedType = [];\n                        message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 4:\n                        if (!(message.enumType && message.enumType.length))\n                            message.enumType = [];\n                        message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        if (!(message.extensionRange && message.extensionRange.length))\n                            message.extensionRange = [];\n                        message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));\n                        break;\n                    case 8:\n                        if (!(message.oneofDecl && message.oneofDecl.length))\n                            message.oneofDecl = [];\n                        message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 7:\n                        message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());\n                        break;\n                    case 9:\n                        if (!(message.reservedRange && message.reservedRange.length))\n                            message.reservedRange = [];\n                        message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));\n                        break;\n                    case 10:\n                        if (!(message.reservedName && message.reservedName.length))\n                            message.reservedName = [];\n                        message.reservedName.push(reader.string());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a DescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            DescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.field != null && message.hasOwnProperty(\"field\")) {\n                    if (!Array.isArray(message.field))\n                        return \"field: array expected\";\n                    for (var i = 0; i < message.field.length; ++i) {\n                        var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);\n                        if (error)\n                            return \"field.\" + error;\n                    }\n                }\n                if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n                    if (!Array.isArray(message.extension))\n                        return \"extension: array expected\";\n                    for (var i = 0; i < message.extension.length; ++i) {\n                        error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n                        if (error)\n                            return \"extension.\" + error;\n                    }\n                }\n                if (message.nestedType != null && message.hasOwnProperty(\"nestedType\")) {\n                    if (!Array.isArray(message.nestedType))\n                        return \"nestedType: array expected\";\n                    for (var i = 0; i < message.nestedType.length; ++i) {\n                        error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);\n                        if (error)\n                            return \"nestedType.\" + error;\n                    }\n                }\n                if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n                    if (!Array.isArray(message.enumType))\n                        return \"enumType: array expected\";\n                    for (var i = 0; i < message.enumType.length; ++i) {\n                        error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n                        if (error)\n                            return \"enumType.\" + error;\n                    }\n                }\n                if (message.extensionRange != null && message.hasOwnProperty(\"extensionRange\")) {\n                    if (!Array.isArray(message.extensionRange))\n                        return \"extensionRange: array expected\";\n                    for (var i = 0; i < message.extensionRange.length; ++i) {\n                        error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);\n                        if (error)\n                            return \"extensionRange.\" + error;\n                    }\n                }\n                if (message.oneofDecl != null && message.hasOwnProperty(\"oneofDecl\")) {\n                    if (!Array.isArray(message.oneofDecl))\n                        return \"oneofDecl: array expected\";\n                    for (var i = 0; i < message.oneofDecl.length; ++i) {\n                        error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);\n                        if (error)\n                            return \"oneofDecl.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    error = $root.google.protobuf.MessageOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.reservedRange != null && message.hasOwnProperty(\"reservedRange\")) {\n                    if (!Array.isArray(message.reservedRange))\n                        return \"reservedRange: array expected\";\n                    for (var i = 0; i < message.reservedRange.length; ++i) {\n                        error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);\n                        if (error)\n                            return \"reservedRange.\" + error;\n                    }\n                }\n                if (message.reservedName != null && message.hasOwnProperty(\"reservedName\")) {\n                    if (!Array.isArray(message.reservedName))\n                        return \"reservedName: array expected\";\n                    for (var i = 0; i < message.reservedName.length; ++i)\n                        if (!$util.isString(message.reservedName[i]))\n                            return \"reservedName: string[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             */\n            DescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.DescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.DescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.field) {\n                    if (!Array.isArray(object.field))\n                        throw TypeError(\".google.protobuf.DescriptorProto.field: array expected\");\n                    message.field = [];\n                    for (var i = 0; i < object.field.length; ++i) {\n                        if (typeof object.field[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.field: object expected\");\n                        message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);\n                    }\n                }\n                if (object.extension) {\n                    if (!Array.isArray(object.extension))\n                        throw TypeError(\".google.protobuf.DescriptorProto.extension: array expected\");\n                    message.extension = [];\n                    for (var i = 0; i < object.extension.length; ++i) {\n                        if (typeof object.extension[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.extension: object expected\");\n                        message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n                    }\n                }\n                if (object.nestedType) {\n                    if (!Array.isArray(object.nestedType))\n                        throw TypeError(\".google.protobuf.DescriptorProto.nestedType: array expected\");\n                    message.nestedType = [];\n                    for (var i = 0; i < object.nestedType.length; ++i) {\n                        if (typeof object.nestedType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.nestedType: object expected\");\n                        message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);\n                    }\n                }\n                if (object.enumType) {\n                    if (!Array.isArray(object.enumType))\n                        throw TypeError(\".google.protobuf.DescriptorProto.enumType: array expected\");\n                    message.enumType = [];\n                    for (var i = 0; i < object.enumType.length; ++i) {\n                        if (typeof object.enumType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.enumType: object expected\");\n                        message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n                    }\n                }\n                if (object.extensionRange) {\n                    if (!Array.isArray(object.extensionRange))\n                        throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: array expected\");\n                    message.extensionRange = [];\n                    for (var i = 0; i < object.extensionRange.length; ++i) {\n                        if (typeof object.extensionRange[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: object expected\");\n                        message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);\n                    }\n                }\n                if (object.oneofDecl) {\n                    if (!Array.isArray(object.oneofDecl))\n                        throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: array expected\");\n                    message.oneofDecl = [];\n                    for (var i = 0; i < object.oneofDecl.length; ++i) {\n                        if (typeof object.oneofDecl[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: object expected\");\n                        message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.DescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);\n                }\n                if (object.reservedRange) {\n                    if (!Array.isArray(object.reservedRange))\n                        throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: array expected\");\n                    message.reservedRange = [];\n                    for (var i = 0; i < object.reservedRange.length; ++i) {\n                        if (typeof object.reservedRange[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: object expected\");\n                        message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);\n                    }\n                }\n                if (object.reservedName) {\n                    if (!Array.isArray(object.reservedName))\n                        throw TypeError(\".google.protobuf.DescriptorProto.reservedName: array expected\");\n                    message.reservedName = [];\n                    for (var i = 0; i < object.reservedName.length; ++i)\n                        message.reservedName[i] = String(object.reservedName[i]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.DescriptorProto} message DescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            DescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.field = [];\n                    object.nestedType = [];\n                    object.enumType = [];\n                    object.extensionRange = [];\n                    object.extension = [];\n                    object.oneofDecl = [];\n                    object.reservedRange = [];\n                    object.reservedName = [];\n                }\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.field && message.field.length) {\n                    object.field = [];\n                    for (var j = 0; j < message.field.length; ++j)\n                        object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);\n                }\n                if (message.nestedType && message.nestedType.length) {\n                    object.nestedType = [];\n                    for (var j = 0; j < message.nestedType.length; ++j)\n                        object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);\n                }\n                if (message.enumType && message.enumType.length) {\n                    object.enumType = [];\n                    for (var j = 0; j < message.enumType.length; ++j)\n                        object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n                }\n                if (message.extensionRange && message.extensionRange.length) {\n                    object.extensionRange = [];\n                    for (var j = 0; j < message.extensionRange.length; ++j)\n                        object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);\n                }\n                if (message.extension && message.extension.length) {\n                    object.extension = [];\n                    for (var j = 0; j < message.extension.length; ++j)\n                        object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);\n                if (message.oneofDecl && message.oneofDecl.length) {\n                    object.oneofDecl = [];\n                    for (var j = 0; j < message.oneofDecl.length; ++j)\n                        object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);\n                }\n                if (message.reservedRange && message.reservedRange.length) {\n                    object.reservedRange = [];\n                    for (var j = 0; j < message.reservedRange.length; ++j)\n                        object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);\n                }\n                if (message.reservedName && message.reservedName.length) {\n                    object.reservedName = [];\n                    for (var j = 0; j < message.reservedName.length; ++j)\n                        object.reservedName[j] = message.reservedName[j];\n                }\n                return object;\n            };\n\n            /**\n             * Converts this DescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            DescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            DescriptorProto.ExtensionRange = (function() {\n\n                /**\n                 * Properties of an ExtensionRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @interface IExtensionRange\n                 * @property {number} [start] ExtensionRange start\n                 * @property {number} [end] ExtensionRange end\n                 */\n\n                /**\n                 * Constructs a new ExtensionRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @classdesc Represents an ExtensionRange.\n                 * @constructor\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n                 */\n                function ExtensionRange(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * ExtensionRange start.\n                 * @member {number}start\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 */\n                ExtensionRange.prototype.start = 0;\n\n                /**\n                 * ExtensionRange end.\n                 * @member {number}end\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 */\n                ExtensionRange.prototype.end = 0;\n\n                /**\n                 * Creates a new ExtensionRange instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance\n                 */\n                ExtensionRange.create = function create(properties) {\n                    return new ExtensionRange(properties);\n                };\n\n                /**\n                 * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ExtensionRange.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ExtensionRange.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.start = reader.int32();\n                            break;\n                        case 2:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ExtensionRange.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies an ExtensionRange message.\n                 * @function verify\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                ExtensionRange.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        if (!$util.isInteger(message.start))\n                            return \"start: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 */\n                ExtensionRange.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)\n                        return object;\n                    var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n                    if (object.start != null)\n                        message.start = object.start | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                ExtensionRange.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.start = 0;\n                        object.end = 0;\n                    }\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        object.start = message.start;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this ExtensionRange to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                ExtensionRange.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                return ExtensionRange;\n            })();\n\n            DescriptorProto.ReservedRange = (function() {\n\n                /**\n                 * Properties of a ReservedRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @interface IReservedRange\n                 * @property {number} [start] ReservedRange start\n                 * @property {number} [end] ReservedRange end\n                 */\n\n                /**\n                 * Constructs a new ReservedRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @classdesc Represents a ReservedRange.\n                 * @constructor\n                 * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n                 */\n                function ReservedRange(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * ReservedRange start.\n                 * @member {number}start\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 */\n                ReservedRange.prototype.start = 0;\n\n                /**\n                 * ReservedRange end.\n                 * @member {number}end\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 */\n                ReservedRange.prototype.end = 0;\n\n                /**\n                 * Creates a new ReservedRange instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance\n                 */\n                ReservedRange.create = function create(properties) {\n                    return new ReservedRange(properties);\n                };\n\n                /**\n                 * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ReservedRange.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ReservedRange.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.start = reader.int32();\n                            break;\n                        case 2:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ReservedRange.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a ReservedRange message.\n                 * @function verify\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                ReservedRange.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        if (!$util.isInteger(message.start))\n                            return \"start: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 */\n                ReservedRange.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)\n                        return object;\n                    var message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n                    if (object.start != null)\n                        message.start = object.start | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                ReservedRange.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.start = 0;\n                        object.end = 0;\n                    }\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        object.start = message.start;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this ReservedRange to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                ReservedRange.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                return ReservedRange;\n            })();\n\n            return DescriptorProto;\n        })();\n\n        protobuf.FieldDescriptorProto = (function() {\n\n            /**\n             * Properties of a FieldDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IFieldDescriptorProto\n             * @property {string} [name] FieldDescriptorProto name\n             * @property {number} [number] FieldDescriptorProto number\n             * @property {google.protobuf.FieldDescriptorProto.Label} [label] FieldDescriptorProto label\n             * @property {google.protobuf.FieldDescriptorProto.Type} [type] FieldDescriptorProto type\n             * @property {string} [typeName] FieldDescriptorProto typeName\n             * @property {string} [extendee] FieldDescriptorProto extendee\n             * @property {string} [defaultValue] FieldDescriptorProto defaultValue\n             * @property {number} [oneofIndex] FieldDescriptorProto oneofIndex\n             * @property {string} [jsonName] FieldDescriptorProto jsonName\n             * @property {google.protobuf.IFieldOptions} [options] FieldDescriptorProto options\n             */\n\n            /**\n             * Constructs a new FieldDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a FieldDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n             */\n            function FieldDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FieldDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.name = \"\";\n\n            /**\n             * FieldDescriptorProto number.\n             * @member {number}number\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.number = 0;\n\n            /**\n             * FieldDescriptorProto label.\n             * @member {google.protobuf.FieldDescriptorProto.Label}label\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.label = 1;\n\n            /**\n             * FieldDescriptorProto type.\n             * @member {google.protobuf.FieldDescriptorProto.Type}type\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.type = 1;\n\n            /**\n             * FieldDescriptorProto typeName.\n             * @member {string}typeName\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.typeName = \"\";\n\n            /**\n             * FieldDescriptorProto extendee.\n             * @member {string}extendee\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.extendee = \"\";\n\n            /**\n             * FieldDescriptorProto defaultValue.\n             * @member {string}defaultValue\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.defaultValue = \"\";\n\n            /**\n             * FieldDescriptorProto oneofIndex.\n             * @member {number}oneofIndex\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.oneofIndex = 0;\n\n            /**\n             * FieldDescriptorProto jsonName.\n             * @member {string}jsonName\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.jsonName = \"\";\n\n            /**\n             * FieldDescriptorProto options.\n             * @member {(google.protobuf.IFieldOptions|null|undefined)}options\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new FieldDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance\n             */\n            FieldDescriptorProto.create = function create(properties) {\n                return new FieldDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);\n                if (message.label != null && message.hasOwnProperty(\"label\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);\n                if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n                    writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);\n                if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);\n                if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n                    writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 3:\n                        message.number = reader.int32();\n                        break;\n                    case 4:\n                        message.label = reader.int32();\n                        break;\n                    case 5:\n                        message.type = reader.int32();\n                        break;\n                    case 6:\n                        message.typeName = reader.string();\n                        break;\n                    case 2:\n                        message.extendee = reader.string();\n                        break;\n                    case 7:\n                        message.defaultValue = reader.string();\n                        break;\n                    case 9:\n                        message.oneofIndex = reader.int32();\n                        break;\n                    case 10:\n                        message.jsonName = reader.string();\n                        break;\n                    case 8:\n                        message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FieldDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FieldDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    if (!$util.isInteger(message.number))\n                        return \"number: integer expected\";\n                if (message.label != null && message.hasOwnProperty(\"label\"))\n                    switch (message.label) {\n                    default:\n                        return \"label: enum value expected\";\n                    case 1:\n                    case 2:\n                    case 3:\n                        break;\n                    }\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    switch (message.type) {\n                    default:\n                        return \"type: enum value expected\";\n                    case 1:\n                    case 2:\n                    case 3:\n                    case 4:\n                    case 5:\n                    case 6:\n                    case 7:\n                    case 8:\n                    case 9:\n                    case 10:\n                    case 11:\n                    case 12:\n                    case 13:\n                    case 14:\n                    case 15:\n                    case 16:\n                    case 17:\n                    case 18:\n                        break;\n                    }\n                if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n                    if (!$util.isString(message.typeName))\n                        return \"typeName: string expected\";\n                if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n                    if (!$util.isString(message.extendee))\n                        return \"extendee: string expected\";\n                if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n                    if (!$util.isString(message.defaultValue))\n                        return \"defaultValue: string expected\";\n                if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n                    if (!$util.isInteger(message.oneofIndex))\n                        return \"oneofIndex: integer expected\";\n                if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n                    if (!$util.isString(message.jsonName))\n                        return \"jsonName: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.FieldOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             */\n            FieldDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FieldDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.FieldDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.number != null)\n                    message.number = object.number | 0;\n                switch (object.label) {\n                case \"LABEL_OPTIONAL\":\n                case 1:\n                    message.label = 1;\n                    break;\n                case \"LABEL_REQUIRED\":\n                case 2:\n                    message.label = 2;\n                    break;\n                case \"LABEL_REPEATED\":\n                case 3:\n                    message.label = 3;\n                    break;\n                }\n                switch (object.type) {\n                case \"TYPE_DOUBLE\":\n                case 1:\n                    message.type = 1;\n                    break;\n                case \"TYPE_FLOAT\":\n                case 2:\n                    message.type = 2;\n                    break;\n                case \"TYPE_INT64\":\n                case 3:\n                    message.type = 3;\n                    break;\n                case \"TYPE_UINT64\":\n                case 4:\n                    message.type = 4;\n                    break;\n                case \"TYPE_INT32\":\n                case 5:\n                    message.type = 5;\n                    break;\n                case \"TYPE_FIXED64\":\n                case 6:\n                    message.type = 6;\n                    break;\n                case \"TYPE_FIXED32\":\n                case 7:\n                    message.type = 7;\n                    break;\n                case \"TYPE_BOOL\":\n                case 8:\n                    message.type = 8;\n                    break;\n                case \"TYPE_STRING\":\n                case 9:\n                    message.type = 9;\n                    break;\n                case \"TYPE_GROUP\":\n                case 10:\n                    message.type = 10;\n                    break;\n                case \"TYPE_MESSAGE\":\n                case 11:\n                    message.type = 11;\n                    break;\n                case \"TYPE_BYTES\":\n                case 12:\n                    message.type = 12;\n                    break;\n                case \"TYPE_UINT32\":\n                case 13:\n                    message.type = 13;\n                    break;\n                case \"TYPE_ENUM\":\n                case 14:\n                    message.type = 14;\n                    break;\n                case \"TYPE_SFIXED32\":\n                case 15:\n                    message.type = 15;\n                    break;\n                case \"TYPE_SFIXED64\":\n                case 16:\n                    message.type = 16;\n                    break;\n                case \"TYPE_SINT32\":\n                case 17:\n                    message.type = 17;\n                    break;\n                case \"TYPE_SINT64\":\n                case 18:\n                    message.type = 18;\n                    break;\n                }\n                if (object.typeName != null)\n                    message.typeName = String(object.typeName);\n                if (object.extendee != null)\n                    message.extendee = String(object.extendee);\n                if (object.defaultValue != null)\n                    message.defaultValue = String(object.defaultValue);\n                if (object.oneofIndex != null)\n                    message.oneofIndex = object.oneofIndex | 0;\n                if (object.jsonName != null)\n                    message.jsonName = String(object.jsonName);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FieldDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.extendee = \"\";\n                    object.number = 0;\n                    object.label = options.enums === String ? \"LABEL_OPTIONAL\" : 1;\n                    object.type = options.enums === String ? \"TYPE_DOUBLE\" : 1;\n                    object.typeName = \"\";\n                    object.defaultValue = \"\";\n                    object.options = null;\n                    object.oneofIndex = 0;\n                    object.jsonName = \"\";\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n                    object.extendee = message.extendee;\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    object.number = message.number;\n                if (message.label != null && message.hasOwnProperty(\"label\"))\n                    object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;\n                if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n                    object.typeName = message.typeName;\n                if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n                    object.defaultValue = message.defaultValue;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);\n                if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n                    object.oneofIndex = message.oneofIndex;\n                if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n                    object.jsonName = message.jsonName;\n                return object;\n            };\n\n            /**\n             * Converts this FieldDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FieldDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Type enum.\n             * @enum {string}\n             * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value\n             * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value\n             * @property {number} TYPE_INT64=3 TYPE_INT64 value\n             * @property {number} TYPE_UINT64=4 TYPE_UINT64 value\n             * @property {number} TYPE_INT32=5 TYPE_INT32 value\n             * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value\n             * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value\n             * @property {number} TYPE_BOOL=8 TYPE_BOOL value\n             * @property {number} TYPE_STRING=9 TYPE_STRING value\n             * @property {number} TYPE_GROUP=10 TYPE_GROUP value\n             * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value\n             * @property {number} TYPE_BYTES=12 TYPE_BYTES value\n             * @property {number} TYPE_UINT32=13 TYPE_UINT32 value\n             * @property {number} TYPE_ENUM=14 TYPE_ENUM value\n             * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value\n             * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value\n             * @property {number} TYPE_SINT32=17 TYPE_SINT32 value\n             * @property {number} TYPE_SINT64=18 TYPE_SINT64 value\n             */\n            FieldDescriptorProto.Type = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"TYPE_DOUBLE\"] = 1;\n                values[valuesById[2] = \"TYPE_FLOAT\"] = 2;\n                values[valuesById[3] = \"TYPE_INT64\"] = 3;\n                values[valuesById[4] = \"TYPE_UINT64\"] = 4;\n                values[valuesById[5] = \"TYPE_INT32\"] = 5;\n                values[valuesById[6] = \"TYPE_FIXED64\"] = 6;\n                values[valuesById[7] = \"TYPE_FIXED32\"] = 7;\n                values[valuesById[8] = \"TYPE_BOOL\"] = 8;\n                values[valuesById[9] = \"TYPE_STRING\"] = 9;\n                values[valuesById[10] = \"TYPE_GROUP\"] = 10;\n                values[valuesById[11] = \"TYPE_MESSAGE\"] = 11;\n                values[valuesById[12] = \"TYPE_BYTES\"] = 12;\n                values[valuesById[13] = \"TYPE_UINT32\"] = 13;\n                values[valuesById[14] = \"TYPE_ENUM\"] = 14;\n                values[valuesById[15] = \"TYPE_SFIXED32\"] = 15;\n                values[valuesById[16] = \"TYPE_SFIXED64\"] = 16;\n                values[valuesById[17] = \"TYPE_SINT32\"] = 17;\n                values[valuesById[18] = \"TYPE_SINT64\"] = 18;\n                return values;\n            })();\n\n            /**\n             * Label enum.\n             * @enum {string}\n             * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value\n             * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value\n             * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value\n             */\n            FieldDescriptorProto.Label = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"LABEL_OPTIONAL\"] = 1;\n                values[valuesById[2] = \"LABEL_REQUIRED\"] = 2;\n                values[valuesById[3] = \"LABEL_REPEATED\"] = 3;\n                return values;\n            })();\n\n            return FieldDescriptorProto;\n        })();\n\n        protobuf.OneofDescriptorProto = (function() {\n\n            /**\n             * Properties of an OneofDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IOneofDescriptorProto\n             * @property {string} [name] OneofDescriptorProto name\n             * @property {google.protobuf.IOneofOptions} [options] OneofDescriptorProto options\n             */\n\n            /**\n             * Constructs a new OneofDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an OneofDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n             */\n            function OneofDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * OneofDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             */\n            OneofDescriptorProto.prototype.name = \"\";\n\n            /**\n             * OneofDescriptorProto options.\n             * @member {(google.protobuf.IOneofOptions|null|undefined)}options\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             */\n            OneofDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new OneofDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance\n             */\n            OneofDescriptorProto.create = function create(properties) {\n                return new OneofDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OneofDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OneofDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.OneofOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             */\n            OneofDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.OneofDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.OneofDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OneofDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this OneofDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OneofDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return OneofDescriptorProto;\n        })();\n\n        protobuf.EnumDescriptorProto = (function() {\n\n            /**\n             * Properties of an EnumDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IEnumDescriptorProto\n             * @property {string} [name] EnumDescriptorProto name\n             * @property {Array.<google.protobuf.IEnumValueDescriptorProto>} [value] EnumDescriptorProto value\n             * @property {google.protobuf.IEnumOptions} [options] EnumDescriptorProto options\n             */\n\n            /**\n             * Constructs a new EnumDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n             */\n            function EnumDescriptorProto(properties) {\n                this.value = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.name = \"\";\n\n            /**\n             * EnumDescriptorProto value.\n             * @member {Array.<google.protobuf.IEnumValueDescriptorProto>}value\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.value = $util.emptyArray;\n\n            /**\n             * EnumDescriptorProto options.\n             * @member {(google.protobuf.IEnumOptions|null|undefined)}options\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new EnumDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance\n             */\n            EnumDescriptorProto.create = function create(properties) {\n                return new EnumDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.value != null && message.value.length)\n                    for (var i = 0; i < message.value.length; ++i)\n                        $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.value && message.value.length))\n                            message.value = [];\n                        message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.value != null && message.hasOwnProperty(\"value\")) {\n                    if (!Array.isArray(message.value))\n                        return \"value: array expected\";\n                    for (var i = 0; i < message.value.length; ++i) {\n                        var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);\n                        if (error)\n                            return \"value.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    error = $root.google.protobuf.EnumOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             */\n            EnumDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.EnumDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.value) {\n                    if (!Array.isArray(object.value))\n                        throw TypeError(\".google.protobuf.EnumDescriptorProto.value: array expected\");\n                    message.value = [];\n                    for (var i = 0; i < object.value.length; ++i) {\n                        if (typeof object.value[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumDescriptorProto.value: object expected\");\n                        message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.EnumDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.value = [];\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.value && message.value.length) {\n                    object.value = [];\n                    for (var j = 0; j < message.value.length; ++j)\n                        object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this EnumDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return EnumDescriptorProto;\n        })();\n\n        protobuf.EnumValueDescriptorProto = (function() {\n\n            /**\n             * Properties of an EnumValueDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IEnumValueDescriptorProto\n             * @property {string} [name] EnumValueDescriptorProto name\n             * @property {number} [number] EnumValueDescriptorProto number\n             * @property {google.protobuf.IEnumValueOptions} [options] EnumValueDescriptorProto options\n             */\n\n            /**\n             * Constructs a new EnumValueDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumValueDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n             */\n            function EnumValueDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumValueDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.name = \"\";\n\n            /**\n             * EnumValueDescriptorProto number.\n             * @member {number}number\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.number = 0;\n\n            /**\n             * EnumValueDescriptorProto options.\n             * @member {(google.protobuf.IEnumValueOptions|null|undefined)}options\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new EnumValueDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance\n             */\n            EnumValueDescriptorProto.create = function create(properties) {\n                return new EnumValueDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.number = reader.int32();\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumValueDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumValueDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    if (!$util.isInteger(message.number))\n                        return \"number: integer expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.EnumValueOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             */\n            EnumValueDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.EnumValueDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.number != null)\n                    message.number = object.number | 0;\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumValueDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.number = 0;\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    object.number = message.number;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this EnumValueDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumValueDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return EnumValueDescriptorProto;\n        })();\n\n        protobuf.ServiceDescriptorProto = (function() {\n\n            /**\n             * Properties of a ServiceDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IServiceDescriptorProto\n             * @property {string} [name] ServiceDescriptorProto name\n             * @property {Array.<google.protobuf.IMethodDescriptorProto>} [method] ServiceDescriptorProto method\n             * @property {google.protobuf.IServiceOptions} [options] ServiceDescriptorProto options\n             */\n\n            /**\n             * Constructs a new ServiceDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a ServiceDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n             */\n            function ServiceDescriptorProto(properties) {\n                this.method = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * ServiceDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.name = \"\";\n\n            /**\n             * ServiceDescriptorProto method.\n             * @member {Array.<google.protobuf.IMethodDescriptorProto>}method\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.method = $util.emptyArray;\n\n            /**\n             * ServiceDescriptorProto options.\n             * @member {(google.protobuf.IServiceOptions|null|undefined)}options\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new ServiceDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance\n             */\n            ServiceDescriptorProto.create = function create(properties) {\n                return new ServiceDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.method != null && message.method.length)\n                    for (var i = 0; i < message.method.length; ++i)\n                        $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.method && message.method.length))\n                            message.method = [];\n                        message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a ServiceDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            ServiceDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.method != null && message.hasOwnProperty(\"method\")) {\n                    if (!Array.isArray(message.method))\n                        return \"method: array expected\";\n                    for (var i = 0; i < message.method.length; ++i) {\n                        var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);\n                        if (error)\n                            return \"method.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    error = $root.google.protobuf.ServiceOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             */\n            ServiceDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.ServiceDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.ServiceDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.method) {\n                    if (!Array.isArray(object.method))\n                        throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: array expected\");\n                    message.method = [];\n                    for (var i = 0; i < object.method.length; ++i) {\n                        if (typeof object.method[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: object expected\");\n                        message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.ServiceDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            ServiceDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.method = [];\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.method && message.method.length) {\n                    object.method = [];\n                    for (var j = 0; j < message.method.length; ++j)\n                        object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this ServiceDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            ServiceDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return ServiceDescriptorProto;\n        })();\n\n        protobuf.MethodDescriptorProto = (function() {\n\n            /**\n             * Properties of a MethodDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IMethodDescriptorProto\n             * @property {string} [name] MethodDescriptorProto name\n             * @property {string} [inputType] MethodDescriptorProto inputType\n             * @property {string} [outputType] MethodDescriptorProto outputType\n             * @property {google.protobuf.IMethodOptions} [options] MethodDescriptorProto options\n             * @property {boolean} [clientStreaming] MethodDescriptorProto clientStreaming\n             * @property {boolean} [serverStreaming] MethodDescriptorProto serverStreaming\n             */\n\n            /**\n             * Constructs a new MethodDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a MethodDescriptorProto.\n             * @constructor\n             * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n             */\n            function MethodDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MethodDescriptorProto name.\n             * @member {string}name\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.name = \"\";\n\n            /**\n             * MethodDescriptorProto inputType.\n             * @member {string}inputType\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.inputType = \"\";\n\n            /**\n             * MethodDescriptorProto outputType.\n             * @member {string}outputType\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.outputType = \"\";\n\n            /**\n             * MethodDescriptorProto options.\n             * @member {(google.protobuf.IMethodOptions|null|undefined)}options\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.options = null;\n\n            /**\n             * MethodDescriptorProto clientStreaming.\n             * @member {boolean}clientStreaming\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.clientStreaming = false;\n\n            /**\n             * MethodDescriptorProto serverStreaming.\n             * @member {boolean}serverStreaming\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.serverStreaming = false;\n\n            /**\n             * Creates a new MethodDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance\n             */\n            MethodDescriptorProto.create = function create(properties) {\n                return new MethodDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);\n                if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);\n                if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n                    writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.inputType = reader.string();\n                        break;\n                    case 3:\n                        message.outputType = reader.string();\n                        break;\n                    case 4:\n                        message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());\n                        break;\n                    case 5:\n                        message.clientStreaming = reader.bool();\n                        break;\n                    case 6:\n                        message.serverStreaming = reader.bool();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MethodDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MethodDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n                    if (!$util.isString(message.inputType))\n                        return \"inputType: string expected\";\n                if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n                    if (!$util.isString(message.outputType))\n                        return \"outputType: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.MethodOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n                    if (typeof message.clientStreaming !== \"boolean\")\n                        return \"clientStreaming: boolean expected\";\n                if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n                    if (typeof message.serverStreaming !== \"boolean\")\n                        return \"serverStreaming: boolean expected\";\n                return null;\n            };\n\n            /**\n             * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             */\n            MethodDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MethodDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.MethodDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.inputType != null)\n                    message.inputType = String(object.inputType);\n                if (object.outputType != null)\n                    message.outputType = String(object.outputType);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);\n                }\n                if (object.clientStreaming != null)\n                    message.clientStreaming = Boolean(object.clientStreaming);\n                if (object.serverStreaming != null)\n                    message.serverStreaming = Boolean(object.serverStreaming);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MethodDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.inputType = \"\";\n                    object.outputType = \"\";\n                    object.options = null;\n                    object.clientStreaming = false;\n                    object.serverStreaming = false;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n                    object.inputType = message.inputType;\n                if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n                    object.outputType = message.outputType;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);\n                if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n                    object.clientStreaming = message.clientStreaming;\n                if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n                    object.serverStreaming = message.serverStreaming;\n                return object;\n            };\n\n            /**\n             * Converts this MethodDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MethodDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return MethodDescriptorProto;\n        })();\n\n        protobuf.FileOptions = (function() {\n\n            /**\n             * Properties of a FileOptions.\n             * @memberof google.protobuf\n             * @interface IFileOptions\n             * @property {string} [javaPackage] FileOptions javaPackage\n             * @property {string} [javaOuterClassname] FileOptions javaOuterClassname\n             * @property {boolean} [javaMultipleFiles] FileOptions javaMultipleFiles\n             * @property {boolean} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash\n             * @property {boolean} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8\n             * @property {google.protobuf.FileOptions.OptimizeMode} [optimizeFor] FileOptions optimizeFor\n             * @property {string} [goPackage] FileOptions goPackage\n             * @property {boolean} [ccGenericServices] FileOptions ccGenericServices\n             * @property {boolean} [javaGenericServices] FileOptions javaGenericServices\n             * @property {boolean} [pyGenericServices] FileOptions pyGenericServices\n             * @property {boolean} [deprecated] FileOptions deprecated\n             * @property {boolean} [ccEnableArenas] FileOptions ccEnableArenas\n             * @property {string} [objcClassPrefix] FileOptions objcClassPrefix\n             * @property {string} [csharpNamespace] FileOptions csharpNamespace\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] FileOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new FileOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileOptions.\n             * @constructor\n             * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n             */\n            function FileOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileOptions javaPackage.\n             * @member {string}javaPackage\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaPackage = \"\";\n\n            /**\n             * FileOptions javaOuterClassname.\n             * @member {string}javaOuterClassname\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaOuterClassname = \"\";\n\n            /**\n             * FileOptions javaMultipleFiles.\n             * @member {boolean}javaMultipleFiles\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaMultipleFiles = false;\n\n            /**\n             * FileOptions javaGenerateEqualsAndHash.\n             * @member {boolean}javaGenerateEqualsAndHash\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaGenerateEqualsAndHash = false;\n\n            /**\n             * FileOptions javaStringCheckUtf8.\n             * @member {boolean}javaStringCheckUtf8\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaStringCheckUtf8 = false;\n\n            /**\n             * FileOptions optimizeFor.\n             * @member {google.protobuf.FileOptions.OptimizeMode}optimizeFor\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.optimizeFor = 1;\n\n            /**\n             * FileOptions goPackage.\n             * @member {string}goPackage\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.goPackage = \"\";\n\n            /**\n             * FileOptions ccGenericServices.\n             * @member {boolean}ccGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.ccGenericServices = false;\n\n            /**\n             * FileOptions javaGenericServices.\n             * @member {boolean}javaGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaGenericServices = false;\n\n            /**\n             * FileOptions pyGenericServices.\n             * @member {boolean}pyGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.pyGenericServices = false;\n\n            /**\n             * FileOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.deprecated = false;\n\n            /**\n             * FileOptions ccEnableArenas.\n             * @member {boolean}ccEnableArenas\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.ccEnableArenas = false;\n\n            /**\n             * FileOptions objcClassPrefix.\n             * @member {string}objcClassPrefix\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.objcClassPrefix = \"\";\n\n            /**\n             * FileOptions csharpNamespace.\n             * @member {string}csharpNamespace\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.csharpNamespace = \"\";\n\n            /**\n             * FileOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new FileOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n             * @returns {google.protobuf.FileOptions} FileOptions instance\n             */\n            FileOptions.create = function create(properties) {\n                return new FileOptions(properties);\n            };\n\n            /**\n             * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);\n                if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);\n                if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);\n                if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);\n                if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n                    writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);\n                if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n                    writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);\n                if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n                    writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);\n                if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n                    writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);\n                if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n                    writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);\n                if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n                    writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);\n                if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n                    writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);\n                if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n                    writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);\n                if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n                    writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileOptions} FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.javaPackage = reader.string();\n                        break;\n                    case 8:\n                        message.javaOuterClassname = reader.string();\n                        break;\n                    case 10:\n                        message.javaMultipleFiles = reader.bool();\n                        break;\n                    case 20:\n                        message.javaGenerateEqualsAndHash = reader.bool();\n                        break;\n                    case 27:\n                        message.javaStringCheckUtf8 = reader.bool();\n                        break;\n                    case 9:\n                        message.optimizeFor = reader.int32();\n                        break;\n                    case 11:\n                        message.goPackage = reader.string();\n                        break;\n                    case 16:\n                        message.ccGenericServices = reader.bool();\n                        break;\n                    case 17:\n                        message.javaGenericServices = reader.bool();\n                        break;\n                    case 18:\n                        message.pyGenericServices = reader.bool();\n                        break;\n                    case 23:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 31:\n                        message.ccEnableArenas = reader.bool();\n                        break;\n                    case 36:\n                        message.objcClassPrefix = reader.string();\n                        break;\n                    case 37:\n                        message.csharpNamespace = reader.string();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileOptions} FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileOptions message.\n             * @function verify\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n                    if (!$util.isString(message.javaPackage))\n                        return \"javaPackage: string expected\";\n                if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n                    if (!$util.isString(message.javaOuterClassname))\n                        return \"javaOuterClassname: string expected\";\n                if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n                    if (typeof message.javaMultipleFiles !== \"boolean\")\n                        return \"javaMultipleFiles: boolean expected\";\n                if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n                    if (typeof message.javaGenerateEqualsAndHash !== \"boolean\")\n                        return \"javaGenerateEqualsAndHash: boolean expected\";\n                if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n                    if (typeof message.javaStringCheckUtf8 !== \"boolean\")\n                        return \"javaStringCheckUtf8: boolean expected\";\n                if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n                    switch (message.optimizeFor) {\n                    default:\n                        return \"optimizeFor: enum value expected\";\n                    case 1:\n                    case 2:\n                    case 3:\n                        break;\n                    }\n                if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n                    if (!$util.isString(message.goPackage))\n                        return \"goPackage: string expected\";\n                if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n                    if (typeof message.ccGenericServices !== \"boolean\")\n                        return \"ccGenericServices: boolean expected\";\n                if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n                    if (typeof message.javaGenericServices !== \"boolean\")\n                        return \"javaGenericServices: boolean expected\";\n                if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n                    if (typeof message.pyGenericServices !== \"boolean\")\n                        return \"pyGenericServices: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n                    if (typeof message.ccEnableArenas !== \"boolean\")\n                        return \"ccEnableArenas: boolean expected\";\n                if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n                    if (!$util.isString(message.objcClassPrefix))\n                        return \"objcClassPrefix: string expected\";\n                if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n                    if (!$util.isString(message.csharpNamespace))\n                        return \"csharpNamespace: string expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileOptions} FileOptions\n             */\n            FileOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileOptions)\n                    return object;\n                var message = new $root.google.protobuf.FileOptions();\n                if (object.javaPackage != null)\n                    message.javaPackage = String(object.javaPackage);\n                if (object.javaOuterClassname != null)\n                    message.javaOuterClassname = String(object.javaOuterClassname);\n                if (object.javaMultipleFiles != null)\n                    message.javaMultipleFiles = Boolean(object.javaMultipleFiles);\n                if (object.javaGenerateEqualsAndHash != null)\n                    message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);\n                if (object.javaStringCheckUtf8 != null)\n                    message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);\n                switch (object.optimizeFor) {\n                case \"SPEED\":\n                case 1:\n                    message.optimizeFor = 1;\n                    break;\n                case \"CODE_SIZE\":\n                case 2:\n                    message.optimizeFor = 2;\n                    break;\n                case \"LITE_RUNTIME\":\n                case 3:\n                    message.optimizeFor = 3;\n                    break;\n                }\n                if (object.goPackage != null)\n                    message.goPackage = String(object.goPackage);\n                if (object.ccGenericServices != null)\n                    message.ccGenericServices = Boolean(object.ccGenericServices);\n                if (object.javaGenericServices != null)\n                    message.javaGenericServices = Boolean(object.javaGenericServices);\n                if (object.pyGenericServices != null)\n                    message.pyGenericServices = Boolean(object.pyGenericServices);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.ccEnableArenas != null)\n                    message.ccEnableArenas = Boolean(object.ccEnableArenas);\n                if (object.objcClassPrefix != null)\n                    message.objcClassPrefix = String(object.objcClassPrefix);\n                if (object.csharpNamespace != null)\n                    message.csharpNamespace = String(object.csharpNamespace);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.FileOptions} message FileOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.javaPackage = \"\";\n                    object.javaOuterClassname = \"\";\n                    object.optimizeFor = options.enums === String ? \"SPEED\" : 1;\n                    object.javaMultipleFiles = false;\n                    object.goPackage = \"\";\n                    object.ccGenericServices = false;\n                    object.javaGenericServices = false;\n                    object.pyGenericServices = false;\n                    object.javaGenerateEqualsAndHash = false;\n                    object.deprecated = false;\n                    object.javaStringCheckUtf8 = false;\n                    object.ccEnableArenas = false;\n                    object.objcClassPrefix = \"\";\n                    object.csharpNamespace = \"\";\n                }\n                if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n                    object.javaPackage = message.javaPackage;\n                if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n                    object.javaOuterClassname = message.javaOuterClassname;\n                if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n                    object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;\n                if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n                    object.javaMultipleFiles = message.javaMultipleFiles;\n                if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n                    object.goPackage = message.goPackage;\n                if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n                    object.ccGenericServices = message.ccGenericServices;\n                if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n                    object.javaGenericServices = message.javaGenericServices;\n                if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n                    object.pyGenericServices = message.pyGenericServices;\n                if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n                    object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n                    object.javaStringCheckUtf8 = message.javaStringCheckUtf8;\n                if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n                    object.ccEnableArenas = message.ccEnableArenas;\n                if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n                    object.objcClassPrefix = message.objcClassPrefix;\n                if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n                    object.csharpNamespace = message.csharpNamespace;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FileOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * OptimizeMode enum.\n             * @enum {string}\n             * @property {number} SPEED=1 SPEED value\n             * @property {number} CODE_SIZE=2 CODE_SIZE value\n             * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value\n             */\n            FileOptions.OptimizeMode = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"SPEED\"] = 1;\n                values[valuesById[2] = \"CODE_SIZE\"] = 2;\n                values[valuesById[3] = \"LITE_RUNTIME\"] = 3;\n                return values;\n            })();\n\n            return FileOptions;\n        })();\n\n        protobuf.MessageOptions = (function() {\n\n            /**\n             * Properties of a MessageOptions.\n             * @memberof google.protobuf\n             * @interface IMessageOptions\n             * @property {boolean} [messageSetWireFormat] MessageOptions messageSetWireFormat\n             * @property {boolean} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor\n             * @property {boolean} [deprecated] MessageOptions deprecated\n             * @property {boolean} [mapEntry] MessageOptions mapEntry\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] MessageOptions uninterpretedOption\n             * @property {string} [\".interop.messageId\"] MessageOptions .interop.messageId\n             */\n\n            /**\n             * Constructs a new MessageOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a MessageOptions.\n             * @constructor\n             * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n             */\n            function MessageOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MessageOptions messageSetWireFormat.\n             * @member {boolean}messageSetWireFormat\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.messageSetWireFormat = false;\n\n            /**\n             * MessageOptions noStandardDescriptorAccessor.\n             * @member {boolean}noStandardDescriptorAccessor\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.noStandardDescriptorAccessor = false;\n\n            /**\n             * MessageOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.deprecated = false;\n\n            /**\n             * MessageOptions mapEntry.\n             * @member {boolean}mapEntry\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.mapEntry = false;\n\n            /**\n             * MessageOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * MessageOptions .interop.messageId.\n             * @member {string}.interop.messageId\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype[\".interop.messageId\"] = \"\";\n\n            /**\n             * Creates a new MessageOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n             * @returns {google.protobuf.MessageOptions} MessageOptions instance\n             */\n            MessageOptions.create = function create(properties) {\n                return new MessageOptions(properties);\n            };\n\n            /**\n             * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MessageOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);\n                if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n                    writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                if (message[\".interop.messageId\"] != null && message.hasOwnProperty(\".interop.messageId\"))\n                    writer.uint32(/* id 9650, wireType 2 =*/77202).string(message[\".interop.messageId\"]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MessageOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.messageSetWireFormat = reader.bool();\n                        break;\n                    case 2:\n                        message.noStandardDescriptorAccessor = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 7:\n                        message.mapEntry = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    case 9650:\n                        message[\".interop.messageId\"] = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MessageOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MessageOptions message.\n             * @function verify\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MessageOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n                    if (typeof message.messageSetWireFormat !== \"boolean\")\n                        return \"messageSetWireFormat: boolean expected\";\n                if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n                    if (typeof message.noStandardDescriptorAccessor !== \"boolean\")\n                        return \"noStandardDescriptorAccessor: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n                    if (typeof message.mapEntry !== \"boolean\")\n                        return \"mapEntry: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                if (message[\".interop.messageId\"] != null && message.hasOwnProperty(\".interop.messageId\"))\n                    if (!$util.isString(message[\".interop.messageId\"]))\n                        return \".interop.messageId: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             */\n            MessageOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MessageOptions)\n                    return object;\n                var message = new $root.google.protobuf.MessageOptions();\n                if (object.messageSetWireFormat != null)\n                    message.messageSetWireFormat = Boolean(object.messageSetWireFormat);\n                if (object.noStandardDescriptorAccessor != null)\n                    message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.mapEntry != null)\n                    message.mapEntry = Boolean(object.mapEntry);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                if (object[\".interop.messageId\"] != null)\n                    message[\".interop.messageId\"] = String(object[\".interop.messageId\"]);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.MessageOptions} message MessageOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MessageOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.messageSetWireFormat = false;\n                    object.noStandardDescriptorAccessor = false;\n                    object.deprecated = false;\n                    object.mapEntry = false;\n                    object[\".interop.messageId\"] = \"\";\n                }\n                if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n                    object.messageSetWireFormat = message.messageSetWireFormat;\n                if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n                    object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n                    object.mapEntry = message.mapEntry;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                if (message[\".interop.messageId\"] != null && message.hasOwnProperty(\".interop.messageId\"))\n                    object[\".interop.messageId\"] = message[\".interop.messageId\"];\n                return object;\n            };\n\n            /**\n             * Converts this MessageOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MessageOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return MessageOptions;\n        })();\n\n        protobuf.FieldOptions = (function() {\n\n            /**\n             * Properties of a FieldOptions.\n             * @memberof google.protobuf\n             * @interface IFieldOptions\n             * @property {google.protobuf.FieldOptions.CType} [ctype] FieldOptions ctype\n             * @property {boolean} [packed] FieldOptions packed\n             * @property {google.protobuf.FieldOptions.JSType} [jstype] FieldOptions jstype\n             * @property {boolean} [lazy] FieldOptions lazy\n             * @property {boolean} [deprecated] FieldOptions deprecated\n             * @property {boolean} [weak] FieldOptions weak\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] FieldOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new FieldOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a FieldOptions.\n             * @constructor\n             * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n             */\n            function FieldOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FieldOptions ctype.\n             * @member {google.protobuf.FieldOptions.CType}ctype\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.ctype = 0;\n\n            /**\n             * FieldOptions packed.\n             * @member {boolean}packed\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.packed = false;\n\n            /**\n             * FieldOptions jstype.\n             * @member {google.protobuf.FieldOptions.JSType}jstype\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.jstype = 0;\n\n            /**\n             * FieldOptions lazy.\n             * @member {boolean}lazy\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.lazy = false;\n\n            /**\n             * FieldOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.deprecated = false;\n\n            /**\n             * FieldOptions weak.\n             * @member {boolean}weak\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.weak = false;\n\n            /**\n             * FieldOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new FieldOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n             * @returns {google.protobuf.FieldOptions} FieldOptions instance\n             */\n            FieldOptions.create = function create(properties) {\n                return new FieldOptions(properties);\n            };\n\n            /**\n             * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);\n                if (message.packed != null && message.hasOwnProperty(\"packed\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);\n                if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n                    writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);\n                if (message.weak != null && message.hasOwnProperty(\"weak\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.ctype = reader.int32();\n                        break;\n                    case 2:\n                        message.packed = reader.bool();\n                        break;\n                    case 6:\n                        message.jstype = reader.int32();\n                        break;\n                    case 5:\n                        message.lazy = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 10:\n                        message.weak = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FieldOptions message.\n             * @function verify\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FieldOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n                    switch (message.ctype) {\n                    default:\n                        return \"ctype: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                if (message.packed != null && message.hasOwnProperty(\"packed\"))\n                    if (typeof message.packed !== \"boolean\")\n                        return \"packed: boolean expected\";\n                if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n                    switch (message.jstype) {\n                    default:\n                        return \"jstype: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n                    if (typeof message.lazy !== \"boolean\")\n                        return \"lazy: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.weak != null && message.hasOwnProperty(\"weak\"))\n                    if (typeof message.weak !== \"boolean\")\n                        return \"weak: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             */\n            FieldOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FieldOptions)\n                    return object;\n                var message = new $root.google.protobuf.FieldOptions();\n                switch (object.ctype) {\n                case \"STRING\":\n                case 0:\n                    message.ctype = 0;\n                    break;\n                case \"CORD\":\n                case 1:\n                    message.ctype = 1;\n                    break;\n                case \"STRING_PIECE\":\n                case 2:\n                    message.ctype = 2;\n                    break;\n                }\n                if (object.packed != null)\n                    message.packed = Boolean(object.packed);\n                switch (object.jstype) {\n                case \"JS_NORMAL\":\n                case 0:\n                    message.jstype = 0;\n                    break;\n                case \"JS_STRING\":\n                case 1:\n                    message.jstype = 1;\n                    break;\n                case \"JS_NUMBER\":\n                case 2:\n                    message.jstype = 2;\n                    break;\n                }\n                if (object.lazy != null)\n                    message.lazy = Boolean(object.lazy);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.weak != null)\n                    message.weak = Boolean(object.weak);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.FieldOptions} message FieldOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FieldOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.ctype = options.enums === String ? \"STRING\" : 0;\n                    object.packed = false;\n                    object.deprecated = false;\n                    object.lazy = false;\n                    object.jstype = options.enums === String ? \"JS_NORMAL\" : 0;\n                    object.weak = false;\n                }\n                if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n                    object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;\n                if (message.packed != null && message.hasOwnProperty(\"packed\"))\n                    object.packed = message.packed;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n                    object.lazy = message.lazy;\n                if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n                    object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;\n                if (message.weak != null && message.hasOwnProperty(\"weak\"))\n                    object.weak = message.weak;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FieldOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FieldOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * CType enum.\n             * @enum {string}\n             * @property {number} STRING=0 STRING value\n             * @property {number} CORD=1 CORD value\n             * @property {number} STRING_PIECE=2 STRING_PIECE value\n             */\n            FieldOptions.CType = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[0] = \"STRING\"] = 0;\n                values[valuesById[1] = \"CORD\"] = 1;\n                values[valuesById[2] = \"STRING_PIECE\"] = 2;\n                return values;\n            })();\n\n            /**\n             * JSType enum.\n             * @enum {string}\n             * @property {number} JS_NORMAL=0 JS_NORMAL value\n             * @property {number} JS_STRING=1 JS_STRING value\n             * @property {number} JS_NUMBER=2 JS_NUMBER value\n             */\n            FieldOptions.JSType = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[0] = \"JS_NORMAL\"] = 0;\n                values[valuesById[1] = \"JS_STRING\"] = 1;\n                values[valuesById[2] = \"JS_NUMBER\"] = 2;\n                return values;\n            })();\n\n            return FieldOptions;\n        })();\n\n        protobuf.OneofOptions = (function() {\n\n            /**\n             * Properties of an OneofOptions.\n             * @memberof google.protobuf\n             * @interface IOneofOptions\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] OneofOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new OneofOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an OneofOptions.\n             * @constructor\n             * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n             */\n            function OneofOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * OneofOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.OneofOptions\n             * @instance\n             */\n            OneofOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new OneofOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n             * @returns {google.protobuf.OneofOptions} OneofOptions instance\n             */\n            OneofOptions.create = function create(properties) {\n                return new OneofOptions(properties);\n            };\n\n            /**\n             * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OneofOptions message.\n             * @function verify\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OneofOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             */\n            OneofOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.OneofOptions)\n                    return object;\n                var message = new $root.google.protobuf.OneofOptions();\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.OneofOptions} message OneofOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OneofOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this OneofOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.OneofOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OneofOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return OneofOptions;\n        })();\n\n        protobuf.EnumOptions = (function() {\n\n            /**\n             * Properties of an EnumOptions.\n             * @memberof google.protobuf\n             * @interface IEnumOptions\n             * @property {boolean} [allowAlias] EnumOptions allowAlias\n             * @property {boolean} [deprecated] EnumOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] EnumOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new EnumOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumOptions.\n             * @constructor\n             * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n             */\n            function EnumOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumOptions allowAlias.\n             * @member {boolean}allowAlias\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.allowAlias = false;\n\n            /**\n             * EnumOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.deprecated = false;\n\n            /**\n             * EnumOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new EnumOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n             * @returns {google.protobuf.EnumOptions} EnumOptions instance\n             */\n            EnumOptions.create = function create(properties) {\n                return new EnumOptions(properties);\n            };\n\n            /**\n             * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 2:\n                        message.allowAlias = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumOptions message.\n             * @function verify\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n                    if (typeof message.allowAlias !== \"boolean\")\n                        return \"allowAlias: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             */\n            EnumOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumOptions)\n                    return object;\n                var message = new $root.google.protobuf.EnumOptions();\n                if (object.allowAlias != null)\n                    message.allowAlias = Boolean(object.allowAlias);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.EnumOptions} message EnumOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.allowAlias = false;\n                    object.deprecated = false;\n                }\n                if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n                    object.allowAlias = message.allowAlias;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this EnumOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return EnumOptions;\n        })();\n\n        protobuf.EnumValueOptions = (function() {\n\n            /**\n             * Properties of an EnumValueOptions.\n             * @memberof google.protobuf\n             * @interface IEnumValueOptions\n             * @property {boolean} [deprecated] EnumValueOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] EnumValueOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new EnumValueOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumValueOptions.\n             * @constructor\n             * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n             */\n            function EnumValueOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumValueOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             */\n            EnumValueOptions.prototype.deprecated = false;\n\n            /**\n             * EnumValueOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             */\n            EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new EnumValueOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance\n             */\n            EnumValueOptions.create = function create(properties) {\n                return new EnumValueOptions(properties);\n            };\n\n            /**\n             * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumValueOptions message.\n             * @function verify\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumValueOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             */\n            EnumValueOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumValueOptions)\n                    return object;\n                var message = new $root.google.protobuf.EnumValueOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.EnumValueOptions} message EnumValueOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumValueOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults)\n                    object.deprecated = false;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this EnumValueOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumValueOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return EnumValueOptions;\n        })();\n\n        protobuf.ServiceOptions = (function() {\n\n            /**\n             * Properties of a ServiceOptions.\n             * @memberof google.protobuf\n             * @interface IServiceOptions\n             * @property {boolean} [deprecated] ServiceOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] ServiceOptions uninterpretedOption\n             * @property {string} [\".interop.serviceId\"] ServiceOptions .interop.serviceId\n             */\n\n            /**\n             * Constructs a new ServiceOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a ServiceOptions.\n             * @constructor\n             * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n             */\n            function ServiceOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * ServiceOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             */\n            ServiceOptions.prototype.deprecated = false;\n\n            /**\n             * ServiceOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             */\n            ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * ServiceOptions .interop.serviceId.\n             * @member {string}.interop.serviceId\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             */\n            ServiceOptions.prototype[\".interop.serviceId\"] = \"\";\n\n            /**\n             * Creates a new ServiceOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions instance\n             */\n            ServiceOptions.create = function create(properties) {\n                return new ServiceOptions(properties);\n            };\n\n            /**\n             * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                if (message[\".interop.serviceId\"] != null && message.hasOwnProperty(\".interop.serviceId\"))\n                    writer.uint32(/* id 9651, wireType 2 =*/77210).string(message[\".interop.serviceId\"]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 33:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    case 9651:\n                        message[\".interop.serviceId\"] = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a ServiceOptions message.\n             * @function verify\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            ServiceOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                if (message[\".interop.serviceId\"] != null && message.hasOwnProperty(\".interop.serviceId\"))\n                    if (!$util.isString(message[\".interop.serviceId\"]))\n                        return \".interop.serviceId: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             */\n            ServiceOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.ServiceOptions)\n                    return object;\n                var message = new $root.google.protobuf.ServiceOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                if (object[\".interop.serviceId\"] != null)\n                    message[\".interop.serviceId\"] = String(object[\".interop.serviceId\"]);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.ServiceOptions} message ServiceOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            ServiceOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.deprecated = false;\n                    object[\".interop.serviceId\"] = \"\";\n                }\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                if (message[\".interop.serviceId\"] != null && message.hasOwnProperty(\".interop.serviceId\"))\n                    object[\".interop.serviceId\"] = message[\".interop.serviceId\"];\n                return object;\n            };\n\n            /**\n             * Converts this ServiceOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            ServiceOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return ServiceOptions;\n        })();\n\n        protobuf.MethodOptions = (function() {\n\n            /**\n             * Properties of a MethodOptions.\n             * @memberof google.protobuf\n             * @interface IMethodOptions\n             * @property {boolean} [deprecated] MethodOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>} [uninterpretedOption] MethodOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new MethodOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a MethodOptions.\n             * @constructor\n             * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n             */\n            function MethodOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MethodOptions deprecated.\n             * @member {boolean}deprecated\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             */\n            MethodOptions.prototype.deprecated = false;\n\n            /**\n             * MethodOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>}uninterpretedOption\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             */\n            MethodOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new MethodOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n             * @returns {google.protobuf.MethodOptions} MethodOptions instance\n             */\n            MethodOptions.create = function create(properties) {\n                return new MethodOptions(properties);\n            };\n\n            /**\n             * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 33:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MethodOptions message.\n             * @function verify\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MethodOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             */\n            MethodOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MethodOptions)\n                    return object;\n                var message = new $root.google.protobuf.MethodOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.MethodOptions} message MethodOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MethodOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults)\n                    object.deprecated = false;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this MethodOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MethodOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return MethodOptions;\n        })();\n\n        protobuf.UninterpretedOption = (function() {\n\n            /**\n             * Properties of an UninterpretedOption.\n             * @memberof google.protobuf\n             * @interface IUninterpretedOption\n             * @property {Array.<google.protobuf.UninterpretedOption.INamePart>} [name] UninterpretedOption name\n             * @property {string} [identifierValue] UninterpretedOption identifierValue\n             * @property {Long} [positiveIntValue] UninterpretedOption positiveIntValue\n             * @property {Long} [negativeIntValue] UninterpretedOption negativeIntValue\n             * @property {number} [doubleValue] UninterpretedOption doubleValue\n             * @property {Uint8Array} [stringValue] UninterpretedOption stringValue\n             * @property {string} [aggregateValue] UninterpretedOption aggregateValue\n             */\n\n            /**\n             * Constructs a new UninterpretedOption.\n             * @memberof google.protobuf\n             * @classdesc Represents an UninterpretedOption.\n             * @constructor\n             * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n             */\n            function UninterpretedOption(properties) {\n                this.name = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * UninterpretedOption name.\n             * @member {Array.<google.protobuf.UninterpretedOption.INamePart>}name\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.name = $util.emptyArray;\n\n            /**\n             * UninterpretedOption identifierValue.\n             * @member {string}identifierValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.identifierValue = \"\";\n\n            /**\n             * UninterpretedOption positiveIntValue.\n             * @member {Long}positiveIntValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n            /**\n             * UninterpretedOption negativeIntValue.\n             * @member {Long}negativeIntValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n            /**\n             * UninterpretedOption doubleValue.\n             * @member {number}doubleValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.doubleValue = 0;\n\n            /**\n             * UninterpretedOption stringValue.\n             * @member {Uint8Array}stringValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.stringValue = $util.newBuffer([]);\n\n            /**\n             * UninterpretedOption aggregateValue.\n             * @member {string}aggregateValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.aggregateValue = \"\";\n\n            /**\n             * Creates a new UninterpretedOption instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance\n             */\n            UninterpretedOption.create = function create(properties) {\n                return new UninterpretedOption(properties);\n            };\n\n            /**\n             * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            UninterpretedOption.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.name.length)\n                    for (var i = 0; i < message.name.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);\n                if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);\n                if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);\n                if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            UninterpretedOption.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 2:\n                        if (!(message.name && message.name.length))\n                            message.name = [];\n                        message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.identifierValue = reader.string();\n                        break;\n                    case 4:\n                        message.positiveIntValue = reader.uint64();\n                        break;\n                    case 5:\n                        message.negativeIntValue = reader.int64();\n                        break;\n                    case 6:\n                        message.doubleValue = reader.double();\n                        break;\n                    case 7:\n                        message.stringValue = reader.bytes();\n                        break;\n                    case 8:\n                        message.aggregateValue = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an UninterpretedOption message.\n             * @function verify\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            UninterpretedOption.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\")) {\n                    if (!Array.isArray(message.name))\n                        return \"name: array expected\";\n                    for (var i = 0; i < message.name.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);\n                        if (error)\n                            return \"name.\" + error;\n                    }\n                }\n                if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n                    if (!$util.isString(message.identifierValue))\n                        return \"identifierValue: string expected\";\n                if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n                    if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))\n                        return \"positiveIntValue: integer|Long expected\";\n                if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n                    if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))\n                        return \"negativeIntValue: integer|Long expected\";\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    if (typeof message.doubleValue !== \"number\")\n                        return \"doubleValue: number expected\";\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    if (!(message.stringValue && typeof message.stringValue.length === \"number\" || $util.isString(message.stringValue)))\n                        return \"stringValue: buffer expected\";\n                if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n                    if (!$util.isString(message.aggregateValue))\n                        return \"aggregateValue: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             */\n            UninterpretedOption.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.UninterpretedOption)\n                    return object;\n                var message = new $root.google.protobuf.UninterpretedOption();\n                if (object.name) {\n                    if (!Array.isArray(object.name))\n                        throw TypeError(\".google.protobuf.UninterpretedOption.name: array expected\");\n                    message.name = [];\n                    for (var i = 0; i < object.name.length; ++i) {\n                        if (typeof object.name[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.UninterpretedOption.name: object expected\");\n                        message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);\n                    }\n                }\n                if (object.identifierValue != null)\n                    message.identifierValue = String(object.identifierValue);\n                if (object.positiveIntValue != null)\n                    if ($util.Long)\n                        (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;\n                    else if (typeof object.positiveIntValue === \"string\")\n                        message.positiveIntValue = parseInt(object.positiveIntValue, 10);\n                    else if (typeof object.positiveIntValue === \"number\")\n                        message.positiveIntValue = object.positiveIntValue;\n                    else if (typeof object.positiveIntValue === \"object\")\n                        message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);\n                if (object.negativeIntValue != null)\n                    if ($util.Long)\n                        (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;\n                    else if (typeof object.negativeIntValue === \"string\")\n                        message.negativeIntValue = parseInt(object.negativeIntValue, 10);\n                    else if (typeof object.negativeIntValue === \"number\")\n                        message.negativeIntValue = object.negativeIntValue;\n                    else if (typeof object.negativeIntValue === \"object\")\n                        message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();\n                if (object.doubleValue != null)\n                    message.doubleValue = Number(object.doubleValue);\n                if (object.stringValue != null)\n                    if (typeof object.stringValue === \"string\")\n                        $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);\n                    else if (object.stringValue.length)\n                        message.stringValue = object.stringValue;\n                if (object.aggregateValue != null)\n                    message.aggregateValue = String(object.aggregateValue);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.UninterpretedOption} message UninterpretedOption\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            UninterpretedOption.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.name = [];\n                if (options.defaults) {\n                    object.identifierValue = \"\";\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, true);\n                        object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.positiveIntValue = options.longs === String ? \"0\" : 0;\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, false);\n                        object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.negativeIntValue = options.longs === String ? \"0\" : 0;\n                    object.doubleValue = 0;\n                    object.stringValue = options.bytes === String ? \"\" : [];\n                    object.aggregateValue = \"\";\n                }\n                if (message.name && message.name.length) {\n                    object.name = [];\n                    for (var j = 0; j < message.name.length; ++j)\n                        object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);\n                }\n                if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n                    object.identifierValue = message.identifierValue;\n                if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n                    if (typeof message.positiveIntValue === \"number\")\n                        object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;\n                    else\n                        object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue;\n                if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n                    if (typeof message.negativeIntValue === \"number\")\n                        object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;\n                    else\n                        object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue;\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue;\n                if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n                    object.aggregateValue = message.aggregateValue;\n                return object;\n            };\n\n            /**\n             * Converts this UninterpretedOption to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            UninterpretedOption.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            UninterpretedOption.NamePart = (function() {\n\n                /**\n                 * Properties of a NamePart.\n                 * @memberof google.protobuf.UninterpretedOption\n                 * @interface INamePart\n                 * @property {string} namePart NamePart namePart\n                 * @property {boolean} isExtension NamePart isExtension\n                 */\n\n                /**\n                 * Constructs a new NamePart.\n                 * @memberof google.protobuf.UninterpretedOption\n                 * @classdesc Represents a NamePart.\n                 * @constructor\n                 * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n                 */\n                function NamePart(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * NamePart namePart.\n                 * @member {string}namePart\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 */\n                NamePart.prototype.namePart = \"\";\n\n                /**\n                 * NamePart isExtension.\n                 * @member {boolean}isExtension\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 */\n                NamePart.prototype.isExtension = false;\n\n                /**\n                 * Creates a new NamePart instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance\n                 */\n                NamePart.create = function create(properties) {\n                    return new NamePart(properties);\n                };\n\n                /**\n                 * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                NamePart.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                NamePart.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                NamePart.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.namePart = reader.string();\n                            break;\n                        case 2:\n                            message.isExtension = reader.bool();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"namePart\"))\n                        throw $util.ProtocolError(\"missing required 'namePart'\", { instance: message });\n                    if (!message.hasOwnProperty(\"isExtension\"))\n                        throw $util.ProtocolError(\"missing required 'isExtension'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                NamePart.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a NamePart message.\n                 * @function verify\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                NamePart.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isString(message.namePart))\n                        return \"namePart: string expected\";\n                    if (typeof message.isExtension !== \"boolean\")\n                        return \"isExtension: boolean expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a NamePart message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 */\n                NamePart.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)\n                        return object;\n                    var message = new $root.google.protobuf.UninterpretedOption.NamePart();\n                    if (object.namePart != null)\n                        message.namePart = String(object.namePart);\n                    if (object.isExtension != null)\n                        message.isExtension = Boolean(object.isExtension);\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a NamePart message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                NamePart.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.namePart = \"\";\n                        object.isExtension = false;\n                    }\n                    if (message.namePart != null && message.hasOwnProperty(\"namePart\"))\n                        object.namePart = message.namePart;\n                    if (message.isExtension != null && message.hasOwnProperty(\"isExtension\"))\n                        object.isExtension = message.isExtension;\n                    return object;\n                };\n\n                /**\n                 * Converts this NamePart to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                NamePart.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                return NamePart;\n            })();\n\n            return UninterpretedOption;\n        })();\n\n        protobuf.SourceCodeInfo = (function() {\n\n            /**\n             * Properties of a SourceCodeInfo.\n             * @memberof google.protobuf\n             * @interface ISourceCodeInfo\n             * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>} [location] SourceCodeInfo location\n             */\n\n            /**\n             * Constructs a new SourceCodeInfo.\n             * @memberof google.protobuf\n             * @classdesc Represents a SourceCodeInfo.\n             * @constructor\n             * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n             */\n            function SourceCodeInfo(properties) {\n                this.location = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * SourceCodeInfo location.\n             * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>}location\n             * @memberof google.protobuf.SourceCodeInfo\n             * @instance\n             */\n            SourceCodeInfo.prototype.location = $util.emptyArray;\n\n            /**\n             * Creates a new SourceCodeInfo instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance\n             */\n            SourceCodeInfo.create = function create(properties) {\n                return new SourceCodeInfo(properties);\n            };\n\n            /**\n             * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SourceCodeInfo.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.location != null && message.location.length)\n                    for (var i = 0; i < message.location.length; ++i)\n                        $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SourceCodeInfo.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.location && message.location.length))\n                            message.location = [];\n                        message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a SourceCodeInfo message.\n             * @function verify\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            SourceCodeInfo.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.location != null && message.hasOwnProperty(\"location\")) {\n                    if (!Array.isArray(message.location))\n                        return \"location: array expected\";\n                    for (var i = 0; i < message.location.length; ++i) {\n                        var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);\n                        if (error)\n                            return \"location.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             */\n            SourceCodeInfo.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.SourceCodeInfo)\n                    return object;\n                var message = new $root.google.protobuf.SourceCodeInfo();\n                if (object.location) {\n                    if (!Array.isArray(object.location))\n                        throw TypeError(\".google.protobuf.SourceCodeInfo.location: array expected\");\n                    message.location = [];\n                    for (var i = 0; i < object.location.length; ++i) {\n                        if (typeof object.location[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.location: object expected\");\n                        message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            SourceCodeInfo.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.location = [];\n                if (message.location && message.location.length) {\n                    object.location = [];\n                    for (var j = 0; j < message.location.length; ++j)\n                        object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this SourceCodeInfo to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.SourceCodeInfo\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            SourceCodeInfo.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            SourceCodeInfo.Location = (function() {\n\n                /**\n                 * Properties of a Location.\n                 * @memberof google.protobuf.SourceCodeInfo\n                 * @interface ILocation\n                 * @property {Array.<number>} [path] Location path\n                 * @property {Array.<number>} [span] Location span\n                 * @property {string} [leadingComments] Location leadingComments\n                 * @property {string} [trailingComments] Location trailingComments\n                 * @property {Array.<string>} [leadingDetachedComments] Location leadingDetachedComments\n                 */\n\n                /**\n                 * Constructs a new Location.\n                 * @memberof google.protobuf.SourceCodeInfo\n                 * @classdesc Represents a Location.\n                 * @constructor\n                 * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n                 */\n                function Location(properties) {\n                    this.path = [];\n                    this.span = [];\n                    this.leadingDetachedComments = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Location path.\n                 * @member {Array.<number>}path\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.path = $util.emptyArray;\n\n                /**\n                 * Location span.\n                 * @member {Array.<number>}span\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.span = $util.emptyArray;\n\n                /**\n                 * Location leadingComments.\n                 * @member {string}leadingComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.leadingComments = \"\";\n\n                /**\n                 * Location trailingComments.\n                 * @member {string}trailingComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.trailingComments = \"\";\n\n                /**\n                 * Location leadingDetachedComments.\n                 * @member {Array.<string>}leadingDetachedComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.leadingDetachedComments = $util.emptyArray;\n\n                /**\n                 * Creates a new Location instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location instance\n                 */\n                Location.create = function create(properties) {\n                    return new Location(properties);\n                };\n\n                /**\n                 * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Location.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.path != null && message.path.length) {\n                        writer.uint32(/* id 1, wireType 2 =*/10).fork();\n                        for (var i = 0; i < message.path.length; ++i)\n                            writer.int32(message.path[i]);\n                        writer.ldelim();\n                    }\n                    if (message.span != null && message.span.length) {\n                        writer.uint32(/* id 2, wireType 2 =*/18).fork();\n                        for (var i = 0; i < message.span.length; ++i)\n                            writer.int32(message.span[i]);\n                        writer.ldelim();\n                    }\n                    if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);\n                    if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n                        writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);\n                    if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)\n                        for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n                            writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Location.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Location.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            if (!(message.path && message.path.length))\n                                message.path = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.path.push(reader.int32());\n                            } else\n                                message.path.push(reader.int32());\n                            break;\n                        case 2:\n                            if (!(message.span && message.span.length))\n                                message.span = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.span.push(reader.int32());\n                            } else\n                                message.span.push(reader.int32());\n                            break;\n                        case 3:\n                            message.leadingComments = reader.string();\n                            break;\n                        case 4:\n                            message.trailingComments = reader.string();\n                            break;\n                        case 6:\n                            if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))\n                                message.leadingDetachedComments = [];\n                            message.leadingDetachedComments.push(reader.string());\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Location.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Location message.\n                 * @function verify\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Location.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.path != null && message.hasOwnProperty(\"path\")) {\n                        if (!Array.isArray(message.path))\n                            return \"path: array expected\";\n                        for (var i = 0; i < message.path.length; ++i)\n                            if (!$util.isInteger(message.path[i]))\n                                return \"path: integer[] expected\";\n                    }\n                    if (message.span != null && message.hasOwnProperty(\"span\")) {\n                        if (!Array.isArray(message.span))\n                            return \"span: array expected\";\n                        for (var i = 0; i < message.span.length; ++i)\n                            if (!$util.isInteger(message.span[i]))\n                                return \"span: integer[] expected\";\n                    }\n                    if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n                        if (!$util.isString(message.leadingComments))\n                            return \"leadingComments: string expected\";\n                    if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n                        if (!$util.isString(message.trailingComments))\n                            return \"trailingComments: string expected\";\n                    if (message.leadingDetachedComments != null && message.hasOwnProperty(\"leadingDetachedComments\")) {\n                        if (!Array.isArray(message.leadingDetachedComments))\n                            return \"leadingDetachedComments: array expected\";\n                        for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n                            if (!$util.isString(message.leadingDetachedComments[i]))\n                                return \"leadingDetachedComments: string[] expected\";\n                    }\n                    return null;\n                };\n\n                /**\n                 * Creates a Location message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 */\n                Location.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)\n                        return object;\n                    var message = new $root.google.protobuf.SourceCodeInfo.Location();\n                    if (object.path) {\n                        if (!Array.isArray(object.path))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.path: array expected\");\n                        message.path = [];\n                        for (var i = 0; i < object.path.length; ++i)\n                            message.path[i] = object.path[i] | 0;\n                    }\n                    if (object.span) {\n                        if (!Array.isArray(object.span))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.span: array expected\");\n                        message.span = [];\n                        for (var i = 0; i < object.span.length; ++i)\n                            message.span[i] = object.span[i] | 0;\n                    }\n                    if (object.leadingComments != null)\n                        message.leadingComments = String(object.leadingComments);\n                    if (object.trailingComments != null)\n                        message.trailingComments = String(object.trailingComments);\n                    if (object.leadingDetachedComments) {\n                        if (!Array.isArray(object.leadingDetachedComments))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected\");\n                        message.leadingDetachedComments = [];\n                        for (var i = 0; i < object.leadingDetachedComments.length; ++i)\n                            message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);\n                    }\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a Location message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.Location} message Location\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Location.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults) {\n                        object.path = [];\n                        object.span = [];\n                        object.leadingDetachedComments = [];\n                    }\n                    if (options.defaults) {\n                        object.leadingComments = \"\";\n                        object.trailingComments = \"\";\n                    }\n                    if (message.path && message.path.length) {\n                        object.path = [];\n                        for (var j = 0; j < message.path.length; ++j)\n                            object.path[j] = message.path[j];\n                    }\n                    if (message.span && message.span.length) {\n                        object.span = [];\n                        for (var j = 0; j < message.span.length; ++j)\n                            object.span[j] = message.span[j];\n                    }\n                    if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n                        object.leadingComments = message.leadingComments;\n                    if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n                        object.trailingComments = message.trailingComments;\n                    if (message.leadingDetachedComments && message.leadingDetachedComments.length) {\n                        object.leadingDetachedComments = [];\n                        for (var j = 0; j < message.leadingDetachedComments.length; ++j)\n                            object.leadingDetachedComments[j] = message.leadingDetachedComments[j];\n                    }\n                    return object;\n                };\n\n                /**\n                 * Converts this Location to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Location.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                return Location;\n            })();\n\n            return SourceCodeInfo;\n        })();\n\n        protobuf.GeneratedCodeInfo = (function() {\n\n            /**\n             * Properties of a GeneratedCodeInfo.\n             * @memberof google.protobuf\n             * @interface IGeneratedCodeInfo\n             * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} [annotation] GeneratedCodeInfo annotation\n             */\n\n            /**\n             * Constructs a new GeneratedCodeInfo.\n             * @memberof google.protobuf\n             * @classdesc Represents a GeneratedCodeInfo.\n             * @constructor\n             * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n             */\n            function GeneratedCodeInfo(properties) {\n                this.annotation = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GeneratedCodeInfo annotation.\n             * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>}annotation\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @instance\n             */\n            GeneratedCodeInfo.prototype.annotation = $util.emptyArray;\n\n            /**\n             * Creates a new GeneratedCodeInfo instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance\n             */\n            GeneratedCodeInfo.create = function create(properties) {\n                return new GeneratedCodeInfo(properties);\n            };\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GeneratedCodeInfo.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.annotation != null && message.annotation.length)\n                    for (var i = 0; i < message.annotation.length; ++i)\n                        $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GeneratedCodeInfo.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.annotation && message.annotation.length))\n                            message.annotation = [];\n                        message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a GeneratedCodeInfo message.\n             * @function verify\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GeneratedCodeInfo.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.annotation != null && message.hasOwnProperty(\"annotation\")) {\n                    if (!Array.isArray(message.annotation))\n                        return \"annotation: array expected\";\n                    for (var i = 0; i < message.annotation.length; ++i) {\n                        var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);\n                        if (error)\n                            return \"annotation.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             */\n            GeneratedCodeInfo.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.GeneratedCodeInfo)\n                    return object;\n                var message = new $root.google.protobuf.GeneratedCodeInfo();\n                if (object.annotation) {\n                    if (!Array.isArray(object.annotation))\n                        throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: array expected\");\n                    message.annotation = [];\n                    for (var i = 0; i < object.annotation.length; ++i) {\n                        if (typeof object.annotation[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: object expected\");\n                        message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GeneratedCodeInfo.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.annotation = [];\n                if (message.annotation && message.annotation.length) {\n                    object.annotation = [];\n                    for (var j = 0; j < message.annotation.length; ++j)\n                        object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this GeneratedCodeInfo to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GeneratedCodeInfo.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            GeneratedCodeInfo.Annotation = (function() {\n\n                /**\n                 * Properties of an Annotation.\n                 * @memberof google.protobuf.GeneratedCodeInfo\n                 * @interface IAnnotation\n                 * @property {Array.<number>} [path] Annotation path\n                 * @property {string} [sourceFile] Annotation sourceFile\n                 * @property {number} [begin] Annotation begin\n                 * @property {number} [end] Annotation end\n                 */\n\n                /**\n                 * Constructs a new Annotation.\n                 * @memberof google.protobuf.GeneratedCodeInfo\n                 * @classdesc Represents an Annotation.\n                 * @constructor\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n                 */\n                function Annotation(properties) {\n                    this.path = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Annotation path.\n                 * @member {Array.<number>}path\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.path = $util.emptyArray;\n\n                /**\n                 * Annotation sourceFile.\n                 * @member {string}sourceFile\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.sourceFile = \"\";\n\n                /**\n                 * Annotation begin.\n                 * @member {number}begin\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.begin = 0;\n\n                /**\n                 * Annotation end.\n                 * @member {number}end\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.end = 0;\n\n                /**\n                 * Creates a new Annotation instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance\n                 */\n                Annotation.create = function create(properties) {\n                    return new Annotation(properties);\n                };\n\n                /**\n                 * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Annotation.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.path != null && message.path.length) {\n                        writer.uint32(/* id 1, wireType 2 =*/10).fork();\n                        for (var i = 0; i < message.path.length; ++i)\n                            writer.int32(message.path[i]);\n                        writer.ldelim();\n                    }\n                    if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);\n                    if (message.begin != null && message.hasOwnProperty(\"begin\"))\n                        writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Annotation.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Annotation.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            if (!(message.path && message.path.length))\n                                message.path = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.path.push(reader.int32());\n                            } else\n                                message.path.push(reader.int32());\n                            break;\n                        case 2:\n                            message.sourceFile = reader.string();\n                            break;\n                        case 3:\n                            message.begin = reader.int32();\n                            break;\n                        case 4:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Annotation.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies an Annotation message.\n                 * @function verify\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Annotation.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.path != null && message.hasOwnProperty(\"path\")) {\n                        if (!Array.isArray(message.path))\n                            return \"path: array expected\";\n                        for (var i = 0; i < message.path.length; ++i)\n                            if (!$util.isInteger(message.path[i]))\n                                return \"path: integer[] expected\";\n                    }\n                    if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n                        if (!$util.isString(message.sourceFile))\n                            return \"sourceFile: string expected\";\n                    if (message.begin != null && message.hasOwnProperty(\"begin\"))\n                        if (!$util.isInteger(message.begin))\n                            return \"begin: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates an Annotation message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 */\n                Annotation.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)\n                        return object;\n                    var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n                    if (object.path) {\n                        if (!Array.isArray(object.path))\n                            throw TypeError(\".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected\");\n                        message.path = [];\n                        for (var i = 0; i < object.path.length; ++i)\n                            message.path[i] = object.path[i] | 0;\n                    }\n                    if (object.sourceFile != null)\n                        message.sourceFile = String(object.sourceFile);\n                    if (object.begin != null)\n                        message.begin = object.begin | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an Annotation message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Annotation.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults)\n                        object.path = [];\n                    if (options.defaults) {\n                        object.sourceFile = \"\";\n                        object.begin = 0;\n                        object.end = 0;\n                    }\n                    if (message.path && message.path.length) {\n                        object.path = [];\n                        for (var j = 0; j < message.path.length; ++j)\n                            object.path[j] = message.path[j];\n                    }\n                    if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n                        object.sourceFile = message.sourceFile;\n                    if (message.begin != null && message.hasOwnProperty(\"begin\"))\n                        object.begin = message.begin;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this Annotation to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Annotation.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                return Annotation;\n            })();\n\n            return GeneratedCodeInfo;\n        })();\n\n        return protobuf;\n    })();\n\n    return google;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/electron-launcher/src/launcher/logger/FileLogger.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LogLevel } from '@plexus-interop/common';\nimport * as fs from 'fs';\nimport * as util from 'util';\n\nexport class FileLogger implements Logger {\n\n    private logFile: any;\n\n    constructor(private baseLogger: Logger, fileName: string = 'plexus-electron-launcher.log') {\n        fileName = `${process.cwd()}/${fileName}`;\n        this.logFile = fs.createWriteStream(fileName, { flags: 'w' });\n        this.baseLogger.info(`Writing log to ${fileName}`);\n    }\n\n    public debug(msg: string, ...args: any[]): void {\n        this.baseLogger.debug(msg, args);\n        this.log(`[DEBUG] | ${msg}`);\n    }\n\n    public info(msg: string, ...args: any[]): void {\n        this.baseLogger.info(msg, args);\n        this.log(msg);\n    }\n\n    public error(msg: string, ...args: any[]): void {\n        this.baseLogger.error(msg, args);\n        this.log('[ERROR] | ' + msg);\n    }\n\n    public warn(msg: string, ...args: any[]): void {\n        this.baseLogger.warn('[WARN] |' + msg, args);\n        this.log(msg);\n    }\n\n    public trace(msg: string, ...args: any[]): void {\n        this.baseLogger.trace(msg, args);\n        this.log('[TRACE] | ' + msg);\n    }\n\n    public getLogLevel(): LogLevel {\n        return this.baseLogger.getLogLevel();\n    }\n\n    public isDebugEnabled(): boolean {\n        return this.getLogLevel() <= LogLevel.DEBUG;\n    }\n\n    public isTraceEnabled(): boolean {\n        return this.getLogLevel() <= LogLevel.TRACE;\n    }\n\n    private log(msg: string): void {\n        this.logFile.write(util.format(`${new Date().toISOString()} ${msg}${'\\n'}`));\n    }\n\n}"
  },
  {
    "path": "web/packages/electron-launcher/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"jest\",\n            \"long\"\n        ]\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/electron-launcher/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/io/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/io/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/io\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Plexus Interop serialization/deserialization services\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\"\n  },\n  \"dependencies\": {\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/metadata\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"protobufjs\": \"6.11.3\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"@types/node\": \"^7.0.5\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/jest\": \"^23.1.3\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/io/preprocessor.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst tsc = require('typescript');\nconst tsConfig = require('./tsconfig.json');\n\nmodule.exports = {\n    process(src, path) {\n        if (path.endsWith('.ts') || path.endsWith('.tsx')) {\n            return tsc.transpile(\n                src,\n                tsConfig.compilerOptions,\n                path,\n                []\n            );\n        }\n        return src;\n    },\n};\n"
  },
  {
    "path": "web/packages/io/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/io/src/api/BinaryMarshaller.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Marshaller } from './Marshaller';\n\nexport interface BinaryMarshaller extends Marshaller<any, Uint8Array> {\n}"
  },
  {
    "path": "web/packages/io/src/api/BinaryMarshallerProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BinaryMarshaller } from './BinaryMarshaller';\n\nexport abstract class BinaryMarshallerProvider {\n\n    public abstract getMarshaller(messageType: any): BinaryMarshaller;\n    \n}"
  },
  {
    "path": "web/packages/io/src/api/ExtendedMarshaller.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Marshaller } from './Marshaller';\n\nexport interface ExtendedMarshaller<BaseType, EncodedType> extends Marshaller<BaseType, EncodedType> {\n\n    validate(messageObj: BaseType): void;\n\n}"
  },
  {
    "path": "web/packages/io/src/api/Marshaller.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Marshaller<BaseType, EncodedType> {\n    \n    encode(messageObj: BaseType): EncodedType;\n    \n    decode(messagePayload: EncodedType): BaseType;\n\n}"
  },
  {
    "path": "web/packages/io/src/api/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './BinaryMarshaller';\nexport * from './BinaryMarshallerProvider';\nexport * from './ExtendedMarshaller';\nexport * from './Marshaller';\n"
  },
  {
    "path": "web/packages/io/src/dynamic/DynamicBinaryMarshallerProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BinaryMarshallerProvider, BinaryMarshaller } from '../api';\nimport { InteropRegistry } from '@plexus-interop/metadata';\nimport { DynamicProtoMarshallerFactory } from './DynamicProtoMarshallerFactory';\nimport { DynamicBinaryProtoMarshaller } from './DynamicBinaryProtoMarshaller';\n\nexport class DynamicBinaryMarshallerProvider implements BinaryMarshallerProvider {\n\n    private internalProvider: DynamicProtoMarshallerFactory;\n\n    public constructor(private readonly registry: InteropRegistry) {\n        this.internalProvider = new DynamicProtoMarshallerFactory(registry);\n    }\n\n    public getMarshaller(messageType: any): BinaryMarshaller {\n        return new DynamicBinaryProtoMarshaller(this.internalProvider.getMarshaller(messageType));\n    }\n}"
  },
  {
    "path": "web/packages/io/src/dynamic/DynamicBinaryProtoMarshaller.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BinaryMarshaller, Marshaller } from '../api';\nimport { DynamicProtoMarshaller } from './DynamicProtoMarshaller';\n\nexport class DynamicBinaryProtoMarshaller implements BinaryMarshaller {\n    \n    public constructor(private readonly internal: Marshaller<any, ArrayBuffer>) {}\n    \n    public encode(messageObj: any): Uint8Array {\n        return new Uint8Array(this.internal.encode(messageObj));\n    }\n    \n    public decode(messagePayload: Uint8Array): any {\n        return this.internal.decode(messagePayload.buffer);\n    }\n}"
  },
  {
    "path": "web/packages/io/src/dynamic/DynamicProtoMarshaller.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as protobuf from 'protobufjs/light';\nimport { Arrays, getPlexusFeatures } from '@plexus-interop/common';\nimport { ExtendedMarshaller } from '../api/ExtendedMarshaller';\n\nexport class DynamicProtoMarshaller implements ExtendedMarshaller<any, ArrayBuffer> {\n\n    public constructor(private readonly protoType: protobuf.Type) { }\n\n    public validate(messageObj: any): void {\n        const error = this.protoType.verify(messageObj);\n        if (error) {\n            throw new Error(error);\n        }\n    }\n\n    public decode(messagePayload: ArrayBuffer): any {\n        const features = getPlexusFeatures();\n        const decoded = this.protoType.decode(new Uint8Array(messagePayload));\n        return this.protoType.toObject(decoded, { defaults: features.decodeUndefinedToDefault });\n    }\n\n    public encode(messageObj: any): ArrayBuffer {\n        return Arrays.toArrayBuffer(this.protoType.encode(messageObj).finish());\n    }\n}"
  },
  {
    "path": "web/packages/io/src/dynamic/DynamicProtoMarshallerFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistry } from '@plexus-interop/metadata';\nimport { ExtendedMarshaller } from '../api/ExtendedMarshaller';\nimport * as protobuf from 'protobufjs/light';\nimport { DynamicProtoMarshaller } from './DynamicProtoMarshaller';\nimport { Root } from 'protobufjs/light';\n\n/**\n * Dynamic Marshaller, based on Interop Metadata Registry\n */\nexport class DynamicProtoMarshallerFactory {\n\n    // tslint:disable-next-line:typedef\n    private readonly cache = new Map<string, ExtendedMarshaller<any, ArrayBuffer>>();\n\n    private readonly protobufRoot: Root;\n\n    public constructor(private readonly registry: InteropRegistry) {\n        this.protobufRoot = protobuf.Root.fromJSON(registry.rawMessages);\n    }\n\n    public getMarshaller(messageId: string): ExtendedMarshaller<any, ArrayBuffer> {\n        if (this.cache.has(messageId)) {\n            return this.cache.get(messageId) as ExtendedMarshaller<any, ArrayBuffer>;\n        }\n        const marshaller = this.createDynamicMarshaller(this.registry, messageId);\n        this.cache.set(messageId, marshaller);\n        return marshaller;\n    }\n\n    private createDynamicMarshaller(registry: InteropRegistry, messageId: string): ExtendedMarshaller<any, ArrayBuffer> {\n        const message = registry.messages.get(messageId);\n        if (!message) {\n            throw new Error(`${messageId} not found in Registry`);\n        }\n        const type = this.protobufRoot.lookupType(messageId);\n        return new DynamicProtoMarshaller(type);\n    }\n\n}"
  },
  {
    "path": "web/packages/io/src/dynamic/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './DynamicProtoMarshaller';\nexport * from './DynamicProtoMarshallerFactory';\nexport * from './DynamicBinaryMarshallerProvider';\nexport * from './DynamicBinaryProtoMarshaller';"
  },
  {
    "path": "web/packages/io/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './api';"
  },
  {
    "path": "web/packages/io/src/static/ProtoMarshallerProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getPlexusFeatures } from '@plexus-interop/common';\nimport { BinaryMarshallerProvider } from '../api/BinaryMarshallerProvider';\nimport { BinaryMarshaller } from '../api/BinaryMarshaller';\n\n/**\n * Provides Marshaller based on generated Protobuf message types\n */\nexport class ProtoMarshallerProvider implements BinaryMarshallerProvider {\n\n    public getMarshaller(messageObj: any): BinaryMarshaller {\n        if (!messageObj) {\n            throw new Error('Proto message definition is not provided');\n        } else if (!messageObj.encode || !messageObj.decode) {\n            throw new Error('Encode/Decode is missed for message definition');\n        } else {\n            return {\n                encode: (obj: any): Uint8Array => {\n                    return messageObj.encode(obj).finish() as Uint8Array;\n                },\n                decode: (payload: Uint8Array): any => {\n                    const features = getPlexusFeatures();\n                    return messageObj.toObject(messageObj.decode(payload), { defaults: features.decodeUndefinedToDefault });\n                }\n            };\n        }\n    }\n}"
  },
  {
    "path": "web/packages/io/src/static/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './ProtoMarshallerProvider';"
  },
  {
    "path": "web/packages/io/tests/dynamic/DynamicMarshallerFactory.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistry } from '@plexus-interop/metadata';\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { Application } from '@plexus-interop/metadata';\nimport { Message } from '@plexus-interop/metadata';\nimport { Service } from '@plexus-interop/metadata';\nimport { DynamicProtoMarshallerFactory } from '../../src/dynamic/DynamicProtoMarshallerFactory';\nimport * as fs from 'fs';\nimport { JsonInteropRegistryProvider } from '@plexus-interop/metadata';\n\ndescribe('DynamicMarshallerFactory', () => {\n\n    const metadataJson = fs.readFileSync('../metadata/tests/json/test-interop.json', 'utf8');\n    const registry = new JsonInteropRegistryProvider(metadataJson).getCurrent();\n\n    const messages = ExtendedMap.create<string, Message>();\n    const messageId = 'plexus.interop.testing.EchoRequest';\n\n    const validMessage = {\n        stringField: 'stringData',\n        boolField: true,\n        enumField: 1,\n        repeatedDoubleField: [1, 2, 3],\n        subMessageField: {\n            stringField: 'stringData'\n        }\n    };\n\n    const invalidTypeMessage = {\n        stringField: 'stringData',\n        boolField: 'true'\n    };\n\n    const invalidEnumValueMessage = {\n        stringField: 'stringData',\n        enumField: 10\n    };\n\n    const undefinedEnumValueMessage = {\n        stringField: 'stringData'\n    };\n\n    const sut = new DynamicProtoMarshallerFactory(registry);\n\n    it('Creates Marshaller for existing Message', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        expect(marshaller).toBeDefined();\n    });\n\n    it('Reuse same Marshaller for next calls', () => {\n        expect(sut.getMarshaller(messageId))\n            .toBe(sut.getMarshaller(messageId));\n    });\n\n    it('It creates Marshaller with validation support', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        marshaller.validate(validMessage);\n    });\n\n    it('Raises an Error for Marshaller request on not existing Message', () => {\n        try {\n            sut.getMarshaller('Do not exist');\n            fail('Should fail');\n        } catch (error) {\n        }\n    });\n\n    it('Creates Marshaller which fail on messages with wrong type', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        expect(() => marshaller.validate(invalidTypeMessage)).toThrowError();\n    });\n\n    it('Creates Marshaller which fail on messages with wrong enum value', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        expect(() => marshaller.validate(invalidEnumValueMessage)).toThrowError();\n    });\n\n    it('Creates Marshaller encoding/decoding support', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        const encoded = marshaller.encode(validMessage);\n        expect(encoded).toBeDefined();\n        const decoded = marshaller.decode(encoded);\n        expect(decoded).toMatchObject(validMessage);\n    });\n\n    it('Decodes undefined enum value to default', () => {\n        const marshaller = sut.getMarshaller(messageId);\n        const encoded = marshaller.encode(undefinedEnumValueMessage);\n        const decoded = marshaller.decode(encoded);\n        expect(decoded.enumField).toBe(0);\n    });\n});"
  },
  {
    "path": "web/packages/io/tests/static/ProtoMarshallerProvider.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProtoMarshallerProvider } from '../../src/static/ProtoMarshallerProvider';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\ndescribe('Proto Marshaller Provider', () => {\n\n    const sut = new ProtoMarshallerProvider();\n\n    it('Provides Marshaller by Message Type', () => {\n        const marshaller = sut.getMarshaller(plexus.interop.protocol.ConnectRequest);\n        expect(marshaller).toBeDefined();\n    });\n\n    it('Decodes valid message', () => {\n        const marshaller = sut.getMarshaller(plexus.interop.protocol.ConnectRequest);\n\n        const encoded = marshaller.encode({\n            applicationId: 'ID'\n        });\n        const decoded = marshaller.decode(encoded);\n        expect(decoded.applicationId).toEqual('ID');\n    });\n\n    it('Decodes undefined to default', () => {\n        const marshaller = sut.getMarshaller(plexus.interop.protocol.ConnectRequest);\n\n        const encoded = marshaller.encode({});\n        const decoded = marshaller.decode(encoded);\n        expect(decoded.applicationId).toBe(\"\");\n    });\n});"
  },
  {
    "path": "web/packages/io/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/io/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/metadata/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/metadata/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/metadata\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Plexus Interop Metadata management\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\"\n  },\n  \"dependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/remote\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\"\n  },\n  \"peerDependencies\": {\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"@types/node\": \"^7.0.5\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/jest\": \"^23.1.3\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/metadata/preprocessor.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst tsc = require('typescript');\nconst tsConfig = require('./tsconfig.json');\n\nmodule.exports = {\n    process(src, path) {\n        if (path.endsWith('.ts') || path.endsWith('.tsx')) {\n            return tsc.transpile(\n                src,\n                tsConfig.compilerOptions,\n                path,\n                []\n            );\n        }\n        return src;\n    },\n};\n"
  },
  {
    "path": "web/packages/metadata/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/metadata/src/apps/AppRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppRegistry } from './model/AppRegistry';\nimport { Observable } from 'rxjs/Observable';\n\nexport interface AppRegistryProvider {\n\n    getCurrent(): AppRegistry;\n\n    getAppRegistry(): Observable<AppRegistry>;\n\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/AppRegistryService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppRegistryProvider } from './AppRegistryProvider';\nimport { Application } from './model/Application';\nimport { AppRegistry } from './model/AppRegistry';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\n\nexport class AppRegistryService {\n\n    private readonly log: Logger = LoggerFactory.getLogger('AppRegistryService');\n\n    private appsRegistry: AppRegistry;\n\n    constructor(private readonly appRegistryProvider: AppRegistryProvider) {\n        this.appsRegistry = appRegistryProvider.getCurrent();\n        this.appRegistryProvider.getAppRegistry().subscribe({\n            next: update => {\n                this.log.debug(`App registry updated, apps size [${update.apps.size}]`);\n                this.appsRegistry = update;\n            }\n        });\n    }\n\n    public getApplication(id: string): Application {\n        const result = this.appsRegistry.apps.get(id);\n        if (!result) {\n            throw new Error(`Application with id [${id}] is not found in App Registry`);\n        }\n        return result;\n    }\n\n    public getApplications(): Application[] {\n        return this.appsRegistry.apps.valuesArray();\n    }\n\n    public isAppExist(id: string): boolean {\n        return this.appsRegistry.apps.has(id);\n    }\n\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/json/JsonAppRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppRegistryProvider } from '../AppRegistryProvider';\nimport { Observable } from 'rxjs/Observable';\nimport { AppRegistry } from '../model/AppRegistry';\nimport { Application } from '../model/Application';\nimport { toMap } from '@plexus-interop/common';\nimport 'rxjs/add/observable/of';\nimport 'rxjs/add/operator/map';\n\nexport class JsonAppRegistryProvider implements AppRegistryProvider {\n\n    protected $registry: Observable<AppRegistry>;\n    protected current: AppRegistry;\n\n    public constructor(jsonMetadata: string, $jsonMetadata?: Observable<string>) {\n        this.current = this.parseRegistry(jsonMetadata);\n        this.$registry = ($jsonMetadata || Observable.of(jsonMetadata))\n            .map(this.parseRegistry.bind(this));\n        this.$registry.subscribe({\n            next: update => this.current = update\n        });\n    }\n\n    public getAppRegistry(): Observable<AppRegistry> {\n        return this.$registry;\n    }\n\n    public getCurrent(): AppRegistry {\n        return this.current;\n    }\n\n    protected parseRegistry(json: string): AppRegistry {\n        const appsDto: { apps: Application[] } = JSON.parse(json);\n        return {\n            apps: toMap(appsDto.apps, app => app.id, app => app)\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/json/UrlAppRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observable } from 'rxjs/Observable';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { HttpDataLoader } from '@plexus-interop/remote';\nimport { JsonAppRegistryProvider } from './JsonAppRegistryProvider';\nimport { AppRegistryProvider } from '../AppRegistryProvider';\nimport { AppRegistry } from '../model/AppRegistry';\n\nexport class UrlAppRegistryProvider implements AppRegistryProvider {\n\n    private readonly log: Logger = LoggerFactory.getLogger('UrlAppRegistryProvider');\n\n    protected urlDataLoader: HttpDataLoader = new HttpDataLoader();\n\n    protected started: boolean = false;    \n\n    protected jsonAppRegistryProvider: JsonAppRegistryProvider;\n\n    public constructor(\n        private readonly url: string,\n        private readonly interval: number = -1) { }\n\n    public getAppRegistry(): Observable<AppRegistry> {\n        return this.started ? this.jsonAppRegistryProvider.getAppRegistry() : Observable.throw(new Error('Not started'));\n    }\n\n    public getCurrent(): AppRegistry {\n        if (!this.started) {\n            throw new Error('Not started');\n        }\n        return this.jsonAppRegistryProvider.getCurrent();\n    }\n\n    public async start(): Promise<void> {\n        if (this.started) {\n            return Promise.reject('Already started');\n        }\n        this.log.debug(`Starting to load metadata from [${this.url}] with ${this.interval} interval`);\n        const response = await this.urlDataLoader.fetchData(this.url);\n        if (this.interval > 0) {\n            this.jsonAppRegistryProvider = new JsonAppRegistryProvider(response, this.urlDataLoader.fetchWithInterval(this.url, this.interval));\n        } else {\n            this.jsonAppRegistryProvider = new JsonAppRegistryProvider(response);\n        }\n        this.started = true;\n    }\n\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/model/AppRegistry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { Application } from './Application';\n\nexport interface AppRegistry {\n    apps: ExtendedMap<string, Application>;\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/model/Application.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Application {\n    id: string;\n    displayName: string;\n    launcherId: string;\n    launcherParams: any;\n}"
  },
  {
    "path": "web/packages/metadata/src/apps/model/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Application';\nexport * from './AppRegistry';\n"
  },
  {
    "path": "web/packages/metadata/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './apps/json/JsonAppRegistryProvider';\nexport * from './apps/json/UrlAppRegistryProvider';\nexport * from './apps/AppRegistryProvider';\nexport * from './apps/AppRegistryService';\nexport { Application as App } from './apps/model/Application';\nexport { AppRegistry } from './apps/model';\nexport * from './interop/InteropRegistryProvider';\nexport * from './interop/json/JsonInteropRegistryProvider';\nexport * from './interop/json/UrlInteropRegistryProvider';\nexport * from './interop/InteropRegistryService';\nexport * from './interop/model';"
  },
  {
    "path": "web/packages/metadata/src/interop/InteropRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistry } from './model/InteropRegistry';\nimport { Observable } from 'rxjs/Observable';\n\nexport interface InteropRegistryProvider {\n\n    getCurrent(): InteropRegistry;\n\n    getRegistry(): Observable<InteropRegistry>;\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/InteropRegistryService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Application } from './model/Application';\nimport { ConsumedService } from './model/ConsumedService';\nimport { ConsumedMethodReference } from './model/ConsumedMethodReference';\nimport { ConsumedMethod } from './model/ConsumedMethod';\nimport { ProvidedMethod } from './model/ProvidedMethod';\nimport { ProvidedServiceReference } from './model/ProvidedServiceReference';\nimport { InteropRegistryProvider } from './InteropRegistryProvider';\nimport { join, distinct, Logger, LoggerFactory, flatMap, ExtendedMap } from '@plexus-interop/common';\nimport { InteropRegistry } from './model/InteropRegistry';\nimport { ConsumedServiceReference } from './model/ConsumedServiceReference';\nimport { ProvidedService } from './model/ProvidedService';\nimport { Method } from './model/Method';\nimport { Option } from './model/Option';\n\nexport class InteropRegistryService {\n\n    private readonly log: Logger = LoggerFactory.getLogger('RegistryService');\n\n    private appProvidedMethodsCache: ExtendedMap<string, ProvidedMethod[]> = ExtendedMap.create<string, ProvidedMethod[]>();\n\n    private registry: InteropRegistry;\n\n    constructor(private readonly registryProvider: InteropRegistryProvider) {\n        this.updateRegistry(registryProvider.getCurrent());\n        this.registryProvider.getRegistry().subscribe({\n            next: updatedRegistry => this.updateRegistry(updatedRegistry)\n        });\n    }\n\n    public getApplication(idOrAlias: string): Application {\n        const aliasOptionPredicate = (option: Option) => option.id.endsWith('alias') && idOrAlias === option.value;\n        const appFinder = (app: Application) => app.id === idOrAlias || (!!app.options && !!app.options.find(aliasOptionPredicate)); \n        const result = this.registry.applications.valuesArray().find(appFinder);\n        if (!result) {\n            throw new Error(`${idOrAlias} app not found`);\n        }\n        return result;\n    }\n\n    public getRegistry(): InteropRegistry {\n        return this.registry;\n    }\n\n    public getConsumedService(appId: string, serviceReference: ConsumedServiceReference): ConsumedService {\n        const app = this.getApplication(appId);\n        const result = app.consumedServices.find(consumedService => consumedService.service.id === serviceReference.serviceId\n            && (!serviceReference.serviceAlias || serviceReference.serviceAlias === consumedService.service.serviceAlias));\n        if (!result) {\n            throw new Error(`Service not found`);\n        }\n        return result;\n    }\n\n    public getConsumedMethod(appId: string, reference: ConsumedMethodReference): ConsumedMethod {\n\n        const app = this.getApplication(appId);\n\n        const consumedMethods: ConsumedMethod[] = flatMap<ConsumedService, ConsumedMethod>(\n            consumedService => consumedService.methods.valuesArray(),\n            app.consumedServices);\n\n        const result = consumedMethods.find(method => {\n            return this.equalsIfExist(reference.methodId, method.method.name)\n                && (!reference.consumedService\n                    || (this.equalsIfExist(reference.consumedService.serviceAlias, method.consumedService.service.serviceAlias)\n                        && this.equalsIfExist(reference.consumedService.serviceId, method.consumedService.service.id)));\n        });\n\n        if (!result) {\n            throw new Error(`Service not found`);\n        }\n\n        return result;\n    }\n\n    public getProvidedService(reference: ProvidedServiceReference): ProvidedService {\n        const result = this.getApplication(reference.applicationId as string)\n            .providedServices.find(x => this.equalsIfExist(reference.serviceAlias, x.service.serviceAlias) && this.equalsIfExist(reference.serviceId, x.service.id));\n        if (!result) {\n            throw new Error('Provided Service not found');\n        }\n        return result;\n    }\n\n    public getMatchingProvidedMethods(appId: string, consumedMethodReference: ConsumedMethodReference): ProvidedMethod[] {\n        const consumedMethod = this.getConsumedMethod(appId, consumedMethodReference);\n        return this.getMatchingProvidedMethodsFromConsumed(consumedMethod);\n    }\n\n    public getProvidedServices(appId: string): ProvidedService[] {\n        const app = this.registry.applications.get(appId);\n        if (!app) {\n            throw new Error(`App ${appId} doesn't exist`);\n        }\n        return app.providedServices;\n    }\n\n    public getConsumedServices(appId: string): ConsumedService[] {\n        const app = this.registry.applications.get(appId);\n        if (!app) {\n            throw new Error(`App ${appId} doesn't exist`);\n        }\n        return app.consumedServices;\n    }\n\n    public getMatchingProvidedMethodsForApp(app: Application): ProvidedMethod[] {\n        return this.appProvidedMethodsCache.getOrAdd(app.id, () => this.getMatchingProvidedMethodsForAppInternal(app));\n    }\n    \n    public getMatchingProvidedMethodsFromConsumed(consumedMethod: ConsumedMethod): ProvidedMethod[] {\n        return this.getMatchingProvidedMethodsForApp(consumedMethod.consumedService.application)\n            .filter(providedMethod => this.equals(consumedMethod.method, providedMethod.method));\n    }\n\n    public getProvidedMethods(): ProvidedMethod[] {\n        const allProvidedServices: ProvidedService[] = flatMap<Application, ProvidedService>(\n            app => app.providedServices, \n            this.registry.applications.valuesArray());\n        return flatMap<ProvidedService, ProvidedMethod>(\n            service => service.methods.valuesArray(), \n            allProvidedServices);\n    }\n    \n    private updateRegistry(registry: InteropRegistry): void {\n        this.log.debug('Registry updated');\n        this.registry = registry;\n        this.appProvidedMethodsCache.clear();\n    }\n\n    private getMatchingProvidedMethodsForAppInternal(app: Application): ProvidedMethod[] {\n\n        const allProvidedServices: ProvidedService[] = flatMap<Application, ProvidedService>(\n            app => app.providedServices, this.registry.applications.valuesArray());\n\n        const consumedProvidedPairs = join(\n            app.consumedServices,\n            allProvidedServices,\n            (consumed, provided) => {\n                return { consumed, provided };\n            },\n            // matched by service id app permissions\n            (c, p) => p.to.isMatch(c.application.id)\n                && c.from.isMatch(p.application.id)\n                && c.service.id === p.service.id\n                && c.alias === p.alias);\n\n        const result = flatMap<{ consumed: ConsumedService, provided: ProvidedService }, ProvidedMethod>(pair => {\n\n            const allMatchedProvidedMethods: ProvidedMethod[] = join(\n                pair.consumed.methods.valuesArray(),\n                pair.provided.methods.valuesArray(),\n                (c, p) => p,\n                // matched by method name\n                (c, p) => c.method.name === p.method.name);\n\n            return distinct<ProvidedMethod>(allMatchedProvidedMethods,\n                pMethod => `${pMethod.method.name}-${pMethod.providedService.application.id}`);\n\n        }, consumedProvidedPairs);\n\n        return result;\n    }\n\n    private equals(x: Method, y: Method): boolean {\n        return x.name === y.name && x.service.id === y.service.id;\n    }\n\n    private equalsIfExist(expect: any, result: any): boolean {\n        return typeof expect === 'undefined' || expect === result;\n    }\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/apps/Application.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class Application {\n\n    constructor(\n        public readonly id: string,\n        public readonly displayName: string,\n        public readonly launcherId: string,\n        public readonly launcherParams: any\n    ) {}\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ApplicationDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedServiceDto } from './ProvidedServiceDto';\nimport { ConsumedServiceDto } from './ConsumedServiceDto';\nimport { OptionDto } from './OptionDto';\n\nexport interface ApplicationDto {\n    \n    id: string;\n    \n    provides: ProvidedServiceDto[];\n    \n    consumes: ConsumedServiceDto[];\n\n    options: OptionDto[];    \n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ConsumedMethodDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ConsumedMethodDto {\n    name: string;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ConsumedServiceDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConsumedMethodDto } from './ConsumedMethodDto';\n\nexport interface ConsumedServiceDto {\n    \n    service: string;\n    \n    from: string[];\n\n    methods: ConsumedMethodDto[];\n\n    alias?: string;\n\n} "
  },
  {
    "path": "web/packages/metadata/src/interop/json/EnumDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Options } from './Options';\nimport { Values } from './Values';\n\nexport interface EnumDto {\n    values: Values;\n    options?: Options;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/Field.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Options } from './Options';\n\nexport interface Field {\n    type: string;\n    id: number;\n    keyType?: string;\n    rule?: 'repeated';\n    options?: Options;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/Fields.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Field } from './Field';\n\nexport type Fields = {\n\n    [key: string]: Field;\n\n};"
  },
  {
    "path": "web/packages/metadata/src/interop/json/JsonInteropRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistryProvider } from '../InteropRegistryProvider';\nimport { InteropRegistry } from '../model/InteropRegistry';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/of';\nimport 'rxjs/add/operator/map';\nimport { RegistryDto } from './RegistryDto';\nimport { ExtendedArray, Logger, LoggerFactory, ExtendedMap, toMap } from '@plexus-interop/common';\nimport { Message } from '../model/Message';\nimport { ServiceDto } from './ServiceDto';\nimport { Service } from '../model/Service';\nimport { Method } from '../model/Method';\nimport { MethodType } from '../model/MethodType';\nimport { MethodTypeDto } from './MethodTypeDto';\nimport { Application } from '../model/Application';\nimport { ConsumedServiceDto } from './ConsumedServiceDto';\nimport { ConsumedService } from '../model/ConsumedService';\nimport { MatchPatternFactory } from '../model/MatchPatternFactory';\nimport { ConsumedMethod } from '../model/ConsumedMethod';\nimport { ProvidedMethod } from '../model/ProvidedMethod';\nimport { ProvidedServiceDto } from './ProvidedServiceDto';\nimport { ProvidedService } from '../model/ProvidedService';\nimport { ApplicationDto } from './ApplicationDto';\nimport { OptionDto } from './OptionDto';\nimport { MessagesNamespace, isMessage, isEnum } from './MessagesNamespace';\nimport { Enum } from '../model/Enum';\nimport { Option } from '../model/Option';\n\nexport class JsonInteropRegistryProvider implements InteropRegistryProvider {\n\n    private log: Logger;\n\n    private readonly $registry: Observable<InteropRegistry>;\n    private current: InteropRegistry;\n\n    public constructor(jsonMetadata: string, $jsonMetadata?: Observable<string>) {\n        this.log = LoggerFactory.getLogger('JsonInteropRegistryProvider');\n        this.current = this.parseRegistry(jsonMetadata);\n        this.$registry = ($jsonMetadata || Observable.of(jsonMetadata))\n            .map(this.parseRegistry.bind(this));\n        this.$registry.subscribe({\n            next: update => this.current = update\n        });\n    }\n\n    public getCurrent(): InteropRegistry {\n        return this.current;\n    }\n\n    public getRegistry(): Observable<InteropRegistry> {\n        return this.$registry;\n    }\n\n    private parseRegistry(jsonRegistry: string): InteropRegistry {\n\n        this.log.trace(`Parsing JSON registry of ${jsonRegistry.length} length`);\n        const registryDto: RegistryDto = JSON.parse(jsonRegistry);\n        this.log.trace(`Finished parsing ${jsonRegistry.length} length`);\n\n        const messages = ExtendedMap.create<string, Message>();\n        const enums = ExtendedMap.create<string, Enum>();\n\n        this.collectMessagesMetadata(registryDto.messages, null, messages, enums);\n\n        const services = ExtendedArray.of(\n            registryDto.services.map(s => this.convertService(messages, s)))\n            .toMap(s => s.id, s => s);\n\n        const applications = ExtendedArray.of(\n            registryDto.applications.map(\n                appDto => this.convertApplication(services, appDto)))\n            .toMap(a => a.id, a => a);\n\n        return {\n            messages,\n            enums,\n            services,\n            applications,\n            rawMessages: registryDto.messages\n        };\n    }\n\n    private collectMessagesMetadata(\n        rawEnries: MessagesNamespace,\n        namespaceId: string | null = null,\n        messagesMap: ExtendedMap<string, Message>,\n        enumsMap: ExtendedMap<string, Enum>): void {\n\n        const nested = rawEnries.nested;\n        if (!nested) {\n            return;\n        }\n\n        for (let key in nested) {\n            const namespaceEntry = nested[key];\n            const id = namespaceId ? `${namespaceId}.${key}` : key;\n            if (isMessage(namespaceEntry)) {\n                messagesMap.set(id, { id, fields: namespaceEntry.fields });\n            } else if (isEnum(namespaceEntry)) {\n                enumsMap.set(id, { id, values: namespaceEntry.values });\n            }\n            this.collectMessagesMetadata(namespaceEntry, id, messagesMap, enumsMap);\n        }\n\n    }\n\n    private convertApplication(services: ExtendedMap<string, Service>, appDto: ApplicationDto): Application {\n        const providedServices: ProvidedService[] = [];\n        const consumedServices: ConsumedService[] = [];\n        const application: Application = {\n            id: appDto.id,\n            providedServices,\n            consumedServices,\n            options: []\n        };\n        appDto.consumes = appDto.consumes || [];\n        appDto.consumes.forEach(consumedDto => {\n            consumedServices.push(\n                this.convertConsumedService(consumedDto, application, services.get(consumedDto.service) as Service));\n        });\n        appDto.provides = appDto.provides || [];\n        appDto.provides.forEach(providedDto => {\n            providedServices.push(this.convertProvidedService(providedDto, application, services.get(providedDto.service) as Service));\n        });\n        if (appDto.options) {\n            application.options = appDto.options.map(optDto => {\n                return { id: optDto.id, value: optDto.value };\n            });\n        }\n        return application;\n    }\n\n    private convertConsumedService(serviceDto: ConsumedServiceDto, application: Application, service: Service): ConsumedService {\n        const methods = ExtendedMap.create<string, ConsumedMethod>();\n        const consumedService: ConsumedService = {\n            service,\n            application,\n            alias: serviceDto.alias,\n            from: MatchPatternFactory.createMatcher(serviceDto.from),\n            methods\n        };\n        serviceDto.methods = serviceDto.methods || [];\n        serviceDto.methods\n            .map(m => {\n                return {\n                    method: service.methods.get(m.name) as Method,\n                    consumedService\n                } as ConsumedMethod;\n            })\n            .forEach(cm => methods.set(cm.method.name, cm));\n        return consumedService;\n    }\n\n    private convertProvidedService(serviceDto: ProvidedServiceDto, application: Application, service: Service): ProvidedService {\n\n        const methods = ExtendedMap.create<string, ProvidedMethod>();\n\n        const providedService: ProvidedService = {\n            service,\n            application,\n            alias: serviceDto.alias,\n            to: MatchPatternFactory.createMatcher(serviceDto.to),\n            methods\n        };\n\n        serviceDto.methods.map(pm => {\n            return {\n                method: service.methods.get(pm.name) as Method,\n                providedService,\n                title: this.getOptionValueOrDefault(pm.options, 'interop.ProvidedMethodOptions.title', null),\n                options: pm.options\n            } as ProvidedMethod;\n        })\n            .forEach(pm => methods.set(pm.method.name, pm));\n\n        return providedService;\n    }\n\n    private getOptionValueOrDefault(options: OptionDto[], id: string, defaultValue: string | null): string | null {\n        if (options) {\n            for (let o of options) {\n                if (o.id === id) {\n                    return o.value;\n                }\n            }\n        }\n        return defaultValue;\n    }\n\n    private convertService(messagesMap: Map<string, Message>, serviceDto: ServiceDto): Service {\n        const service: Service = {\n            id: serviceDto.id,\n            methods: ExtendedMap.create<string, Method>()\n        };\n        service.methods = toMap(\n            serviceDto.methods.map(methodDto => {\n                return {\n                    name: methodDto.name,\n                    type: this.convertMethodType(methodDto.type),\n                    requestMessage: messagesMap.get(methodDto.request) as Message,\n                    responseMessage: messagesMap.get(methodDto.response) as Message,\n                    service\n                } as Method;\n            }), m => m.name, m => m);\n        return service;\n    }\n\n    private convertMethodType(methodTypeDto: MethodTypeDto): MethodType {\n        switch (methodTypeDto) {\n            case MethodTypeDto.ClientStreaming:\n                return MethodType.ClientStreaming;\n            case MethodTypeDto.ServerStreaming:\n                return MethodType.ServerStreaming;\n            case MethodTypeDto.Unary:\n                return MethodType.Unary;\n            case MethodTypeDto.DuplexStreaming:\n                return MethodType.DuplexStreaming;\n            default:\n                throw new Error('Unsupported method type: ' + methodTypeDto);\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/MessageDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Fields } from './Fields';\nimport { Options } from './Options';\nimport { MessagesNamespaceContent } from './MessagesNamespace';\n\nexport interface MessageDto {\n    fields: Fields;\n    options?: Options;\n    nested?: MessagesNamespaceContent;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/MessagesNamespace.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Options } from './Options';\nimport { MessageDto } from './MessageDto';\nimport { EnumDto } from './EnumDto';\n\nexport type MessagesNamespace = {\n    options?: Options;\n    nested?: MessagesNamespaceContent;\n};\n\nexport type MessagesNamespaceContent = {\n    [key: string]: MessageDto | MessagesNamespace | EnumDto;\n};\n\nexport function isMessage(o: MessageDto | MessagesNamespace | EnumDto): o is MessageDto {\n    return !!(o as MessageDto).fields;\n}\n\nexport function isEnum(o: MessageDto | MessagesNamespace | EnumDto): o is EnumDto {\n    return !!(o as EnumDto).values;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/MethodDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodTypeDto } from './MethodTypeDto';\n\nexport interface MethodDto {\n    name: string;\n    request: string;\n    response: string;\n    type: MethodTypeDto;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/MethodTypeDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum MethodTypeDto {\n    Unary = 'Unary',\n    ServerStreaming = 'ServerStreaming',\n    ClientStreaming = 'ClientStreaming',\n    DuplexStreaming = 'DuplexStreaming'\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/OptionDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface OptionDto {\n    id: string;\n    value: string;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/Options.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Options {\n    [key: string]: any;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ProvidedMethodDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { OptionDto } from './OptionDto';\n\nexport interface ProvidedMethodDto {\n    name: string;\n    options: OptionDto[];\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ProvidedServiceDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedMethodDto } from './ProvidedMethodDto';\nimport { OptionDto } from './OptionDto';\n\nexport interface ProvidedServiceDto {\n    \n    service: string;\n    \n    to: string[];\n    \n    alias?: string;\n    \n    methods: ProvidedMethodDto[];\n\n    options: OptionDto[];\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/RegistryDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ApplicationDto } from './ApplicationDto';\nimport { ServiceDto } from './ServiceDto';\nimport { Message } from '../model/Message';\nimport { MessagesNamespace } from './MessagesNamespace';\n\nexport interface RegistryDto {\n\n    messages: MessagesNamespace;\n    \n    applications: ApplicationDto[];\n    \n    services: ServiceDto[];\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/ServiceDto.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodDto } from './MethodDto';\n\nexport interface ServiceDto {\n    id: string;\n    methods: MethodDto[];\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/UrlInteropRegistryProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistryProvider } from '../InteropRegistryProvider';\nimport { Observable } from 'rxjs/Observable';\nimport { InteropRegistry } from '../model/InteropRegistry';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { HttpDataLoader } from '@plexus-interop/remote';\nimport { JsonInteropRegistryProvider } from './JsonInteropRegistryProvider';\nimport { WebSocketDataProvider } from '@plexus-interop/remote';\nimport 'rxjs/add/operator/throttleTime';\n\nexport class UrlInteropRegistryProvider implements InteropRegistryProvider {\n\n    private readonly log: Logger = LoggerFactory.getLogger('UrlInteropRegistryProvider');\n\n    private urlDataLoader: HttpDataLoader = new HttpDataLoader();\n    \n    private jsonInteropRegistryProvider: JsonInteropRegistryProvider;\n\n    private started: boolean = false;\n\n    public constructor(\n        private readonly url: string,\n        private readonly interval: number = -1,\n        private webSocketDataProvider: WebSocketDataProvider = new WebSocketDataProvider()) { }\n\n    public getRegistry(): Observable<InteropRegistry> {\n        return this.started ? this.jsonInteropRegistryProvider.getRegistry() : Observable.throw(new Error('Not started'));\n    }\n\n    public getCurrent(): InteropRegistry {\n        if (!this.started) {\n            throw new Error('Not started');\n        }\n        return this.jsonInteropRegistryProvider.getCurrent();\n    }\n\n    public async start(): Promise<void> {\n        if (this.started) {\n            return Promise.reject('Already started');\n        }\n        this.log.debug(`Starting to load metadata from [${this.url}] with ${this.interval} interval`);\n        const isWebSocket = this.url.startsWith('ws');\n        if (isWebSocket) {\n            await this.startWithWebSocket();\n        } else {\n            await this.startWithHttp();\n        }\n    }\n\n    private async startWithHttp(): Promise<void> {\n        const response = await this.urlDataLoader.fetchData(this.url);\n        if (this.interval > 0) {\n            this.jsonInteropRegistryProvider = new JsonInteropRegistryProvider(response, this.urlDataLoader.fetchWithInterval(this.url, this.interval));\n        } else {\n            this.jsonInteropRegistryProvider = new JsonInteropRegistryProvider(response);\n        }\n        this.started = true;\n    }\n\n    private async startWithWebSocket(): Promise<void> {\n        const response = await this.webSocketDataProvider.getSingleMessage(this.url);\n        if (this.interval > 0) {\n            this.jsonInteropRegistryProvider = new JsonInteropRegistryProvider(response, this.webSocketDataProvider.getData(this.url).throttleTime(this.interval));\n        } else {\n            this.jsonInteropRegistryProvider = new JsonInteropRegistryProvider(response);\n        }\n        this.started = true;\n    }\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/json/Values.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Values {\n    [key: string]: any;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Application.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConsumedService } from './ConsumedService';\nimport { ProvidedService } from './ProvidedService';\nimport { Option } from './Option';\n\nexport interface Application {\n\n    id: string;\n    \n    consumedServices: ConsumedService[];\n\n    providedServices: ProvidedService[];\n\n    options: Option[];    \n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ConsumedMethod.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Method } from './Method';\nimport { ConsumedService } from './ConsumedService';\n\nexport interface ConsumedMethod {\n    method: Method;\n    consumedService: ConsumedService;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ConsumedMethodReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface ConsumedMethodReference extends plexus.interop.protocol.IConsumedMethodReference {}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ConsumedService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Service } from './Service';\nimport { Application } from './Application';\nimport { MatchPattern } from './MatchPattern';\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { ConsumedMethod } from './ConsumedMethod';\n\nexport interface ConsumedService {\n\n    service: Service;\n\n    application: Application;\n\n    methods: ExtendedMap<string, ConsumedMethod>;\n\n    from: MatchPattern;\n\n    alias?: string;\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ConsumedServiceReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface ConsumedServiceReference {\n\n    serviceId: string;\n    \n    serviceAlias?: string;\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Enum.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Field } from './Field';\nimport { Values } from '../json/Values';\n\nexport interface Enum {\n    id: string;\n    values: Values;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Field.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Field {\n    name: string;\n    num: number;\n    primitive: boolean;\n    type: string;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/InteropRegistry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Application } from './Application';\nimport { Message } from './Message';\nimport { Service } from './Service';\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { MessagesNamespace } from '../json/MessagesNamespace';\nimport { Enum } from './Enum';\n\nexport interface InteropRegistry {\n\n    applications: ExtendedMap<string, Application>;\n\n    messages: ExtendedMap<string, Message>;\n\n    enums?: ExtendedMap<string, Enum>;\n\n    services: ExtendedMap<string, Service>;\n\n    rawMessages: MessagesNamespace;\n    \n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/MatchPattern.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface MatchPattern {\n    isMatch(id: string): boolean;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/MatchPatternFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MatchPattern } from './MatchPattern';\n\nexport class MatchPatternFactory {\n\n    private static all: MatchPattern = {\n        isMatch: () => true\n    };\n\n    public static createMatcher(patterns: string[]): MatchPattern {\n        return patterns && patterns.length > 0 ?\n            new MultipleMatchersHolder(patterns.map(p => MatchPatternFactory.createSingleMatcher(p)))\n            : MatchPatternFactory.all;\n    }\n\n    private static createSingleMatcher(pattern: string): MatchPattern {\n        if (pattern === '*') {\n            return MatchPatternFactory.all;\n        }\n        if (pattern.endsWith('*')) {\n            return new StartsWithMatcher(pattern.substr(0, pattern.length - 1));\n        }\n        return new ExactMatcher(pattern);\n    }\n\n}\n\nclass MultipleMatchersHolder implements MatchPattern {\n\n    constructor(private matchers: MatchPattern[]) { }\n\n    public isMatch(s: string): boolean {\n        return !!this.matchers.find(m => m.isMatch(s));\n    }\n\n}\n\nclass StartsWithMatcher implements MatchPattern {\n\n    constructor(private readonly base: string) { }\n\n    public isMatch(s: string): boolean {\n        return s.startsWith(this.base);\n    }\n\n}\n\nclass ExactMatcher implements MatchPattern {\n\n    constructor(private readonly base: string) { }\n\n    public isMatch(s: string): boolean {\n        return s === this.base;\n    }\n\n}\n\n"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Message.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Field } from './Field';\nimport { Fields } from '../json/Fields';\n\nexport interface Message {\n    id: string;\n    fields: Fields;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Method.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodType } from './MethodType';\nimport { Message } from './Message';\nimport { Service } from './Service';\n\nexport interface Method {\n    name: string;\n    type: MethodType;\n    requestMessage: Message;\n    responseMessage: Message;\n    service: Service;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/MethodType.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum MethodType {\n    Unary = 0,\n    ServerStreaming = 1,\n    ClientStreaming = 2,\n    DuplexStreaming = 3\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Option.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface Option {\n    id: string;\n    value: string;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ProvidedMethod.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Method } from './Method';\nimport { ProvidedService } from './ProvidedService';\nimport { Option } from './Option';\n\nexport interface ProvidedMethod {\n    method: Method;\n    providedService: ProvidedService;\n    title?: string;\n    options: Option[];\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ProvidedMethodReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface ProvidedMethodReference extends plexus.interop.protocol.IProvidedMethodReference {}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ProvidedService.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Service } from './Service';\nimport { Application } from './Application';\nimport { ProvidedMethod } from './ProvidedMethod';\nimport { MatchPattern } from './MatchPattern';\nimport { ExtendedMap } from '@plexus-interop/common';\n\nexport interface ProvidedService {\n\n    service: Service;\n\n    application: Application;\n\n    methods: ExtendedMap<string, ProvidedMethod>;\n\n    to: MatchPattern;\n\n    alias?: string;\n\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/ProvidedServiceReference.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol } from '@plexus-interop/protocol';\n\nexport interface ProvidedServiceReference extends clientProtocol.interop.protocol.IProvidedServiceReference {}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/Service.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Method } from './Method';\nimport { ExtendedMap } from '@plexus-interop/common';\n\nexport interface Service {\n    id: string;\n    serviceAlias?: string;\n    methods: ExtendedMap<string, Method>;\n}"
  },
  {
    "path": "web/packages/metadata/src/interop/model/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Application';\nexport * from './ConsumedService';\nexport * from './ConsumedServiceReference';\nexport * from './ConsumedMethod';\nexport * from './ConsumedMethodReference';\nexport * from './InteropRegistry';\nexport * from './Message';\nexport * from './Method';\nexport * from './MethodType';\nexport * from './ProvidedMethod';\nexport * from './ProvidedMethodReference';\nexport * from './ProvidedService';\nexport * from './ProvidedServiceReference';\nexport * from './Service';\nexport * from './Field';\nexport * from './Option';\nexport * from './Enum';\nexport * from './Message';"
  },
  {
    "path": "web/packages/metadata/tests/json/InteropRegistryService.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JsonInteropRegistryProvider } from '../../src/interop/json/JsonInteropRegistryProvider';\nimport { InteropRegistryService } from '../../src/interop/InteropRegistryService';\n\nconst fs = require('fs');\n\ndescribe('InteropRegistryService', () => {\n\n    const metadataJson = fs.readFileSync('tests/json/test-interop.json', 'utf8');\n\n    const registryProvider = new JsonInteropRegistryProvider(metadataJson);\n    const registry = registryProvider.getCurrent();\n    const registryService = new InteropRegistryService(registryProvider);\n    \n    it('Can retrieve app by id and alias', () => {\n        const byAlias = registryService.getApplication('echo-client');\n        const byId = registryService.getApplication('plexus.interop.testing.EchoClient');\n        expect(byAlias).toBeDefined();\n        expect(byId).toBeDefined();\n        expect(byId).toBe(byAlias);\n    });\n\n    it('Returns all provided methods', () => {\n        expect(registryService.getProvidedMethods().length).toBe(5);\n    });\n\n});"
  },
  {
    "path": "web/packages/metadata/tests/json/JsonAppRegistryProvider.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JsonAppRegistryProvider } from '../../src/apps/json/JsonAppRegistryProvider';\nimport { Application } from '../../src/apps/model/Application';\n\nconst fs = require('fs');\n\ndescribe('JsonAppRegistryProvider', () => {\n\n    const appsJson: string = fs.readFileSync('tests/json/test-apps.json', 'utf8');    \n\n    it('Can parse App Registry JSON', () => {\n\n        const sut = new JsonAppRegistryProvider(appsJson);\n        const appsRegistry = sut.getCurrent();\n\n        expect(appsRegistry.apps.size).toBe(3);\n\n        const app = appsRegistry.apps.get('plexus.interop.testing.EchoClient') as Application;\n\n        expect(app.id).toBe('plexus.interop.testing.EchoClient');\n        expect(app.displayName).toBe('Test Echo Client');\n        expect(app.launcherId).toBe('plexus.interop.testing.TestAppLauncher');\n        expect(app.launcherParams.url).toBe('http://test.domain.com');\n\n    });\n\n});"
  },
  {
    "path": "web/packages/metadata/tests/json/JsonRegistryProvider.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JsonInteropRegistryProvider } from '../../src/interop/json/JsonInteropRegistryProvider';\nimport { Message } from '../../src/interop/model/Message';\nimport { Service } from '../../src/interop/model/Service';\nimport { Method } from '../../src/interop/model/Method';\nimport { MethodType } from '../../src/interop/model/MethodType';\nimport { Application } from '../../src/interop/model/Application';\nimport { ConsumedMethod } from '../../src/interop/model/ConsumedMethod';\nimport { ProvidedMethod } from '../../src/interop/model/ProvidedMethod';\nimport { Enum } from '../../src/interop/model/Enum';\nimport { ExtendedMap } from '@plexus-interop/common';\n\nconst fs = require('fs');\n\ndescribe('JsonRegistryProvider', () => {\n\n    const metadataJson = fs.readFileSync('tests/json/test-interop.json', 'utf8');\n\n    it('Can parse metadata JSON', () => {\n\n        const sut = new JsonInteropRegistryProvider(metadataJson);\n        const registry = sut.getCurrent();\n        expect(registry).toBeTruthy();\n        expect(registry.applications.size).toBe(3);\n        expect(registry.services.size).toBe(2);\n        expect(registry.messages.size).toBeGreaterThan(1);\n\n        const message = registry.messages.get('plexus.interop.testing.EchoRequest') as Message;\n        expect(message.id).toBe('plexus.interop.testing.EchoRequest');\n        expect(message.fields.stringField.type).toBe('string');\n        expect(message.fields.int64Field.type).toBe('int64');\n        expect(message.fields.int64Field.rule).toBeFalsy();\n        expect(message.fields.repeatedDoubleField.type).toBe('double');\n        expect(message.fields.repeatedDoubleField.rule).toBe('repeated');\n\n        const subMessage = registry.messages.get('plexus.interop.testing.EchoRequest.SubMessage') as Message;\n        expect(subMessage.id).toBe('plexus.interop.testing.EchoRequest.SubMessage');\n        expect(subMessage.fields.bytesField.type).toBe('bytes');\n\n        const subEnum = (registry.enums as ExtendedMap<string, Enum>).get('plexus.interop.testing.EchoRequest.SubEnum') as Enum;\n        expect(subEnum.id).toBe('plexus.interop.testing.EchoRequest.SubEnum');\n        expect(subEnum.values.value_one).toBe(0);\n\n        const service = registry.services.get('plexus.interop.testing.EchoService') as Service;\n        expect(service.id).toBe('plexus.interop.testing.EchoService');\n        expect(service.methods.size).toBe(4);\n\n        const unaryMethod = service.methods.get('Unary') as Method;\n        expect(unaryMethod.service).toBe(service);\n        expect(unaryMethod.requestMessage).toBe(message);\n        expect(unaryMethod.responseMessage).toBe(message);\n        expect(unaryMethod.type).toBe(MethodType.Unary);\n\n        const consumerApp = registry.applications.get('plexus.interop.testing.EchoClient') as Application;\n        expect(consumerApp.consumedServices.length).toBe(1);\n\n        const consumedService = consumerApp.consumedServices[0];\n        expect(consumedService.alias).toBeUndefined();\n        expect(consumedService.application).toBe(consumerApp);\n        expect(consumedService.from.isMatch('plexus.interop.testing.EchoServer')).toBeTruthy();\n        expect(consumedService.from.isMatch('do.not.exist.EchoServer')).toBeFalsy();\n        expect(consumedService.methods.size).toBe(4);\n        expect((consumedService.methods.get('Unary') as ConsumedMethod).method).toBe(unaryMethod);\n\n        const providedApp = registry.applications.get('plexus.interop.testing.EchoServer') as Application;\n        expect(providedApp.consumedServices.length).toBe(0);\n        expect(providedApp.providedServices.length).toBe(1);\n\n        const providedService = providedApp.providedServices[0];\n        expect(providedService.methods.size).toBe(4);\n        expect(providedService.to.isMatch('plexus.interop.testing.EchoClient')).toBeTruthy();\n        expect(providedService.to.isMatch('plexus.interop.testing.EchoClient2')).toBeTruthy();\n        expect(providedService.to.isMatch('plexus.interop.do.not.exist.Client')).toBeFalsy();\n        expect(providedService.to.isMatch('plexus.interop.do.not.exist.Client')).toBeFalsy();\n        \n        const unaryProvidedMethod = providedService.methods.get('Unary') as ProvidedMethod;\n        expect(unaryProvidedMethod.method).toBe(unaryMethod);\n        expect(unaryProvidedMethod.title).toBeTruthy();\n\n        const duplexStreamingProvidedMethod = providedService.methods.get('DuplexStreaming') as ProvidedMethod;\n        expect(duplexStreamingProvidedMethod.title).toBe(null);\n\n    });\n\n});"
  },
  {
    "path": "web/packages/metadata/tests/json/test-apps.json",
    "content": "{\n  \"apps\": [\n    {\n      \"id\": \"plexus.interop.testing.TestAppLauncher\",\n      \"displayName\": \"Test App Launcher\"\n    },\n    {\n      \"id\": \"plexus.interop.testing.EchoServer\",\n      \"displayName\": \"Test Echo Server\",\n      \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n      \"launcherParams\": {}\n    },\n    {\n      \"id\": \"plexus.interop.testing.EchoClient\",\n      \"displayName\": \"Test Echo Client\",\n      \"launcherId\": \"plexus.interop.testing.TestAppLauncher\",\n      \"launcherParams\": {\n          \"url\" : \"http://test.domain.com\"\n      }\n    }\n  ]\n}"
  },
  {
    "path": "web/packages/metadata/tests/json/test-interop.json",
    "content": "{\n\t\"messages\": {\n\t  \"nested\": {\n\t    \"google\": {\n\t      \"nested\": {\n\t        \"protobuf\": {\n\t          \"options\": {\n\t            \"go_package\": \"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor\",\n\t            \"java_package\": \"com.google.protobuf\",\n\t            \"java_outer_classname\": \"DescriptorProtos\",\n\t            \"csharp_namespace\": \"Google.Protobuf.Reflection\",\n\t            \"objc_class_prefix\": \"GPB\",\n\t            \"optimize_for\": \"SPEED\"\n\t          },\n\t          \"nested\": {\n\t            \"FileDescriptorSet\": {\n\t              \"fields\": {\n\t                \"file\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FileDescriptorProto\",\n\t                  \"id\": 1\n\t                }\n\t              }\n\t            },\n\t            \"FileDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"package\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"dependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"publicDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"weakDependency\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"int32\",\n\t                  \"id\": 11,\n\t                  \"options\": {\n\t                    \"packed\": false\n\t                  }\n\t                },\n\t                \"messageType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 5\n\t                },\n\t                \"service\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ServiceDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 7\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FileOptions\",\n\t                  \"id\": 8\n\t                },\n\t                \"sourceCodeInfo\": {\n\t                  \"type\": \"SourceCodeInfo\",\n\t                  \"id\": 9\n\t                },\n\t                \"syntax\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 12\n\t                }\n\t              }\n\t            },\n\t            \"DescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"field\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"extension\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"FieldDescriptorProto\",\n\t                  \"id\": 6\n\t                },\n\t                \"nestedType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"DescriptorProto\",\n\t                  \"id\": 3\n\t                },\n\t                \"enumType\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumDescriptorProto\",\n\t                  \"id\": 4\n\t                },\n\t                \"extensionRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ExtensionRange\",\n\t                  \"id\": 5\n\t                },\n\t                \"oneofDecl\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"OneofDescriptorProto\",\n\t                  \"id\": 8\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MessageOptions\",\n\t                  \"id\": 7\n\t                },\n\t                \"reservedRange\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"ReservedRange\",\n\t                  \"id\": 9\n\t                },\n\t                \"reservedName\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"ExtensionRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"options\": {\n\t                      \"type\": \"ExtensionRangeOptions\",\n\t                      \"id\": 3\n\t                    }\n\t                  }\n\t                },\n\t                \"ReservedRange\": {\n\t                  \"fields\": {\n\t                    \"start\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"ExtensionRangeOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 3\n\t                },\n\t                \"label\": {\n\t                  \"type\": \"Label\",\n\t                  \"id\": 4\n\t                },\n\t                \"type\": {\n\t                  \"type\": \"Type\",\n\t                  \"id\": 5\n\t                },\n\t                \"typeName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 6\n\t                },\n\t                \"extendee\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"defaultValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 7\n\t                },\n\t                \"oneofIndex\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 9\n\t                },\n\t                \"jsonName\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 10\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"FieldOptions\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Type\": {\n\t                  \"values\": {\n\t                    \"TYPE_DOUBLE\": 1,\n\t                    \"TYPE_FLOAT\": 2,\n\t                    \"TYPE_INT64\": 3,\n\t                    \"TYPE_UINT64\": 4,\n\t                    \"TYPE_INT32\": 5,\n\t                    \"TYPE_FIXED64\": 6,\n\t                    \"TYPE_FIXED32\": 7,\n\t                    \"TYPE_BOOL\": 8,\n\t                    \"TYPE_STRING\": 9,\n\t                    \"TYPE_GROUP\": 10,\n\t                    \"TYPE_MESSAGE\": 11,\n\t                    \"TYPE_BYTES\": 12,\n\t                    \"TYPE_UINT32\": 13,\n\t                    \"TYPE_ENUM\": 14,\n\t                    \"TYPE_SFIXED32\": 15,\n\t                    \"TYPE_SFIXED64\": 16,\n\t                    \"TYPE_SINT32\": 17,\n\t                    \"TYPE_SINT64\": 18\n\t                  }\n\t                },\n\t                \"Label\": {\n\t                  \"values\": {\n\t                    \"LABEL_OPTIONAL\": 1,\n\t                    \"LABEL_REQUIRED\": 2,\n\t                    \"LABEL_REPEATED\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"OneofOptions\",\n\t                  \"id\": 2\n\t                }\n\t              }\n\t            },\n\t            \"EnumDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"value\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"EnumValueDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"EnumValueDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"number\": {\n\t                  \"type\": \"int32\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"EnumValueOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"ServiceDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"method\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"MethodDescriptorProto\",\n\t                  \"id\": 2\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"ServiceOptions\",\n\t                  \"id\": 3\n\t                }\n\t              }\n\t            },\n\t            \"MethodDescriptorProto\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"inputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 2\n\t                },\n\t                \"outputType\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"options\": {\n\t                  \"type\": \"MethodOptions\",\n\t                  \"id\": 4\n\t                },\n\t                \"clientStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"serverStreaming\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"FileOptions\": {\n\t              \"fields\": {\n\t                \"javaPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 1\n\t                },\n\t                \"javaOuterClassname\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                },\n\t                \"javaMultipleFiles\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenerateEqualsAndHash\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 20,\n\t                  \"options\": {\n\t                    \"deprecated\": true\n\t                  }\n\t                },\n\t                \"javaStringCheckUtf8\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 27,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"optimizeFor\": {\n\t                  \"type\": \"OptimizeMode\",\n\t                  \"id\": 9,\n\t                  \"options\": {\n\t                    \"default\": \"SPEED\"\n\t                  }\n\t                },\n\t                \"goPackage\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 11\n\t                },\n\t                \"ccGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 16,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"javaGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 17,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"pyGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 18,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"phpGenericServices\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 19,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 23,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"ccEnableArenas\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 31,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"objcClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 36\n\t                },\n\t                \"csharpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 37\n\t                },\n\t                \"swiftPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 39\n\t                },\n\t                \"phpClassPrefix\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 40\n\t                },\n\t                \"phpNamespace\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 41\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  38,\n\t                  38\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"OptimizeMode\": {\n\t                  \"values\": {\n\t                    \"SPEED\": 1,\n\t                    \"CODE_SIZE\": 2,\n\t                    \"LITE_RUNTIME\": 3\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"MessageOptions\": {\n\t              \"fields\": {\n\t                \"messageSetWireFormat\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"noStandardDescriptorAccessor\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"mapEntry\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 7\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  8,\n\t                  8\n\t                ],\n\t                [\n\t                  9,\n\t                  9\n\t                ]\n\t              ]\n\t            },\n\t            \"FieldOptions\": {\n\t              \"fields\": {\n\t                \"ctype\": {\n\t                  \"type\": \"CType\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": \"STRING\"\n\t                  }\n\t                },\n\t                \"packed\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"jstype\": {\n\t                  \"type\": \"JSType\",\n\t                  \"id\": 6,\n\t                  \"options\": {\n\t                    \"default\": \"JS_NORMAL\"\n\t                  }\n\t                },\n\t                \"lazy\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 5,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"weak\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 10,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  4,\n\t                  4\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"CType\": {\n\t                  \"values\": {\n\t                    \"STRING\": 0,\n\t                    \"CORD\": 1,\n\t                    \"STRING_PIECE\": 2\n\t                  }\n\t                },\n\t                \"JSType\": {\n\t                  \"values\": {\n\t                    \"JS_NORMAL\": 0,\n\t                    \"JS_STRING\": 1,\n\t                    \"JS_NUMBER\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"OneofOptions\": {\n\t              \"fields\": {\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumOptions\": {\n\t              \"fields\": {\n\t                \"allowAlias\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 2\n\t                },\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 3,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"reserved\": [\n\t                [\n\t                  5,\n\t                  5\n\t                ]\n\t              ]\n\t            },\n\t            \"EnumValueOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 1,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"ServiceOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ]\n\t            },\n\t            \"MethodOptions\": {\n\t              \"fields\": {\n\t                \"deprecated\": {\n\t                  \"type\": \"bool\",\n\t                  \"id\": 33,\n\t                  \"options\": {\n\t                    \"default\": false\n\t                  }\n\t                },\n\t                \"idempotencyLevel\": {\n\t                  \"type\": \"IdempotencyLevel\",\n\t                  \"id\": 34,\n\t                  \"options\": {\n\t                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n\t                  }\n\t                },\n\t                \"uninterpretedOption\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"UninterpretedOption\",\n\t                  \"id\": 999\n\t                }\n\t              },\n\t              \"extensions\": [\n\t                [\n\t                  1000,\n\t                  536870911\n\t                ]\n\t              ],\n\t              \"nested\": {\n\t                \"IdempotencyLevel\": {\n\t                  \"values\": {\n\t                    \"IDEMPOTENCY_UNKNOWN\": 0,\n\t                    \"NO_SIDE_EFFECTS\": 1,\n\t                    \"IDEMPOTENT\": 2\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"UninterpretedOption\": {\n\t              \"fields\": {\n\t                \"name\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"NamePart\",\n\t                  \"id\": 2\n\t                },\n\t                \"identifierValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 3\n\t                },\n\t                \"positiveIntValue\": {\n\t                  \"type\": \"uint64\",\n\t                  \"id\": 4\n\t                },\n\t                \"negativeIntValue\": {\n\t                  \"type\": \"int64\",\n\t                  \"id\": 5\n\t                },\n\t                \"doubleValue\": {\n\t                  \"type\": \"double\",\n\t                  \"id\": 6\n\t                },\n\t                \"stringValue\": {\n\t                  \"type\": \"bytes\",\n\t                  \"id\": 7\n\t                },\n\t                \"aggregateValue\": {\n\t                  \"type\": \"string\",\n\t                  \"id\": 8\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"NamePart\": {\n\t                  \"fields\": {\n\t                    \"namePart\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"isExtension\": {\n\t                      \"rule\": \"required\",\n\t                      \"type\": \"bool\",\n\t                      \"id\": 2\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"SourceCodeInfo\": {\n\t              \"fields\": {\n\t                \"location\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Location\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Location\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"span\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"leadingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"trailingComments\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"leadingDetachedComments\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"string\",\n\t                      \"id\": 6\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            },\n\t            \"GeneratedCodeInfo\": {\n\t              \"fields\": {\n\t                \"annotation\": {\n\t                  \"rule\": \"repeated\",\n\t                  \"type\": \"Annotation\",\n\t                  \"id\": 1\n\t                }\n\t              },\n\t              \"nested\": {\n\t                \"Annotation\": {\n\t                  \"fields\": {\n\t                    \"path\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"int32\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"sourceFile\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"begin\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"end\": {\n\t                      \"type\": \"int32\",\n\t                      \"id\": 4\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"plexus\": {\n\t      \"nested\": {\n\t        \"interop\": {\n\t          \"nested\": {\n\t            \"testing\": {\n\t              \"options\": {\n\t                \"csharp_namespace\": \"plexus\"\n\t              },\n\t              \"nested\": {\n\t                \"EchoService\": {\n\t                  \"options\": {\n\t                    \"(.interop.service_id)\": \"plexus.interop.testing.EchoService\"\n\t                  },\n\t                  \"methods\": {\n\t                    \"Unary\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"responseType\": \"EchoRequest\"\n\t                    },\n\t                    \"ServerStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"responseType\": \"EchoRequest\",\n\t                      \"responseStream\": true\n\t                    },\n\t                    \"ClientStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"requestStream\": true,\n\t                      \"responseType\": \"EchoRequest\"\n\t                    },\n\t                    \"DuplexStreaming\": {\n\t                      \"requestType\": \"EchoRequest\",\n\t                      \"requestStream\": true,\n\t                      \"responseType\": \"EchoRequest\",\n\t                      \"responseStream\": true\n\t                    }\n\t                  }\n\t                },\n\t                \"EchoRequest\": {\n\t                  \"options\": {\n\t                    \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest\"\n\t                  },\n\t                  \"fields\": {\n\t                    \"stringField\": {\n\t                      \"type\": \"string\",\n\t                      \"id\": 1\n\t                    },\n\t                    \"int64Field\": {\n\t                      \"type\": \"int64\",\n\t                      \"id\": 2\n\t                    },\n\t                    \"uint32Field\": {\n\t                      \"type\": \"uint32\",\n\t                      \"id\": 3\n\t                    },\n\t                    \"repeatedDoubleField\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"double\",\n\t                      \"id\": 4\n\t                    },\n\t                    \"enumField\": {\n\t                      \"type\": \"SubEnum\",\n\t                      \"id\": 5\n\t                    },\n\t                    \"subMessageField\": {\n\t                      \"type\": \"SubMessage\",\n\t                      \"id\": 6\n\t                    },\n\t                    \"repeatedSubMessageField\": {\n\t                      \"rule\": \"repeated\",\n\t                      \"type\": \"SubMessage\",\n\t                      \"id\": 7\n\t                    },\n\t                    \"boolField\": {\n\t                      \"type\": \"bool\",\n\t                      \"id\": 8\n\t                    }\n\t                  },\n\t                  \"nested\": {\n\t                    \"SubMessage\": {\n\t                      \"options\": {\n\t                        \"(.interop.message_id)\": \"plexus.interop.testing.EchoRequest.SubMessage\"\n\t                      },\n\t                      \"fields\": {\n\t                        \"bytesField\": {\n\t                          \"type\": \"bytes\",\n\t                          \"id\": 1\n\t                        },\n\t                        \"stringField\": {\n\t                          \"type\": \"string\",\n\t                          \"id\": 2\n\t                        }\n\t                      }\n\t                    },\n\t                    \"SubEnum\": {\n\t                      \"values\": {\n\t                        \"value_one\": 0,\n\t                        \"value_two\": 1\n\t                      }\n\t                    }\n\t                  }\n\t                }\n\t              }\n\t            }\n\t          }\n\t        }\n\t      }\n\t    },\n\t    \"interop\": {\n\t      \"options\": {\n\t        \"csharp_namespace\": \"plexus\"\n\t      },\n\t      \"nested\": {\n\t        \"messageId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MessageOptions\"\n\t        },\n\t        \"serviceId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.ServiceOptions\"\n\t        },\n\t        \"methodId\": {\n\t          \"type\": \"string\",\n\t          \"id\": 9650,\n\t          \"extend\": \"google.protobuf.MethodOptions\"\n\t        },\n\t        \"ApplicationOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ProvidedServiceOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedServiceOptions\": {\n\t          \"fields\": {}\n\t        },\n\t        \"ProvidedMethodOptions\": {\n\t          \"fields\": {\n\t            \"title\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchOnCall\": {\n\t              \"type\": \"ApplicationLaunchOnCallMode\",\n\t              \"id\": 2\n\t            },\n\t            \"timeoutMs\": {\n\t              \"type\": \"uint32\",\n\t              \"id\": 3\n\t            }\n\t          }\n\t        },\n\t        \"ConsumedMethodOptions\": {\n\t          \"fields\": {}\n\t        },\n\t        \"ApplicationLaunchOnCallMode\": {\n\t          \"options\": {\n\t            \"allow_alias\": true\n\t          },\n\t          \"values\": {\n\t            \"IF_NOT_LAUNCHED\": 0,\n\t            \"DEFAULT\": 0,\n\t            \"ALWAYS\": 1,\n\t            \"ENABLED\": 1,\n\t            \"NEVER\": 2,\n\t            \"DISABLED\": 2\n\t          }\n\t        },\n\t        \"AppLauncherService\": {\n\t          \"options\": {\n\t            \"(.interop.service_id)\": \"interop.AppLauncherService\"\n\t          },\n\t          \"methods\": {\n\t            \"Launch\": {\n\t              \"requestType\": \"AppLaunchRequest\",\n\t              \"responseType\": \"AppLaunchResponse\"\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchRequest\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchRequest\"\n\t          },\n\t          \"fields\": {\n\t            \"appId\": {\n\t              \"type\": \"string\",\n\t              \"id\": 1\n\t            },\n\t            \"launchParamsJson\": {\n\t              \"type\": \"string\",\n\t              \"id\": 2\n\t            },\n\t            \"launchMode\": {\n\t              \"type\": \"AppLaunchMode\",\n\t              \"id\": 3\n\t            },\n\t            \"suggestedAppInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 4\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchResponse\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.AppLaunchResponse\"\n\t          },\n\t          \"fields\": {\n\t            \"appInstanceId\": {\n\t              \"type\": \"UniqueId\",\n\t              \"id\": 1\n\t            }\n\t          }\n\t        },\n\t        \"UniqueId\": {\n\t          \"options\": {\n\t            \"(.interop.message_id)\": \"interop.UniqueId\"\n\t          },\n\t          \"fields\": {\n\t            \"lo\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 1\n\t            },\n\t            \"hi\": {\n\t              \"type\": \"fixed64\",\n\t              \"id\": 2\n\t            }\n\t          }\n\t        },\n\t        \"AppLaunchMode\": {\n\t          \"values\": {\n\t            \"SINGLE_INSTANCE\": 0,\n\t            \"MULTI_INSTANCE\": 1\n\t          }\n\t        }\n\t      }\n\t    }\n\t  }\n\t}\n\t,\n\t\"services\": [\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ServerStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"ClientStreaming\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"DuplexStreaming\",\n\t\t\t\t\t\"request\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"response\": \"plexus.interop.testing.EchoRequest\",\n\t\t\t\t\t\"type\": \"DuplexStreaming\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"plexus.interop.testing.EchoService\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"interop.AppLauncherService\",\n\t\t\t\"methods\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"Launch\",\n\t\t\t\t\t\"request\": \"interop.AppLaunchRequest\",\n\t\t\t\t\t\"response\": \"interop.AppLaunchResponse\",\n\t\t\t\t\t\"type\": \"Unary\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.service_id\",\n\t\t\t\t\t\"value\": \"interop.AppLauncherService\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"applications\": [\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoClient\",\n\t\t\t\"options\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"interop.alias\",\n\t\t\t\t\t\"value\": \"echo-client\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"consumes\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"plexus.interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"from\": [\n\t\t\t\t\t\t\"plexus.interop.testing.*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.EchoServer\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"plexus.interop.testing.EchoService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Unary\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Unary Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ServerStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Server Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ClientStreaming\",\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"id\": \"interop.ProvidedMethodOptions.title\",\n\t\t\t\t\t\t\t\t\t\"value\": \"Sample Client Streaming Method\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"DuplexStreaming\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"plexus.interop.testing.*\"\n\t\t\t\t\t],\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": \"interop.ProvidedServiceOptions.title\",\n\t\t\t\t\t\t\t\"value\": \"Sample Echo Service\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"plexus.interop.testing.TestAppLauncher\",\n\t\t\t\"provides\": [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"interop.AppLauncherService\",\n\t\t\t\t\t\"methods\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"Launch\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"to\": [\n\t\t\t\t\t\t\"interop.AppLifecycleManager\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "web/packages/metadata/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/metadata/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/protocol/gen-protocol.cmd",
    "content": "CALL node_modules/.bin/pbjs.cmd --no-create --no-verify --no-convert --no-delimited --force-long --target static --out src/gen/internal-client-protocol.js ../../../protocol/plexus.interop.proto\nCALL node_modules/.bin/pbts.cmd --out src/gen/internal-client-protocol.d.ts src/gen/internal-client-protocol.js\nCALL node_modules/.bin/pbjs.cmd --no-create --no-verify --no-convert --no-delimited --force-long --target static --out src/gen/internal-transport-protocol.js ../../../protocol/plexus.interop.transport.proto\nCALL node_modules/.bin/pbts.cmd --out src/gen/internal-transport-protocol.d.ts src/gen/internal-transport-protocol.js"
  },
  {
    "path": "web/packages/protocol/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/protocol\",\n  \"version\": \"0.1.0\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"Plexus Internal Protocol\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"build\": \"npm run gen-transport-protocol && npm run gen-client-protocol && yarn build:main\",\n    \"copy-gen-folder\": \"copyfiles src/gen/* dist/main\",\n    \"build:main\": \"tsc -p tsconfig.json && npm run copy-gen-folder\",\n    \"gen-client-js\": \"pbjs --force-long --no-delimited --no-beautify --no-verify --no-create -t static-module -r plexusClient -w commonjs -o src/gen/internal-client-protocol.js ../../../protocol/plexus.interop.proto\",\n    \"gen-client-ts\": \"pbts --force-long -o src/gen/internal-client-protocol.d.ts src/gen/internal-client-protocol.js\",\n    \"gen-transport-js\": \"pbjs --force-long --no-delimited --no-beautify --no-verify --no-create -t static-module -r plexusTransport -w commonjs -o src/gen/internal-transport-protocol.js ../../../protocol/plexus.interop.transport.proto\",\n    \"gen-transport-ts\": \"pbts --force-long -o src/gen/internal-transport-protocol.d.ts src/gen/internal-transport-protocol.js\",\n    \"gen-client-protocol\": \"npm run gen-client-js && npm run gen-client-ts\",\n    \"gen-transport-protocol\": \"npm run gen-transport-js && npm run gen-transport-ts\",\n    \"test\": \"jest --coverage\"\n  },\n  \"dependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"protobufjs\": \"6.11.3\",\n    \"long\": \"^4.0.0\"\n  },\n  \"peerDependencies\": {\n    \"protobufjs\": \"6.11.3\"\n  },\n  \"devDependencies\": {\n    \"@types/jest\": \"^23.1.3\",\n    \"protobufjs\": \"6.11.3\",\n    \"protobufjs-cli\": \"1.0.2\",\n    \"@types/node\": \"^7.0.5\",\n    \"trash-cli\": \"^1.4.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\",\n    \"copyfiles\": \"^1.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"espree\": \"^3.4.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/protocol/src/dto/CancelledCompletion.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { plexus } from '../gen/internal-client-protocol';\n\nexport class CancelledCompletion implements plexus.ICompletion {\n    public readonly status: plexus.Completion.Status = plexus.Completion.Status.Canceled;\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/ClientError.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {plexus} from '../gen/internal-client-protocol';\n\nexport class ClientError implements plexus.IError {\n    public constructor(\n        public readonly message: string = 'Unknown message', \n        public readonly details: string = 'Unknown details') { }\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/ClientProtocolUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { plexus } from '../gen/internal-client-protocol';\n\nexport class ClientProtocolUtils {\n\n    public static createSummarizedCompletion(...completions: plexus.ICompletion[]): plexus.ICompletion {\n        const errors: string[] = completions\n            .filter(completion => !!completion && completion.status === plexus.Completion.Status.Failed)\n            .map(completion => {\n                return completion.error || {\n                    message: `Unknown error, completion status ${status}`\n                };\n            })\n            .map(error => error.message || 'Unknown error');\n        if (errors.length > 0) {\n            return {\n                status: plexus.Completion.Status.Failed,\n                error: {\n                    message: errors.join('\\n')\n                }\n            };\n        } else {\n            return { status: plexus.Completion.Status.Completed };\n        }\n    }\n\n    public static isSuccessCompletion(completion: plexus.ICompletion): boolean {\n        return !!completion && (completion.status === undefined || completion.status === plexus.Completion.Status.Completed);\n    }\n\n    public static isCancelCompletion(completion: plexus.ICompletion): boolean {\n        return !!completion && (completion.status === plexus.Completion.Status.Canceled);\n    }\n\n    public static isErrorCompletion(completion: plexus.ICompletion): boolean {\n        return !!completion && (completion.status === plexus.Completion.Status.Failed);\n    }\n\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/Completion.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { plexus } from '../gen/internal-client-protocol';\n\nexport interface Completion extends plexus.ICompletion {}"
  },
  {
    "path": "web/packages/protocol/src/dto/ErrorCompletion.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {plexus} from '../gen/internal-client-protocol';\nimport {ClientError} from './ClientError';\n\nexport class ErrorCompletion implements plexus.ICompletion {\n\n    public readonly status: plexus.Completion.Status = plexus.Completion.Status.Failed;\n\n    constructor(public readonly error: plexus.IError = new ClientError()) {\n        this.status = plexus.Completion.Status.Failed;\n    }\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/InvocationMetaInfo.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from './UniqueId';\n\nexport interface InvocationMetaInfo extends InvocationRequestInfo {\n\n    consumerApplicationId?: string;\n\n    consumerConnectionId?: UniqueId;\n}\n\nexport interface InvocationRequestInfo {\n\n    serviceAlias?: string;\n\n    serviceId?: string;\n\n    methodId?: string;\n\n    applicationId?: string;\n\n    componentId?: string;\n\n    connectionId?: UniqueId;\n\n    applicationInstanceId?: UniqueId;\n}\n"
  },
  {
    "path": "web/packages/protocol/src/dto/SuccessCompletion.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {plexus} from '../gen/internal-client-protocol';\n\nexport class SuccessCompletion implements plexus.ICompletion {\n    public readonly status: plexus.Completion.Status = plexus.Completion.Status.Completed;\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/UniqueId.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { GUID } from '@plexus-interop/common';\nimport { plexus } from '../gen/internal-transport-protocol';\nimport * as Long from 'long';\n\nexport class UniqueId {\n\n    public lo: Long;\n    public hi: Long;\n\n    public toString(): string {\n        return `${longToString(this.hi)}${longToString(this.lo)}`;\n    }\n\n    public static generateNew(): UniqueId {\n        return UniqueId.fromGuid(new GUID());\n    }\n\n    public static fromString(str: string): UniqueId {\n        return UniqueId.fromGuid(new GUID(str));\n    }\n\n    public static fromGuid(guid: GUID): UniqueId {\n        const guidString = guid.toString().replace(/-/g, '');\n        const hiSth = guidString.substr(0, 16);\n        const loStr = guidString.substr(16, 32);\n        return UniqueId.fromProperties({\n            lo: Long.fromString(loStr, true, 16),\n            hi: Long.fromString(hiSth, true, 16)\n        });\n    }\n\n    public equals(other: UniqueId): boolean {\n        return other && other.toString() === this.toString();\n    }\n\n    public static fromProperties(props: plexus.IUniqueId): UniqueId {\n        return Object.assign(new UniqueId(), props);\n    }\n\n}\n\nfunction longToString(x: number | Long | undefined): string {\n    if (!x)\n        return 'undefined';\n\n    let s = x.toString(16).toUpperCase();\n    const pad = '0000000000000000';\n    if (s.length < pad.length)\n        s = (pad + s).slice(-pad.length);\n\n    return s;\n}"
  },
  {
    "path": "web/packages/protocol/src/dto/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './CancelledCompletion';\nexport * from './ClientError';\nexport * from './Completion';\nexport * from './ErrorCompletion';\nexport * from './SuccessCompletion';\nexport * from './ClientProtocolUtils';\nexport * from './InvocationMetaInfo';\nexport * from './UniqueId';"
  },
  {
    "path": "web/packages/protocol/src/gen/.gitignore",
    "content": "# Ignore everything in this directory\n*\n# Except this file\n!.gitignore"
  },
  {
    "path": "web/packages/protocol/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as Long from 'long';\nimport { util, configure } from 'protobufjs';\n// make sure protobufjs uses Long implementation, to keep guids compatible with .Net broker\n// https://github.com/dcodeIO/protobuf.js/issues/730\nutil.Long = Long;\nconfigure();\nexport {plexus as transportProtocol} from './gen/internal-transport-protocol';\nexport {plexus as clientProtocol} from './gen/internal-client-protocol';\nexport * from './util/ClientProtocolHelper';\nexport * from './dto';;\n"
  },
  {
    "path": "web/packages/protocol/src/util/ClientProtocolHelper.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { clientProtocol as plexus, ClientProtocolUtils } from '../.';\nimport { InvocationMetaInfo } from '../dto/InvocationMetaInfo';\nimport { UniqueId } from '../dto/UniqueId';\nimport * as Long from 'long';\nimport { Arrays } from '@plexus-interop/common';\n\nconst protocol = plexus.interop.protocol;\n\nexport class ClientProtocolHelper {\n\n    public static isSuccessCompletion(completion: plexus.ICompletion): boolean {\n        return ClientProtocolUtils.isSuccessCompletion(completion);\n    }\n\n    public static invocationInfoToConsumedMethodReference(invocationInfo: InvocationMetaInfo): plexus.interop.protocol.IConsumedMethodReference {\n        return {\n            methodId: invocationInfo.methodId,\n            consumedService: {\n                serviceId: invocationInfo.serviceId,\n                serviceAlias: invocationInfo.serviceAlias\n            }\n        };\n    }\n\n    public static invocationStartRequestPayload(invocationInfo: InvocationMetaInfo): ArrayBuffer {\n        return encodeClientToBrokerEnvelop({\n            invocationStartRequest: {\n                consumedMethod: ClientProtocolHelper.invocationInfoToConsumedMethodReference(invocationInfo)\n            }\n        });\n    }\n\n    public static discoveredInvocationStartRequestPayload(providerMethodReference: plexus.interop.protocol.IProvidedMethodReference): ArrayBuffer {\n        return encodeClientToBrokerEnvelop({\n            invocationStartRequest: {\n                providedMethod: providerMethodReference\n            }\n        });\n    }\n\n    public static connectRequestPayload(connectRequest: plexus.interop.protocol.IConnectRequest): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.ConnectRequest.encode(connectRequest).finish());\n    }\n\n    public static discoveryServiceRequestPayload(serviceDiscoveryRequest: plexus.interop.protocol.IServiceDiscoveryRequest): ArrayBuffer {\n        return encodeClientToBrokerEnvelop({\n            serviceDiscoveryRequest\n        });\n    }\n\n    public static discoveryMethodRequestPayload(methodDiscoveryRequest: plexus.interop.protocol.IMethodDiscoveryRequest): ArrayBuffer {\n        return encodeClientToBrokerEnvelop({\n            methodDiscoveryRequest\n        });\n    }\n\n    public static discoveryMethodResponsePayload(header: plexus.interop.protocol.IMethodDiscoveryResponse): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.MethodDiscoveryResponse.encode(header).finish());\n    }\n\n    public static discoveryResponsePayload(request: plexus.interop.protocol.IServiceDiscoveryResponse): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.ServiceDiscoveryResponse.encode(request).finish());\n    }\n\n    public static decodeConnectRequest(data: ArrayBuffer): plexus.interop.protocol.IConnectRequest {\n        const envelop = plexus.interop.protocol.ConnectRequest.decode(new Uint8Array(data));\n        return plexus.interop.protocol.ConnectRequest.toObject(envelop) as plexus.interop.protocol.IConnectRequest;\n    }\n\n    public static decodeMethodDiscoveryResponse(data: ArrayBuffer): plexus.interop.protocol.IMethodDiscoveryResponse {\n        const envelop = plexus.interop.protocol.MethodDiscoveryResponse.decode(new Uint8Array(data));\n        return plexus.interop.protocol.MethodDiscoveryResponse.toObject(envelop) as plexus.interop.protocol.IMethodDiscoveryResponse;\n    }\n\n    public static decodeMethodDiscoveryRequest(data: ArrayBuffer): plexus.interop.protocol.IMethodDiscoveryResponse {\n        const envelop = plexus.interop.protocol.MethodDiscoveryResponse.decode(new Uint8Array(data));\n        return plexus.interop.protocol.MethodDiscoveryResponse.toObject(envelop) as plexus.interop.protocol.IMethodDiscoveryResponse;\n    }\n\n    public static decodeServiceDiscoveryResponse(data: ArrayBuffer): plexus.interop.protocol.IServiceDiscoveryResponse {\n        const envelop = plexus.interop.protocol.ServiceDiscoveryResponse.decode(new Uint8Array(data));\n        return plexus.interop.protocol.ServiceDiscoveryResponse.toObject(envelop) as plexus.interop.protocol.IServiceDiscoveryResponse;\n    }\n\n    public static decodeServiceDiscoveryRequest(data: ArrayBuffer): plexus.interop.protocol.IServiceDiscoveryRequest {\n        const clientToBroker = ClientProtocolHelper.decodeClientToBrokerRequest(data);\n        return clientToBroker.serviceDiscoveryRequest as plexus.interop.protocol.IServiceDiscoveryRequest;\n    }\n\n    public static decodeClientToBrokerRequest(data: ArrayBuffer): plexus.interop.protocol.IClientToBrokerRequestEnvelope {\n        const envelop = plexus.interop.protocol.ClientToBrokerRequestEnvelope.decode(new Uint8Array(data));\n        return plexus.interop.protocol.ClientToBrokerRequestEnvelope.toObject(envelop) as plexus.interop.protocol.IClientToBrokerRequestEnvelope;\n    }\n\n    public static decodeConnectResponse(data: ArrayBuffer): plexus.interop.protocol.IConnectResponse {\n        const envelop = plexus.interop.protocol.ConnectResponse.decode(new Uint8Array(data));\n        return plexus.interop.protocol.ConnectResponse.toObject(envelop) as plexus.interop.protocol.IConnectResponse;\n    }\n\n    public static decodeBrokerEnvelop(data: ArrayBuffer): plexus.interop.protocol.IBrokerToClientRequestEnvelope {\n        const envelop = plexus.interop.protocol.BrokerToClientRequestEnvelope.decode(new Uint8Array(data));\n        return plexus.interop.protocol.BrokerToClientRequestEnvelope.toObject(envelop) as plexus.interop.protocol.IBrokerToClientRequestEnvelope;\n    }\n\n    public static decodeInvocationStartRequest(data: ArrayBuffer): plexus.interop.protocol.IInvocationStartRequest {\n        const envelop = plexus.interop.protocol.ClientToBrokerRequestEnvelope.decode(new Uint8Array(data));\n        const clientToBroker = plexus.interop.protocol.ClientToBrokerRequestEnvelope.toObject(envelop) as plexus.interop.protocol.IClientToBrokerRequestEnvelope;\n        return clientToBroker.invocationStartRequest as plexus.interop.protocol.IInvocationStartRequest;\n    }\n\n    public static decodeInvocationStarting(data: ArrayBuffer): plexus.interop.protocol.IInvocationStarting {\n        const envelop = plexus.interop.protocol.InvocationStarting.decode(new Uint8Array(data));\n        return plexus.interop.protocol.InvocationStarting.toObject(envelop) as plexus.interop.protocol.IInvocationStarting;\n    }\n\n    public static decodeInvocationStarted(data: ArrayBuffer): plexus.interop.protocol.IInvocationStarted {\n        const envelop = plexus.interop.protocol.InvocationStarted.decode(new Uint8Array(data));\n        return plexus.interop.protocol.InvocationStarted.toObject(envelop) as plexus.interop.protocol.IInvocationStarted;\n    }\n\n    public static connectResponsePayload(connectResponse: plexus.interop.protocol.IConnectResponse): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.ConnectResponse.encode(connectResponse).finish());\n    }\n\n    public static invocationRequestedPayload(invocationStartRequested: plexus.interop.protocol.IInvocationStartRequested): ArrayBuffer {\n        return encodeBrokerToClientEnvelop({\n            invocationStartRequested\n        });\n    }\n\n    public static messageHeaderPayload(message: plexus.interop.protocol.IInvocationMessageHeader): ArrayBuffer {\n        return encodeInvocationEnvelop({\n            message\n        });\n    }\n\n    public static messageReceivedPayload(confirmation: plexus.interop.protocol.IInvocationMessageReceived): ArrayBuffer {\n        return encodeInvocationEnvelop({\n            confirmation\n        });\n    }\n\n    public static sendCompletionPayload(sendCompletion: plexus.interop.protocol.IInvocationSendCompletion): ArrayBuffer {\n        return encodeInvocationEnvelop({\n            sendCompletion\n        });\n    }\n\n    public static invocationStartedMessagePayload(header: plexus.interop.protocol.IInvocationStarted): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.InvocationStarted.encode(header).finish());\n    }\n\n    public static invocationStartingMessagePayload(header: plexus.interop.protocol.IInvocationStarting): ArrayBuffer {\n        return Arrays.toArrayBuffer(protocol.InvocationStarting.encode(header).finish());\n    }\n\n    public static toInvocationInfo(header: plexus.interop.protocol.IInvocationStartRequested): InvocationMetaInfo {\n        return {\n            methodId: header.methodId || undefined,\n            serviceId: header.serviceId || undefined,\n            serviceAlias: header.serviceAlias || undefined,\n            consumerApplicationId: header.consumerApplicationId || undefined,\n            consumerConnectionId: UniqueId.fromProperties(header.consumerConnectionId as plexus.IUniqueId)\n        };\n    }\n\n    public static decodeInvocationEnvelop(data: ArrayBuffer): plexus.interop.protocol.IInvocationMessageEnvelope {\n        const envelop = plexus.interop.protocol.InvocationMessageEnvelope.decode(new Uint8Array(data));\n        return plexus.interop.protocol.InvocationMessageEnvelope.toObject(envelop) as plexus.interop.protocol.IInvocationMessageEnvelope;\n    }\n\n    public static longToNumber(value: Long | number): number {\n        return (value instanceof Long) ? (value as Long).toNumber() : value;\n    }\n\n}\n\nfunction encodeBrokerToClientEnvelop(header: plexus.interop.protocol.IBrokerToClientRequestEnvelope): ArrayBuffer {\n    return Arrays.toArrayBuffer(protocol.BrokerToClientRequestEnvelope.encode(header).finish());\n}\n\nfunction encodeClientToBrokerEnvelop(header: plexus.interop.protocol.IClientToBrokerRequestEnvelope): ArrayBuffer {\n    return Arrays.toArrayBuffer(protocol.ClientToBrokerRequestEnvelope.encode(header).finish());\n}\n\nfunction encodeInvocationEnvelop(header: plexus.interop.protocol.IInvocationMessageEnvelope): ArrayBuffer {\n    return Arrays.toArrayBuffer(protocol.InvocationMessageEnvelope.encode(header).finish());\n}"
  },
  {
    "path": "web/packages/protocol/tests/dto/UniqueId.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '../../src/dto/UniqueId';\n\ndescribe('UniqueId', () => {\n    it('Converts guid to string and back', () => {\n        const id = UniqueId.generateNew();\n        const strId = id.toString();\n        expect(UniqueId.fromString(strId).toString()).toBe(strId);\n    });\n    it('Converts id to 32 lengh string', () => {\n        const id = UniqueId.generateNew();\n        const strId = id.toString();\n        expect(id.toString().length).toBe(32);\n    });\n    it('fromString and toString compatible for small numbers', () => {\n        const s = \"00000000000000000000000000000001\";\n        const id = UniqueId.fromString(s);\n        const strId = id.toString();\n        expect(strId).toBe(s);\n    });\n});"
  },
  {
    "path": "web/packages/protocol/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"listFiles\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"sourceMap\": true,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\",\n            \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/remote/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/remote/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/remote\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Plexus Interop Utilities for accessing remote Services\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"build:watch\": \"tsc -w -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\"\n  },\n  \"dependencies\": {\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"superagent\": \"3.8.2\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"peerDependencies\": {\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"@types/loglevel\": \"^1.4.29\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/superagent\": \"^3.5.6\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/remote/preprocessor.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst tsc = require('typescript');\nconst tsConfig = require('./tsconfig.json');\n\nmodule.exports = {\n    process(src, path) {\n        if (path.endsWith('.ts') || path.endsWith('.tsx')) {\n            return tsc.transpile(\n                src,\n                tsConfig.compilerOptions,\n                path,\n                []\n            );\n        }\n        return src;\n    },\n};\n"
  },
  {
    "path": "web/packages/remote/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/remote/src/http/HttpDataLoader.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/throw';\nimport 'superagent';\nimport * as request from 'superagent';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\n\nexport class HttpDataLoader {\n\n    private readonly log: Logger = LoggerFactory.getLogger('HttpDataLoader');\n\n    public async fetchData(url: string): Promise<string> {\n        this.log.trace(`Fetching data from [${url}]`);\n        const response = await request.get(url).withCredentials();\n        this.log.trace(`Received response with ${response.status} status`);\n        return response.text;\n    }\n\n    public fetchWithInterval(url: string, interval: number): Observable<string> {\n        if (interval <= 0) {\n            return Observable.throw(new Error('Interval must be positive'));\n        }\n        this.log.trace(`Starting to fetch data from [${url}] using ${interval} interval`);\n        return new Observable(observer => {\n            const intervalId = setInterval(async () => {\n                try {\n                    const response = await this.fetchData(url);\n                    observer.next(response);\n                } catch (e) {\n                    this.log.error(`Error received while fetching data from ${url}`, e);\n                    observer.error(e);\n                    clearInterval(intervalId);\n                }\n                return () => clearInterval(intervalId);\n            }, interval);\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/remote/src/http/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './HttpDataLoader';\n"
  },
  {
    "path": "web/packages/remote/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './http';\nexport * from './ws';"
  },
  {
    "path": "web/packages/remote/src/ws/WebSocketDataProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observable } from 'rxjs/Observable';\nimport { webSocket } from 'rxjs/observable/dom/webSocket';\nimport { WebSocketSubjectConfig } from 'rxjs/observable/dom/WebSocketSubject';\n\nexport class WebSocketDataProvider {\n\n    public constructor(private readonly wsCtor: any = WebSocket) {}\n\n    public getData(url: string): Observable<string> {\n        return webSocket<string>(this.config(url));\n    }\n\n    public getSingleMessage(url: string): Promise<string> {\n        return new Promise<string>((resolve, reject) => {\n            let resolved = false;\n            let subscription = this.getData(url).subscribe({\n                next: (message: string) => {\n                    resolved = true;\n                    resolve(message);\n                },\n                error: e => reject(e),\n                complete: () => {\n                    if (!resolved) {\n                        reject(new Error('No data received'));\n                    }\n                }\n            });\n        });\n    }\n\n    private config(url: string): WebSocketSubjectConfig {\n        return {\n            url,\n            WebSocketCtor: this.wsCtor,\n            // override default behavior, which invokes JSON.parse\n            resultSelector: e => e.data\n        };\n    }\n\n}"
  },
  {
    "path": "web/packages/remote/src/ws/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './WebSocketDataProvider';\n"
  },
  {
    "path": "web/packages/remote/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"pretty\": true,\n        \"removeComments\": false,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/remote/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/studio/.angular-cli.json",
    "content": "{\n  \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\n  \"project\": {\n    \"name\": \"plexus-studio\"\n  },\n  \"apps\": [\n    {\n      \"root\": \"src\",\n      \"outDir\": \"dist\",\n      \"assets\": [\n        \"assets\",\n        \"favicon.ico\"\n      ],\n      \"index\": \"index.html\",\n      \"main\": \"main.ts\",\n      \"polyfills\": \"polyfills.ts\",\n      \"test\": \"test.ts\",\n      \"tsconfig\": \"tsconfig.app.json\",\n      \"testTsconfig\": \"tsconfig.spec.json\",\n      \"prefix\": \"app\",\n      \"styles\": [\n        \"./../node_modules/bootswatch/dist/yeti/bootstrap.min.css\",\n        \"./../node_modules/font-awesome/css/font-awesome.min.css\",\n        \"styles.css\"\n      ],\n      \"scripts\": [],\n      \"environmentSource\": \"environments/environment.ts\",\n      \"environments\": {\n        \"dev\": \"environments/environment.ts\",\n        \"prod\": \"environments/environment.prod.ts\"\n      }\n    }\n  ],\n  \"e2e\": {\n    \"protractor\": {\n      \"config\": \"./protractor.conf.js\"\n    }\n  },\n  \"lint\": [\n    {\n      \"project\": \"src/tsconfig.app.json\",\n      \"exclude\": \"**/node_modules/**\"\n    },\n    {\n      \"project\": \"src/tsconfig.spec.json\",\n      \"exclude\": \"**/node_modules/**\"\n    },\n    {\n      \"project\": \"e2e/tsconfig.e2e.json\",\n      \"exclude\": \"**/node_modules/**\"\n    }\n  ],\n  \"test\": {\n    \"karma\": {\n      \"config\": \"./karma.conf.js\"\n    }\n  },\n  \"defaults\": {\n    \"styleExt\": \"scss\",\n    \"component\": {}\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/.bootstraprc",
    "content": "# You can use comments here\nstyleLoaders:\n  - style-loader\n  - css-loader\n  - sass-loader\n\nstyles:\n  normalize: true\n  print: true\n\nscripts:\n  alert: true\n  button: true"
  },
  {
    "path": "web/packages/studio/.editorconfig",
    "content": "# Editor configuration, see http://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.md]\nmax_line_length = off\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": "web/packages/studio/.gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist\n/tmp\n/out-tsc\n\n# dependencies\n/node_modules\n\n# IDEs and editors\n/.idea\n.project\n.classpath\n.c9/\n*.launch\n.settings/\n*.sublime-workspace\n\n# IDE - VSCode\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n\n# misc\n/.sass-cache\n/connect.lock\n/coverage\n/libpeerconnection.log\nnpm-debug.log\ntestem.log\n/typings\n\n# e2e\n/e2e/*.js\n/e2e/*.map\n\n# System Files\n.DS_Store\nThumbs.db\n"
  },
  {
    "path": "web/packages/studio/.vscode/launch.json",
    "content": "{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"node\",\n            \"request\": \"launch\",\n            \"name\": \"Jest Tests\",\n            \"program\": \"${workspaceRoot}\\\\..\\\\..\\\\node_modules\\\\jest\\\\bin\\\\jest.js\",\n            \"args\": [\n                \"-i\"\n            ],\n            \"internalConsoleOptions\": \"openOnSessionStart\",\n            \"outFiles\": [\n                \"${workspaceRoot}/out-tsc/**/*\"\n            ]\n        }\n    ]\n}"
  },
  {
    "path": "web/packages/studio/README.md",
    "content": "# Plexus Interop Studio\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.0.\n\n## Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n"
  },
  {
    "path": "web/packages/studio/karma.conf.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n  config.set({\n    basePath: '',\n    frameworks: ['jasmine', '@angular/cli'],\n    plugins: [\n      require('karma-jasmine'),\n      require('karma-chrome-launcher'),\n      require('karma-jasmine-html-reporter'),\n      require('karma-coverage-istanbul-reporter'),\n      require('@angular/cli/plugins/karma')\n    ],\n    client:{\n      clearContext: false // leave Jasmine Spec Runner output visible in browser\n    },\n    coverageIstanbulReporter: {\n      reports: [ 'html', 'lcovonly' ],\n      fixWebpackSourcePaths: true\n    },\n    angularCli: {\n      environment: 'dev'\n    },\n    reporters: ['progress', 'kjhtml'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['Chrome'],\n    singleRun: false\n  });\n};\n"
  },
  {
    "path": "web/packages/studio/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/studio\",\n  \"version\": \"0.1.0\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"ng\": \"ng\",\n    \"start\": \"ng serve\",\n    \"prebuild\": \"npm run test\",\n    \"build\": \"ng build && npm run copy-to-bin\",\n    \"test\": \"jest\",\n    \"lint\": \"echo 'Not implemented'\",\n    \"copy-to-bin\": \"copyfiles dist/* ../../../bin/win-x86/broker/studio -u 1\",\n    \"clear-jest\": \"jest --clearCache\",\n    \"e2e\": \"ng e2e\"\n  },\n  \"dependencies\": {\n    \"@angular/animations\": \"^5.0.0\",\n    \"@angular/common\": \"^5.0.0\",\n    \"@angular/compiler\": \"^5.0.0\",\n    \"@angular/core\": \"^5.0.0\",\n    \"@angular/forms\": \"^5.0.0\",\n    \"@angular/http\": \"^5.0.0\",\n    \"@angular/platform-browser\": \"^5.0.0\",\n    \"@angular/platform-browser-dynamic\": \"^5.0.0\",\n    \"@angular/router\": \"^5.0.0\",\n    \"@ng-bootstrap/ng-bootstrap\": \"^1.0.0\",\n    \"@ngrx/effects\": \"^4.1.1\",\n    \"@ngrx/router-store\": \"^4.1.1\",\n    \"@ngrx/store\": \"^4.1.1\",\n    \"@ngrx/store-devtools\": \"^4.1.1\",\n    \"@plexus-interop/broker\": \"0.1.0\",\n    \"@plexus-interop/io\": \"0.1.0\",\n    \"@plexus-interop/metadata\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/client-api\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"@types/core-js\": \"^0.9.43\",\n    \"arraybuffer-slice\": \"^0.1.2\",\n    \"bootstrap\": \"^4.1.0\",\n    \"bootswatch\": \"^4.1.0\",\n    \"core-js\": \"^2.5.3\",\n    \"font-awesome\": \"^4.7.0\",\n    \"typescript-collections\": \"1.2.3\",\n    \"redux\": \"^3.7.2\",\n    \"redux-logger\": \"^3.0.6\",\n    \"rxjs\": \"^5.5.2\",\n    \"zone.js\": \"^0.8.14\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@angular/cli\": \"1.6.5\",\n    \"@angular/compiler-cli\": \"^5.0.0\",\n    \"@angular/language-service\": \"^5.0.0\",\n    \"@types/core-js\": \"^0.9.43\",\n    \"@types/jasmine\": \"~2.5.53\",\n    \"@types/jasminewd2\": \"~2.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/node\": \"^7.0.5\",\n    \"@types/rx\": \"^4.1.1\",\n    \"codelyzer\": \"^4.0.1\",\n    \"copyfiles\": \"^1.2.0\",\n    \"jasmine-core\": \"~2.6.2\",\n    \"jasmine-spec-reporter\": \"~4.1.0\",\n    \"jest\": \"^23.5.0\",\n    \"jest-preset-angular\": \"^6.0.0\",\n    \"karma\": \"^1.7.1\",\n    \"karma-chrome-launcher\": \"^2.2.0\",\n    \"karma-cli\": \"~1.0.1\",\n    \"karma-coverage-istanbul-reporter\": \"^1.2.1\",\n    \"karma-jasmine\": \"~1.1.0\",\n    \"karma-jasmine-html-reporter\": \"^0.2.2\",\n    \"protractor\": \"~5.1.2\",\n    \"ts-node\": \"~3.2.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"prr\": \"1.0.1\"\n  },\n  \"jest\": {\n    \"preset\": \"jest-preset-angular\",\n    \"roots\": [\n      \"<rootDir>/src/\"\n    ],\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/src/setup-jest.ts\",\n    \"transform\": {\n      \"^.+\\\\.(ts|js|html)$\": \"<rootDir>/node_modules/jest-preset-angular/preprocessor.js\"\n    },\n    \"snapshotSerializers\": [\n      \"<rootDir>/node_modules/jest-preset-angular/AngularSnapshotSerializer.js\",\n      \"<rootDir>/node_modules/jest-preset-angular/HTMLCommentSerializer.js\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/protractor.conf.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Protractor configuration file, see link for more information\n// https://github.com/angular/protractor/blob/master/lib/config.ts\n\nconst { SpecReporter } = require('jasmine-spec-reporter');\n\nexports.config = {\n  allScriptsTimeout: 11000,\n  specs: [\n    './e2e/**/*.e2e-spec.ts'\n  ],\n  capabilities: {\n    'browserName': 'chrome'\n  },\n  directConnect: true,\n  baseUrl: 'http://localhost:4200/',\n  framework: 'jasmine',\n  jasmineNodeOpts: {\n    showColors: true,\n    defaultTimeoutInterval: 30000,\n    print: function() {}\n  },\n  onPrepare() {\n    require('ts-node').register({\n      project: 'e2e/tsconfig.e2e.json'\n    });\n    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));\n  }\n};\n"
  },
  {
    "path": "web/packages/studio/src/app/app-list/app-list.component.css",
    "content": ""
  },
  {
    "path": "web/packages/studio/src/app/app-list/app-list.component.html",
    "content": "<div class=\"container\">\n  <div class=\"row\">\n    <div class=\"col-md-12\">\n      <div id=\"apps-search-input-group\" class=\"pb-3\">\n        <div class=\"input-group col-md-12\">\n          <input type=\"text\" [value]=\"searchFilterValue | async\" [formControl]=\"searchFilterControl\" class=\"form-control input-lg\" placeholder=\"Search applications...\" />\n        </div>\n      </div>\n    </div>\n  </div>\n  <div class=\"list-group\">\n    <a id=\"app-item {{app.id}}\" class=\"list-group-item list-group-item-action\" *ngFor=\"let app of apps | async\" (click)=\"connectToApp(app)\">{{app.label}}</a>\n  </div>\n</div>\n"
  },
  {
    "path": "web/packages/studio/src/app/app-list/app-list.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SubscriptionsRegistry } from './../services/ui/SubscriptionsRegistry';\nimport { OnDestroy } from '@angular/core';\nimport { LoggerFactory } from '@plexus-interop/common';\nimport { Application } from '@plexus-interop/metadata';\nimport { Observable } from 'rxjs/Observable';\nimport { AppActions } from '../services/ui/AppActions';\nimport { Component, OnInit } from '@angular/core';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { FormControl } from '@angular/forms';\nimport 'rxjs/add/operator/debounceTime';\nimport { containsFilter } from '../services/ui/filters';\n\ninterface AppUiInfo extends Application {\n  label: string;\n}\n\n@Component({\n  selector: 'app-app-list',\n  templateUrl: './app-list.component.html',\n  styleUrls: ['./app-list.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class AppListComponent implements OnInit, OnDestroy {\n\n  apps: Observable<AppUiInfo[]>;\n\n  searchFilterValue: Observable<string>;\n\n  searchFilterControl: FormControl = new FormControl(\"\");\n\n  private logger = LoggerFactory.getLogger(AppListComponent.name);\n\n  constructor(\n    private actions: AppActions,\n    private store: Store<fromRoot.State>,\n    private router: Router,\n    private activatedRoute: ActivatedRoute,\n    private subsctiptionsRegistry: SubscriptionsRegistry) { }\n\n  ngOnInit() {\n    this.searchFilterValue = this.store\n      .select(state => state.plexus.appsFilter || '');\n    this.apps = this.store\n      .select(state => this.applyFilter(state.plexus.apps, state.plexus.appsFilter))\n      .map(this.sortApps.bind(this))\n      .map(this.sortApps.bind(this))\n      .map(this.toAppInfos.bind(this));\n    this.subsctiptionsRegistry.add(\n      this.activatedRoute.queryParams\n        .combineLatest(this.apps)\n        .subscribe(([params, apps]) => {\n          const appId = params['appId'];\n          if (appId) {\n            const expectedApp = apps.find(app => app.id === appId);\n            if (!expectedApp) {\n              this.logger.warn(`Params provided app with Id='${appId}' not found. Please, select from the list`);\n            } else {\n              this.connectToApp(expectedApp);\n            }\n          }\n        }));\n    this.subsctiptionsRegistry.add(this.searchFilterControl\n      .valueChanges\n      .debounceTime(150)\n      .subscribe(newFilter => {\n        this.store.dispatch({ type: AppActions.APPS_FILTER_UPDATED, payload: newFilter });\n      }));\n  }\n\n  sortApps(apps: Application[]): Application[] {\n    return apps.sort((a, b) => {\n      return a.id.localeCompare(b.id);\n    });\n  }\n\n  applyFilter(apps: Application[], filter?: string): Application[] {\n    return apps.filter(a => containsFilter(a.id, filter));\n  }\n\n  toAppInfo(app: Application): AppUiInfo {\n    return {\n      ...app,\n      label: app.id\n    };\n  }\n\n  toAppInfos(apps: Application[]): AppUiInfo[] {\n    return apps.map(this.toAppInfo);\n  }\n\n  ngOnDestroy() {\n    this.subsctiptionsRegistry.unsubscribeAll();\n  }\n\n  connectToApp(app: Application) {\n    this.store.dispatch({ type: AppActions.CONNECT_TO_APP_START, payload: app });\n  }\n\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/app-services/app-services.component.css",
    "content": ""
  },
  {
    "path": "web/packages/studio/src/app/app-services/app-services.component.html",
    "content": "<div class=\"row\">\n    <div class=\"col-md-12\">\n      <div id=\"apps-search-input-group\" class=\"pb-3\">\n        <div class=\"input-group col-md-12\">\n          <input type=\"text\" [value]=\"searchFilterValue | async\" [formControl]=\"searchFilterControl\" class=\"form-control input-lg\" placeholder=\"Search services...\" />\n        </div>\n      </div>\n    </div>\n</div>\n<div class=\"row\">\n  <div class=\"col-sm-6\">\n    <h5>Consumed services</h5>\n    <div class=\"p-2\">\n      <div *ngFor=\"let consumedService of consumedServices | async\">\n        <span id=\"consumed-service-header-{{consumedService?.service.id}}\">{{consumedService?.service.id}}</span><span *ngIf=\"consumedService?.alias\">({{consumedService?.alias}})</span>\n        <div class=\"list-group mt-2\">\n          <a id=\"consumed-action-item-{{method?.method.name}}\" class=\"list-group-item list-group-item-action\" *ngFor=\"let method of getMethodsArray(consumedService)\"\n            (click)=\"openConsumed(method)\">{{method?.method.name}}</a>\n        </div>\n      </div>\n    </div>\n  </div>\n  <div class=\"col-sm-6\">\n    <h5>Provided services</h5>\n    <div class=\"p-2\">\n      <div *ngFor=\"let providedService of providedServices | async\">\n        <span id=\"provided-service-header-{{providedService?.service.id}}{{providedService?.alias}}\">{{providedService?.service.id}}</span><span *ngIf=\"providedService?.alias\">({{providedService?.alias}})</span>\n        <div class=\"list-group mt-2\">\n          <a id=\"provided-action-item-{{method?.method.name}}\" class=\"list-group-item list-group-item-action\" *ngFor=\"let method of getMethodsArray(providedService)\"\n            (click)=\"openProvided(method)\">{{method?.method.name}}</a>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "web/packages/studio/src/app/app-services/app-services.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observable } from 'rxjs/Observable';\nimport { StudioState } from '../services/ui/AppModel';\nimport { SubscriptionsRegistry } from '../services/ui/SubscriptionsRegistry';\nimport { InteropClientFactory } from '../services/core/InteropClientFactory';\nimport { AppActions } from '../services/ui/AppActions';\nimport { Component, OnInit } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { App, ConsumedService, ProvidedService, ConsumedMethod, InteropRegistryService } from '@plexus-interop/metadata';\nimport 'rxjs/add/operator/concat';\nimport 'rxjs/add/observable/of';\nimport { FormControl } from '@angular/forms';\nimport { containsFilter } from '../services/ui/filters';\n\n@Component({\n  selector: 'app-services',\n  templateUrl: './app-services.component.html',\n  styleUrls: ['./app-services.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class AppServicesComponent implements OnInit {\n\n  constructor(\n    private store: Store<fromRoot.State>,\n    private actions: AppActions,\n    private router: Router,\n    private interopClientFactory: InteropClientFactory,\n    private subscribtions: SubscriptionsRegistry) {\n  }\n\n  consumedServices: Observable<ConsumedService[]> = Observable.of([]);\n  providedServices: Observable<ProvidedService[]> = Observable.of([]);\n  searchFilterValue: Observable<string>;\n  searchFilterControl: FormControl = new FormControl(\"\");\n\n  subscriptions: SubscriptionsRegistry;\n  registryService: InteropRegistryService;\n\n  public ngOnInit(): void {\n    this.searchFilterValue = this.store\n      .select(state => state.plexus.serviceFilter || '');\n    this.consumedServices = this.store\n      .select(state => state.plexus)\n      .map(state => {\n        if (!state.connectedApp) {\n          return [];\n        }\n        const services = state.services;\n        const app = state.connectedApp;\n        return services.interopRegistryService\n          .getConsumedServices(app.id).filter(s => containsFilter(s.service.id, state.serviceFilter));\n      });\n    this.providedServices = this.store\n      .select(state => state.plexus)\n      .map(state => {\n        if (!state.connectedApp) {\n          return [];\n        }\n        const services = state.services;\n        const app = state.connectedApp;\n        return services.interopRegistryService.getProvidedServices(app.id)\n          .filter(s => containsFilter(s.service.id, state.serviceFilter));\n      });\n    this.subscribtions.add(this.searchFilterControl\n      .valueChanges\n      .debounceTime(150)\n      .subscribe(newFilter => {\n        this.store.dispatch({ type: AppActions.SERVICE_FILTER_UPDATED, payload: newFilter });\n      }));\n  }\n\n  openProvided(method) {\n    this.store.dispatch({ type: AppActions.SELECT_PROVIDED_METHOD, payload: method });\n    this.router.navigate(['/provided']);\n  }\n\n  openConsumed(method: ConsumedMethod) {\n    this.store.dispatch({ type: AppActions.SELECT_CONSUMED_METHOD, payload: method });\n  }\n\n  getMethodsArray(service: ProvidedService | ConsumedService) {\n    return service.methods.valuesArray();\n  }\n\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/app.component.css",
    "content": ".header {\n    flex: 0 0 auto;\n}\n\n.app-content {\n    flex: 1 1 100%;\n}\n\n.footer {\n    flex: 0 0 auto;\n    max-height: 400px;\n}\n\n#plexus-logs-area {\n    font-size: small;\n}"
  },
  {
    "path": "web/packages/studio/src/app/app.component.html",
    "content": "<div class=\"container p-lg-3 flex-fill flex-flow-column\">\n\n  <app-header class=\"header\"></app-header>\n\n  <div class=\"pt-lg-3 app-content\">\n    <router-outlet></router-outlet>\n    <hr>\n    <div class=\"form-group footer\">\n      <div class=\"row\">\n        <div class=\"form-group col-sm-12\">\n          <label for=\"plexus-logs-area\">Plexus Logs:</label>\n          <textarea #plexusLogsArea id=\"plexus-logs-area\" disabled=\"disabled\" class=\"form-control\" rows=\"12\" [(ngModel)]=\"plexusLogs\"></textarea>\n        </div>\n      </div>\n      <div class=\"row\">\n        <div class=\"form-group col-sm-2\">\n          <button id=\"clear-plexus-logs-btn\" class=\"btn btn-link\" type=\"button\" (click)=\"clearLogs()\">Clear</button>\n        </div>\n        <div class=\"form-group col-sm-2\">\n          <input type=\"checkbox\" class=\"form-check-input\" id=\"autoScrollCheckBox\" [(ngModel)]=\"autoScrollEnabled\">          \n          <label class=\"form-check-label\" for=\"autoScrollCheckBox\">Auto-Scroll Logs</label>\n        </div>\n        <div class=\"form-group col-sm-2\">\n            <input type=\"checkbox\" class=\"form-check-input\" id=\"logsCheckBox\" [(ngModel)]=\"logsEnabled\">          \n            <label class=\"form-check-label\" for=\"logsCheckBox\">Enable Logs</label>\n          </div>\n      </div>\n    </div>\n  </div>\n</div>"
  },
  {
    "path": "web/packages/studio/src/app/app.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AppActions } from './services/ui/AppActions';\nimport { Store } from '@ngrx/store';\nimport { LoggerFactory, LogLevel, Logger, TimeUtils } from '@plexus-interop/common';\nimport { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';\nimport { ElementRef, Renderer2 } from '@angular/core';\nimport { State } from './services/ui/RootReducers';\nimport { AfterViewChecked } from '@angular/core/src/metadata/lifecycle_hooks';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\nexport class AppComponent implements OnInit, OnDestroy, AfterViewChecked {\n\n  @ViewChild('plexusLogsArea') logsTextArea: ElementRef;\n\n  title = 'Plexus Studio';\n  plexusLogs = '';\n  autoScrollEnabled: boolean = true;\n  logsEnabled: boolean = true;\n\n  constructor(private store: Store<State>) { }\n\n  private loggerDelegateRegistration: { unregister: () => void };\n\n  private logger: Logger;\n\n  public ngOnInit(): void {\n    LoggerFactory.setLogLevel(LogLevel.INFO);\n    this.loggerDelegateRegistration = this.createUiLoggerDelegate();\n    this.logger = LoggerFactory.getLogger();\n    this.logger.info('Welcome to Plexus Studio!');\n    this.logger.info('Trying to detect connection to Plexus ...');\n    this.store.dispatch({ type: AppActions.AUTO_CONNECT });\n  }\n\n  public ngAfterViewChecked(): void {\n    if (this.autoScrollEnabled) {\n      this.scrollLogsBottom();\n    }\n  }\n\n  public ngOnDestroy(): void {\n    this.loggerDelegateRegistration.unregister();\n  }\n\n  public scrollLogsBottom(): void {\n    try {\n      this.logsTextArea.nativeElement.scrollTop = this.logsTextArea.nativeElement.scrollHeight;\n    } catch (e) {\n      console.log('Unable to scroll', e);\n    }\n  }\n\n  public clearLogs(): void {\n    this.plexusLogs = '';\n  }\n\n  private filterEmptyArgs(arr: any[]): any[] {\n    arr = arr || [];\n    return arr.filter(el => !!el && !(Array.isArray(el) && el.length === 0));\n  }\n\n  private createUiLoggerDelegate(): { unregister: () => void } {\n    return LoggerFactory.registerDelegate({\n      log: (logLevel: LogLevel, msg: string, args: any[]) => {\n        if (!this.logsEnabled) {\n          return;\n        }\n        if (logLevel <= LogLevel.DEBUG) {\n          // Too many logs in output\n          return;\n        }\n        let message = `[${TimeUtils.format(new Date())}] ${LogLevel[logLevel]} ${msg}`;\n        args = this.filterEmptyArgs(args);\n        if (args.length > 0) {\n          message += '\\nArguments: ' + JSON.stringify(args);\n        }\n        if (this.plexusLogs) {\n          this.plexusLogs = `${this.plexusLogs}\\n${message}`;\n        } else {\n          this.plexusLogs = message;\n        }\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/app.module.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CustomRouterStateSerializer } from './services/AppUtils';\nimport { TransportConnectionFactory } from './services/core/TransportConnectionFactory';\nimport { InteropClientFactory } from './services/core/InteropClientFactory';\nimport { InteropServiceFactory } from './services/core/InteropServiceFactory';\nimport { metaReducers } from './services/ui/RootReducers';\nimport { AppActions } from './services/ui/AppActions';\nimport { AppRoutes } from './app.routing';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { AppComponent } from './app.component';\nimport { MetadataLoaderComponent } from './metadata-loader/metadata-loader.component';\nimport { NgbModule } from '@ng-bootstrap/ng-bootstrap';\nimport { RouterModule } from '@angular/router';\nimport { AppListComponent } from './app-list/app-list.component';\nimport { HeaderComponent } from './header/header.component';\n\nimport { reducers } from './services/ui/RootReducers';\nimport { AppServicesComponent } from './app-services/app-services.component';\nimport { ConsumedServiceComponent } from './consumed-service/consumed-service.component';\nimport { ProvidedServiceComponent } from './provided-service/provided-service.component';\n\nimport { StoreModule } from '@ngrx/store';\n\nimport { EffectsModule } from '@ngrx/effects';\nimport { Effects } from './services/ui/AppEffects';\nimport { HttpModule } from '@angular/http';\n\nimport {\n  StoreRouterConnectingModule,\n  RouterStateSerializer,\n} from '@ngrx/router-store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { LocationStrategy, HashLocationStrategy } from '@angular/common';\n\n@NgModule({\n  declarations: [\n    AppComponent,\n    MetadataLoaderComponent,\n    AppListComponent,\n    HeaderComponent,\n    AppServicesComponent,\n    ConsumedServiceComponent,\n    ProvidedServiceComponent\n  ],\n  imports: [\n    BrowserModule,\n    NgbModule.forRoot(),\n    FormsModule,\n    ReactiveFormsModule,\n    RouterModule.forRoot(AppRoutes),\n    StoreModule.forRoot(reducers, { metaReducers }),\n    EffectsModule.forRoot([Effects]),\n    HttpModule\n  ],\n  providers: [\n    AppActions,\n    InteropServiceFactory,\n    InteropClientFactory,\n    TransportConnectionFactory,\n    {\n      provide: LocationStrategy,\n      useClass: HashLocationStrategy\n    }\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/app.routing.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedServiceComponent } from './provided-service/provided-service.component';\nimport { ConsumedServiceComponent } from './consumed-service/consumed-service.component';\nimport { AppServicesComponent } from './app-services/app-services.component';\nimport { AppListComponent } from './app-list/app-list.component';\nimport { MetadataLoaderComponent } from './metadata-loader/metadata-loader.component';\nimport { Routes } from '@angular/router';\n\nexport const AppRoutes: Routes = [\n  { path: '', component: MetadataLoaderComponent },\n  { path: 'index.html', component: MetadataLoaderComponent },\n  { path: 'apps', component: AppListComponent, resolve: [] },\n  { path: 'app', component: AppServicesComponent },\n  { path: 'consumed', component: ConsumedServiceComponent },\n  { path: 'provided', component: ProvidedServiceComponent }\n];\n"
  },
  {
    "path": "web/packages/studio/src/app/consumed-service/consumed-service.component.css",
    "content": ""
  },
  {
    "path": "web/packages/studio/src/app/consumed-service/consumed-service.component.html",
    "content": "<div class=\"form-group\">\n  <h5>\n    <p>{{title}}</p>\n  </h5>\n  <div class=\"container\">\n    <div class=\"row\">\n      <div class=\"col\">\n        <div>\n          <label for=\"exampleFormControlTextarea1\">Enter Request JSON:</label>\n          <textarea id=\"message-content-area\" [class.is-invalid]=\"messageContentControl && messageContentControl.invalid\" class=\"form-control\"\n            rows=\"8\" [(ngModel)]=\"messageContent\" [formControl]=\"messageContentControl\"></textarea>\n          <div *ngIf=\"messageContentControl && messageContentControl.invalid\" class=\"invalid-feedback\">\n            {{messageContentControl.errors.messageContentControl}}\n          </div>\n          <button id=\"format-content-btn\" [disabled]=\"messageContentControl && messageContentControl.invalid\" class=\"btn btn-link\"\n            type=\"button\" (click)=\"formatAndUpdateArea()\">Format content</button>\n          <button id=\"default-msg-btn\" class=\"btn btn-link\" type=\"button\" (click)=\"createDefaultMessage()\">Default</button>\n        </div>\n      </div>\n    </div>\n  </div>\n\n  <div class=\"form-group\" [hidden]=\"!isClientStreaming()\">\n    <label for=\"messages-count\">Enter messages number:</label>\n    <input id=\"messages-count\" class=\"form-control\" [(ngModel)]=\"messagesToSend\">\n  </div>\n\n  <div class=\"form-group\" [hidden]=\"!isClientStreaming()\">\n    <label for=\"messages-interval\">Enter interval between messages (ms):</label>\n    <input id=\"messages-interval\" class=\"form-control\" [(ngModel)]=\"messagesPeriodInMillis\">\n  </div>\n\n  <div>\n    <div class=\"form-group\">\n      <label for=\"exampleSelect1\">Target app:</label>\n      <select id=\"target-app-dropdown\" class=\"form-control\" [(ngModel)]=\"selectedDiscoveredMethod\">\n        <option id=\"target-app-option-{{discoveredMethod.providedMethod.providedService.applicationId}}\" *ngFor=\"let discoveredMethod of discoveredMethods\"\n          [ngValue]=\"discoveredMethod\">\n          {{label(discoveredMethod)}}\n        </option>\n      </select>\n    </div>\n  </div>\n\n  <button class=\"btn btn-primary\" [disabled]=\"messageContentControl && messageContentControl.invalid\" id=\"consumedInvokeBtn\"\n    (click)=\"sendRequest()\" type=\"button\">Send</button>\n  <button class=\"btn btn-primary\" \n    id=\"cancelBtn\" \n    [disabled]=\"!hasRunningInvocations()\" \n    (click)=\"cancelLatestInvocation()\" \n    title=\"Cancel Latest started invocation\" \n    type=\"button\">Cancel</button>\n  <button class=\"btn btn-primary\" id=\"consumedDiscoverBtn\" (click)=\"discoverMethods()\" type=\"button\">Discover</button>"
  },
  {
    "path": "web/packages/studio/src/app/consumed-service/consumed-service.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropClient } from '../services/core/InteropClient';\nimport { Component, OnInit, OnDestroy } from '@angular/core';\nimport { AppActions } from '../services/ui/AppActions';\nimport { Store } from '@ngrx/store';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { SubscriptionsRegistry } from '../services/ui/SubscriptionsRegistry';\nimport { ConsumedMethod } from '@plexus-interop/metadata';\nimport { DiscoveredMethod, MethodType, StreamingInvocationClient, ConsumedService, InvocationClient } from '@plexus-interop/client';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory, pop, uniqueId } from '@plexus-interop/common';\nimport { createInvocationLogger } from '../services/core/invocation-utils';\nimport { FormControl } from '@angular/forms';\nimport { plexusMessageValidator } from '../services/ui/validators';\n\ntype InvocationProfile = {\n  id: string,\n  client: InvocationClient,\n  logger: Logger,\n  started: number\n};\n\n@Component({\n  selector: 'app-consumed-service',\n  templateUrl: './consumed-service.component.html',\n  styleUrls: ['./consumed-service.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class ConsumedServiceComponent implements OnInit, OnDestroy {\n\n  private readonly log: Logger = LoggerFactory.getLogger('ConsumedServiceComponent');\n\n  private interopClient: InteropClient;\n  public discoveredMethods: DiscoveredMethod[];\n  private consumedMethod: ConsumedMethod;\n  public title: string;\n\n  private activeInvocationsMap: Map<string, InvocationProfile> = new Map();\n  private selectedDiscoveredMethod: DiscoveredMethod;\n\n  messageContent: string;\n  messageContentControl: FormControl = new FormControl('{}');\n\n  messagesToSend: number = 1;\n  messagesPeriodInMillis: number = 200;\n\n  constructor(\n    private store: Store<fromRoot.State>,\n    private subscriptions: SubscriptionsRegistry) {\n  }\n\n  ngOnInit() {\n    this.messageContent = ''\n    const consumedMethod$ = this.store\n      .filter(state => !!state.plexus.consumedMethod)\n      .map(state => state.plexus);\n\n    this.subscriptions.add(\n      consumedMethod$\n        .filter(state => !!state.consumedMethod && !!state.services.interopClient)\n        .subscribe(state => {\n          this.selectedDiscoveredMethod = undefined;\n          this.interopClient = state.services.interopClient;\n          this.discoveredMethods = state.consumedMethod.discoveredMethods.methods;\n          this.consumedMethod = state.consumedMethod.method;\n          this.title = this.getTitle(this.consumedMethod);\n          this.createDefaultMessage();\n          this.messageContentControl.setValidators([\n            plexusMessageValidator('messageContentControl', this.interopClient, this.consumedMethod)\n          ]);\n        }));\n  }\n\n  ngOnDestroy() {\n    this.subscriptions.unsubscribeAll();\n  }\n\n  getTitle(consumedMethod: ConsumedMethod): string {\n    return `Consumed Method - ${consumedMethod.consumedService.service.id}${this.getLabel(consumedMethod.consumedService.service)}.${consumedMethod.method.name}`;\n  }\n\n  getLabel(service: ConsumedService): string {\n    return !!service.serviceAlias ? `(${service.serviceAlias})` : '';\n  }\n\n  handleResponse(responseJson: string, logger: Logger, started: number) {\n    logger.info(\n      `Message received after ${new Date().getTime() - started}ms:\n      ${responseJson}`);\n  }\n\n  handleError(e: any, logger: Logger, invocationId: string) {\n    logger.error('Error received', e);\n    this.clearInvocationProfile(invocationId);\n  }\n\n  handleCompleted(logger: Logger, invocationId: string) {\n    logger.info('Invocation completed received');\n    this.clearInvocationProfile(invocationId);\n  }\n\n  handleStreamCompleted(logger: Logger) {\n    logger.info('Remote stream completed received');\n  }\n\n  private clearInvocationProfile(invocationId: string) {\n    const profile = this.activeInvocationsMap.get(invocationId);\n    if (profile) {\n      profile.logger.info('Invocation profile cleared');\n      this.activeInvocationsMap.delete(invocationId);\n    }\n  }\n\n  async discoverMethods() {\n    const discovered = await this.interopClient.discoverAllMethods(this.consumedMethod);\n    this.store.dispatch({ type: AppActions.DISCOVER_METHODS_SUCCESS, payload: discovered });\n  }\n\n  payloadPreview() {\n    if ((!this.selectedDiscoveredMethod && !this.consumedMethod) || !this.interopClient) {\n      return \"\";\n    }\n    const messageId = this.selectedDiscoveredMethod ? this.selectedDiscoveredMethod.inputMessageId : this.consumedMethod.method.requestMessage.id;\n    return this.interopClient.createPayloadPreview(messageId, this.messageContent);\n  }\n\n  async sendRequest() {\n\n    const method = this.selectedDiscoveredMethod || this.consumedMethod;\n\n    const invocationId = uniqueId();\n    const invocationLogger = createInvocationLogger(this.consumedMethod.method.type, invocationId, this.log, this.selectedDiscoveredMethod);\n\n    invocationLogger.info(`Request JSON payload: ${this.messageContent}`);\n    invocationLogger.info(`Request binary payload: ${this.payloadPreview()}`);\n\n    const started = new Date().getTime();\n\n    const handler = {\n      value: v => this.handleResponse(v, invocationLogger, started),\n      error: e => this.handleError(e, invocationLogger, invocationId)\n    };\n\n    const responseObserver = {\n      next: r => this.handleResponse(r, invocationLogger, started),\n      error: e => this.handleError(e, invocationLogger, invocationId),\n      complete: () => this.handleCompleted(invocationLogger, invocationId),\n      streamCompleted: () => this.handleStreamCompleted(invocationLogger)\n    }\n\n    invocationLogger.info('Starting invocation');\n\n    try {\n      let invocationClient: InvocationClient;\n      switch (this.consumedMethod.method.type) {\n        case MethodType.Unary:\n          invocationClient = await this.interopClient.sendUnaryRequest(method, this.messageContent, handler);\n          break;\n        case MethodType.ServerStreaming:\n          invocationClient = await this.interopClient.sendServerStreamingRequest(method, this.messageContent, responseObserver);\n          break;\n        case MethodType.ClientStreaming:\n        case MethodType.DuplexStreaming:\n          const streamingClient = await this.interopClient.sendBidiStreamingRequest(method, responseObserver);\n          invocationClient = streamingClient;\n          this.sendAndSchedule(this.messageContent, this.messagesToSend, this.messagesPeriodInMillis, streamingClient, invocationLogger);\n          break;\n      }\n      if (this.consumedMethod.method.type !== MethodType.Unary) {\n        this.activeInvocationsMap.set(invocationId, {\n          id: invocationId,\n          client: invocationClient,\n          logger: invocationLogger,\n          started\n        });\n      }\n    } catch (error) {\n      this.handleError(error, invocationLogger, invocationId);\n    }\n\n  }\n\n  isUnary() {\n    return this.consumedMethod.method.type === MethodType.Unary;\n  }\n\n  isClientStreaming() {\n    return this.consumedMethod.method.type === MethodType.ClientStreaming || this.consumedMethod.method.type === MethodType.DuplexStreaming;\n  }\n\n  isServerStreaming() {\n    return this.consumedMethod.method.type === MethodType.ServerStreaming || this.consumedMethod.method.type === MethodType.DuplexStreaming;\n  }\n\n  public hasRunningInvocations() {\n    return this.activeInvocationsMap.size > 0;\n  }\n\n  public async cancelLatestInvocation() {\n    if (this.activeInvocationsMap.size > 0) {\n      const invocationProfile = pop(this.activeInvocationsMap)[1];\n      try {\n        invocationProfile.logger.info('Cancelling invocation');\n        await invocationProfile.client.cancel();\n        invocationProfile.logger.info('Cancelled invocation');\n      } catch (error) {\n        invocationProfile.logger.error('Failed to cancel invocation', error);\n      }\n    }\n  }\n\n  sendAndSchedule(\n    message: string,\n    leftToSend: number,\n    intervalInMillis: number,\n    client: StreamingInvocationClient<string>,\n    logger: Logger) {\n    if (leftToSend > 0) {\n      logger.info(`Sending:\\n${message}`);\n      client.next(message);\n      setTimeout(() => {\n        this.sendAndSchedule(message, leftToSend - 1, intervalInMillis, client, logger);\n      }, intervalInMillis);\n    } else {\n      logger.info('Sending invocation completion');\n      client.complete();\n    }\n  }\n\n  label(providedMethod: DiscoveredMethod): string {\n    const alias = providedMethod.providedMethod.providedService.serviceAlias;\n    const aliasPostfix = alias ? ` (${alias})` : '';\n    const connectionId = providedMethod.providedMethod.providedService.connectionId;\n    const guidPostfix = connectionId && connectionId.hi ? ` - ${UniqueId.fromProperties(connectionId).toString()}` : '';\n    return `${providedMethod.providedMethod.providedService.applicationId}${aliasPostfix}${guidPostfix}`\n  }\n\n  format(data) {\n    return JSON.stringify(JSON.parse(data), null, 2);\n  }\n\n  createDefaultMessage() {\n    const method = this.consumedMethod.method;\n    this.messageContent = this.interopClient.createDefaultPayload(method.requestMessage.id);\n    this.formatAndUpdateArea();\n  }\n\n  formatAndUpdateArea() {\n    this.messageContent = this.format(this.messageContent);\n  }\n\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/header/header.component.css",
    "content": ".connection-statuses {\n  flex-direction: column;\n\n}\n\n.connection-statuses .connection-status {\n  justify-content: flex-end;\n}\n\na {\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n}"
  },
  {
    "path": "web/packages/studio/src/app/header/header.component.html",
    "content": "<nav class=\"navbar navbar-light bg-light justify-content-between\">\n  <a class=\"navbar-brand\" href=\"/\">\n    <img id=\"navbar-brand-img\" width=\"200\" alt=\"Plexus Studio Logo\" src=\"assets/plexus-logo-lg.png\">\n  </a>\n\n  <div class=\"connection-statuses\">\n\n    <div class=\"form-inline connection-status\" *ngIf=\"connected$ | async\">\n      <a id=\"open-metadata-details-btn\" target=\"_blank\" href=\"javascript:\" (click)=\"openModal(metadataModal)\">\n          Metadata Loaded\n      </a>\n      <a id=\"disconnect-from-metdata-btn\" title=\"Reset connection configuration\" class=\"nav-link\" href=\"javascript:\" (click)=\"disconnectFromPlexus()\">\n        <i class=\"fa fa-times\" aria-hidden=\"true\"></i>\n      </a>\n    </div>\n\n    <div class=\"form-inline connection-status\" *ngIf=\"!!currentApp\">\n      <span class=\"navbar-text mr-2\">Application: </span>\n      <a id=\"open-current-app-btn\" title=\"Go to App home page\" href=\"javascript:\" (click)=\"openCurrentApp()\">{{currentApp?.id}} - {{connectionId$ | async}}</a>\n      <a id=\"disconnect-from-app-btn\" title=\"Disconnect from current App\" class=\"nav-link\" href=\"javascript:\" (click)=\"disconnectFromApp()\">\n        <i class=\"fa fa-times\" aria-hidden=\"true\"></i>\n      </a>\n    </div>\n  </div>\n</nav>\n\n<ng-template #metadataModal let-c=\"close\" let-d=\"dismiss\">\n  <div class=\"modal-header\">\n    <h4 class=\"modal-title\">Connection Setup</h4>\n    <button id=\"close-metadata-details-modal-x-btn\" type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"d('Cross click')\">\n      <span aria-hidden=\"true\">&times;</span>\n    </button>\n  </div>\n  <div class=\"modal-body container-fluid\">\n\n    <div class=\"row\">\n      <span class=\"col-sm-2\">Transport: </span>\n      <b class=\"col-sm-10\">{{transportLabel$ | async}}</b>\n    </div>\n\n    <div class=\"row\">\n      <span class=\"col-sm-2\">Metadata URL:</span>\n      <a id=\"interop-json-link\" title=\"{{(connectionDetails$ | async)?.generalConfig?.metadataUrl}}\" class=\"col-sm-10\">{{(connectionDetails$ | async)?.generalConfig?.metadataUrl}}</a>\n    </div>\n\n  </div>\n\n  <div class=\"modal-footer\">\n    <button id=\"close-metadata-details-modal-btn\" type=\"button\" class=\"btn btn-outline-dark\" (click)=\"c('Close click')\">Close</button>\n  </div>\n\n</ng-template>"
  },
  {
    "path": "web/packages/studio/src/app/header/header.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SubscriptionsRegistry } from './../services/ui/SubscriptionsRegistry';\nimport { InteropServiceFactory } from '../services/core/InteropServiceFactory';\nimport { Application } from '@plexus-interop/metadata';\nimport { Subscription } from 'rxjs/Subscription';\nimport { AppActions } from '../services/ui/AppActions';\nimport { Component, OnInit, OnDestroy } from '@angular/core';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/fromEvent';\nimport 'rxjs/add/operator/combineLatest';\nimport 'rxjs/add/operator/filter';\nimport { Router } from '@angular/router';\nimport { ViewChild, ElementRef } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';\nimport { ConnectionDetails, transportTypes as types, transportTypes } from '../services/ui/AppModel';\n\n@Component({\n  selector: 'app-header',\n  templateUrl: './header.component.html',\n  styleUrls: ['./header.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class HeaderComponent implements OnInit, OnDestroy {\n  metadataUrl$: Observable<string>;\n  connected$: Observable<boolean>;\n  application$: Observable<Application>;\n  connectionId$: Observable<string>;\n  connectionDetails$: Observable<ConnectionDetails>;\n  transportLabel$: Observable<string>;\n\n  public currentApp: Application;\n\n  constructor(\n    private actions: AppActions,\n    private store: Store<fromRoot.State>,\n    private router: Router,\n    private interopServiceFactory: InteropServiceFactory,\n    private subscriptions: SubscriptionsRegistry,\n    private modalService: NgbModal) {\n  }\n\n  ngOnInit() {\n    this.metadataUrl$ = this.store.select(state => state.plexus.connectionDetails.generalConfig.metadataUrl);\n    this.application$ = this.store.select(state => state.plexus.connectedApp);\n    this.connected$ = this.store.select(state => state.plexus.connectionDetails.connected);\n    this.connectionDetails$ = this.store.select(state => state.plexus.connectionDetails);\n    this.transportLabel$ = this.connectionDetails$.map(details => this.findLabel(details.generalConfig.transportType));\n    this.connectionId$ = this.store.select(state => state.plexus.services.interopClient).map(client => client ? client.getConnectionStrId() : 'NOT CONNECTED');\n    this.subscriptions.add(this.application$.subscribe(app => this.currentApp = app));\n  }\n\n  findLabel(typeKey) {\n    const type = transportTypes.find(v => v.key == typeKey);\n    return type ? type.label : 'NOT_FOUND';\n  }\n\n  ngOnDestroy() {\n    this.subscriptions.unsubscribeAll();\n  }\n\n  disconnectFromPlexus() {\n    this.store.dispatch({ type: AppActions.DISCONNECT_FROM_PLEXUS });\n  }\n\n  disconnectFromApp() {\n    this.store.dispatch({ type: AppActions.DISCONNECT_FROM_APP });\n  }\n\n  openCurrentApp() {\n    if (this.currentApp) {\n      this.store.dispatch({ type: AppActions.NAVIGATE_TO_APP });\n    }\n  }\n\n  openModal(content) {\n    this.modalService.open(content, { size: 'lg' });\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/metadata-loader/metadata-loader.component.css",
    "content": ""
  },
  {
    "path": "web/packages/studio/src/app/metadata-loader/metadata-loader.component.html",
    "content": "<form [formGroup]=\"connectionFormGroup\">\n\n  <div class=\"form-group\">\n    <label for=\"transportType\">Transport Type</label>\n    <select id=\"transport-type-dropdown\" class=\"form-control\" formControlName=\"transportType\" (change)=\"triggerValidation()\">\n      <option id=\"transport-type-{{typeEntry.key}}\" *ngFor=\"let typeEntry of transportTypes\"\n        [ngValue]=\"typeEntry.key\">\n        {{typeEntry.label}}\n      </option>\n    </select>\n  </div>\n\n  <div class=\"form-group\" [hidden]=\"transportType.value != 'native-ws'\">\n      <label for=\"wsUrl\">Web Socket URL</label>    \n      <input type=\"text\" name=\"wsUrl\" id=\"metadataUrl\" class=\"form-control\" [formControl]=\"wsUrl\">\n  </div>\n\n  <div class=\"form-group\" [hidden]=\"transportType.value == 'native-ws'\">\n      <label for=\"appsUrl\">Apps Metadata URL</label>    \n      <input type=\"text\" name=\"appsUrl\" id=\"metadataUrl\" class=\"form-control\" [formControl]=\"appsUrl\">\n  </div>\n\n  <div class=\"form-group\" [hidden]=\"transportType.value != 'web-cross'\">\n      <label for=\"proxyHostUrl\">Proxy Host URL</label>    \n      <input type=\"text\" name=\"proxyHostUrl\" id=\"proxyHostUrl\" class=\"form-control\" [formControl]=\"proxyHostUrl\">\n  </div>\n\n  <div class=\"form-group\">\n    <label for=\"metadataUrl\">Metadata URL</label>    \n    <input type=\"text\" name=\"metadataUrl\" id=\"metadataUrl\" class=\"form-control\" [formControl]=\"metadataUrl\">\n  </div>\n\n  <button id=\"connect-btn\" class=\"btn-primary\" type=\"button\" [disabled]=\"!connectionFormGroup.valid\" (click)=\"connect()\">Connect</button>\n  \n  <div [hidden]=\"connectionFormGroup.valid\">\n    <small class=\"text-danger\">Please fill all required fields</small>\n  </div>\n\n</form>"
  },
  {
    "path": "web/packages/studio/src/app/metadata-loader/metadata-loader.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SubscriptionsRegistry } from '../services/ui/SubscriptionsRegistry';\nimport { AppActions } from '../services/ui/AppActions';\nimport { Component, OnInit, OnDestroy } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { FormGroup, FormControl, FormBuilder, Validators, ValidationErrors } from '@angular/forms';\nimport 'rxjs/add/operator/first';\nimport { TransportType, ConnectionDetails, transportTypes as types } from '../services/ui/AppModel';\n\n@Component({\n  selector: 'app-metadata-loader',\n  templateUrl: './metadata-loader.component.html',\n  styleUrls: ['./metadata-loader.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class MetadataLoaderComponent implements OnInit, OnDestroy {\n\n  transportType: FormControl = new FormControl(TransportType.NATIVE_WS, [Validators.required]);\n  metadataUrl: FormControl = new FormControl('', [Validators.required, Validators.minLength(1)]);\n  appsUrl: FormControl = new FormControl('', [this.requiredWebConfig.bind(this)]);\n  proxyHostUrl: FormControl = new FormControl('', [this.requiredCrossWebConfig.bind(this)]);\n  wsUrl: FormControl = new FormControl('', [this.requiredWsConfig.bind(this)]);\n\n  transportTypes = types;\n\n  connectionFormGroup: FormGroup = this.builder.group({\n    metadataUrl: this.metadataUrl,\n    appsUrl: this.appsUrl,\n    proxyHostUrl: this.proxyHostUrl,\n    transportType: this.transportType,\n    wsUrl: this.wsUrl\n  });\n\n  constructor(\n    private actions: AppActions,\n    private store: Store<fromRoot.State>,\n    private router: Router,\n    private subscriptions: SubscriptionsRegistry,\n    private builder: FormBuilder) {\n  }\n\n  ngOnInit() {\n    const connectionDetailsObs = this.store.select(state => state.plexus.connectionDetails);\n    this.subscriptions.add(connectionDetailsObs.subscribe(details => {\n      this.metadataUrl.setValue(details.generalConfig ? details.generalConfig.metadataUrl : '');\n      this.appsUrl.setValue(details.webConfig ? details.webConfig.appsMetadataUrl : '');\n      this.proxyHostUrl.setValue(details.webConfig ? details.webConfig.proxyHostUrl : '');\n      this.transportType.setValue(details.generalConfig ? details.generalConfig.transportType : '');\n      this.wsUrl.setValue(details.wsConfig ? details.wsConfig.wsUrl : '');\n    }));\n  }\n\n  triggerValidation(): void {\n    for (var i in this.connectionFormGroup.controls) {\n      this.connectionFormGroup.controls[i].updateValueAndValidity();\n    }\n  }\n\n  ngOnDestroy() {\n    this.subscriptions.unsubscribeAll();\n  }\n\n  requiredCrossWebConfig(formControl: FormControl) {\n    const value = formControl.value as string;\n    const valid = this.transportType.value !== TransportType.WEB_CROSS || (!!value && value.length > 0);\n    return valid ? null : { required: true };\n  }\n\n  requiredWsConfig(formControl: FormControl) {\n    const value = formControl.value as string;\n    const valid = this.transportType.value !== TransportType.NATIVE_WS || (!!value && value.length > 0);\n    return valid ? null : { required: true };\n  }\n\n  requiredWebConfig(formControl: FormControl) {\n    const value = formControl.value as string;\n    const valid = this.transportType.value === TransportType.NATIVE_WS || (!!value && value.length > 0);\n    return valid ? null : { required: true };\n  }\n\n  connect(metadataUrl: string) {\n    const wsConfig = !!this.wsUrl.value ? { wsUrl: this.wsUrl.value } : null;\n    const webConfig = (this.appsUrl.value || this.proxyHostUrl.value)\n      ? {\n        proxyHostUrl: this.proxyHostUrl.value,\n        appsMetadataUrl: this.appsUrl.value\n      } : null;\n    const connectionDetails: ConnectionDetails = {\n      generalConfig: {\n        metadataUrl: this.metadataUrl.value,\n        transportType: this.transportType.value,\n      },\n      wsConfig,\n      webConfig,\n      connected: false\n    };\n    this.store.dispatch({\n      type: AppActions.CONNECTION_SETUP_START,\n      payload: {\n        connectionDetails,\n        silentOnFailure: false\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/provided-service/provided-service.component.css",
    "content": ""
  },
  {
    "path": "web/packages/studio/src/app/provided-service/provided-service.component.html",
    "content": "<div>\n  <h5><p>{{title}}</p></h5>\n  <div class=\"form-group\">\n    <label for=\"messageContentInput\">Enter response JSON:</label>\n    <textarea id=\"response-content-area\" [class.is-invalid]=\"messageContentControl && messageContentControl.invalid\" [(ngModel)]=\"messageContent\"\n      [formControl]=\"messageContentControl\" name=\"messageContentControl\" class=\"form-control\" id=\"exampleFormControlTextarea1\"\n      rows=\"8\"></textarea>\n    <div *ngIf=\"messageContentControl && messageContentControl.invalid\" class=\"invalid-feedback\">\n      {{messageContentControl.errors.messageContentControl}}\n    </div>\n    <button id=\"format-response-content-btn\" [disabled]=\"messageContentControl && messageContentControl.invalid\" class=\"btn btn-link\" type=\"button\" (click)=\"formatAndUpdateArea()\">Format content</button>\n    <button id=\"default-response-content-btn\" class=\"btn btn-link\" type=\"button\" (click)=\"createDefaultMessage()\">Default</button>\n  </div>\n</div>\n\n<div class=\"form-group\" [hidden]=\"!isServerStreaming()\">\n  <label for=\"messages-count\">Enter messages number:</label>\n  <input id=\"messages-count\" class=\"form-control\" [(ngModel)]=\"messagesToSend\">\n</div>\n\n<div class=\"form-group\" [hidden]=\"!isServerStreaming()\">\n  <label for=\"messages-interval\">Enter interval between messages (ms):</label>\n  <input id=\"messages-interval\" class=\"form-control\" [(ngModel)]=\"messagesPeriodInMillis\">\n</div>\n\n<button id=\"intercept-btn\" class=\"btn btn-primary\" [disabled]=\"messageContentControl && messageContentControl.invalid\" (click)=\"intercept()\" type=\"button\">Update Response</button>"
  },
  {
    "path": "web/packages/studio/src/app/provided-service/provided-service.component.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Component, OnInit, OnDestroy } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport * as fromRoot from '../services/ui/RootReducers';\nimport { ProvidedMethod, ProvidedService } from '@plexus-interop/metadata';\nimport { InteropClient } from '../services/core/InteropClient';\nimport { SubscriptionsRegistry } from '../services/ui/SubscriptionsRegistry';\nimport { Logger, LoggerFactory, uniqueId, ReadOnlyCancellationToken } from '@plexus-interop/common';\nimport { StreamingInvocationClient, MethodType } from '@plexus-interop/client';\nimport { createInvocationLogger } from '../services/core/invocation-utils';\nimport { FormControl } from '@angular/forms';\nimport { plexusMessageValidator } from '../services/ui/validators';\n\n@Component({\n  selector: 'app-provided-service',\n  templateUrl: './provided-service.component.html',\n  styleUrls: ['./provided-service.component.css'],\n  providers: [SubscriptionsRegistry]\n})\nexport class ProvidedServiceComponent implements OnInit, OnDestroy {\n\n  private readonly log: Logger = LoggerFactory.getLogger('ProvidedServiceComponent');\n  private readonly maxPrintedContent: number = 1024;\n  private providedMethod: ProvidedMethod;\n  private messageContentControl: FormControl = new FormControl('{}');\n  private messageContent: string = '{}';\n\n  private interopClient: InteropClient;\n\n  messagesToSend: number = 1;\n  messagesPeriodInMillis: number = 200;\n  title: string = '';\n\n  constructor(\n    private store: Store<fromRoot.State>,\n    private subscriptions: SubscriptionsRegistry) { }\n\n  ngOnInit() {\n    this.subscriptions.add(this.store\n      .filter(state => !!state.plexus.providedMethod)\n      .map(state => state.plexus)\n      .filter(plexus => !!plexus.services.interopClient && !!plexus.providedMethod)\n      .subscribe(plexus => {\n        this.providedMethod = plexus.providedMethod.method;\n        this.title = this.getTitle(this.providedMethod);\n        this.interopClient = plexus.services.interopClient;\n        this.messageContent = this.createDefaultPayload();\n        this.messageContentControl.setValidators([\n          plexusMessageValidator('messageContentControl', this.interopClient, this.providedMethod)\n        ]);\n        this.updateResponse(this.messageContent, this.messagesToSend, this.messagesPeriodInMillis);\n      }));\n  }\n\n  printRequest(requestJson: string, log) {\n    if (requestJson.length > this.maxPrintedContent) {\n      requestJson = `${requestJson.substring(0, this.maxPrintedContent)}...`;\n    } else {\n      requestJson = this.format(requestJson);\n    }\n    log.info(`Received request: ${requestJson}`);\n  }\n\n  handleError(e: any, log) {\n    log.error(`Error received`, e);\n  }\n\n  getTitle(providedMethod: ProvidedMethod): string {\n    return `Provided Method - ${providedMethod.providedService.service.id}${this.getAlias(providedMethod.providedService)}.${providedMethod.method.name}`;\n  }\n\n  getAlias(provideService: ProvidedService): string {\n    return !!provideService.alias ? `(${provideService.alias})` : '';\n  }\n\n  handleCompleted(log) {\n    log.info('Invocation completed');\n  }\n\n  handleStreamCompleted(log) {\n    log.info('Remote stream completed');\n  }\n\n  formatAndUpdateArea() {\n    this.messageContent = this.format(this.messageContent);\n  }\n\n  updateResponse(contentJson: string, messagesToSend: number, messagesPeriodInMillis: number): void {\n\n    const serviceId = this.providedMethod.providedService.service.id;\n    const methodId = this.providedMethod.method.name;\n    const serviceAlias = this.providedMethod.providedService.alias;\n\n    switch (this.providedMethod.method.type) {\n      case MethodType.Unary:\n        this.interopClient.setUnaryActionHandler(\n          serviceId,\n          methodId,\n          serviceAlias,\n          async (context, requestJson) => {\n            const invocationLogger = createInvocationLogger(this.providedMethod.method.type, uniqueId(), this.log);\n            this.printRequest(requestJson, invocationLogger);\n            invocationLogger.info(`Sending message:\\n${contentJson}`);\n            return contentJson;\n          });\n        break;\n      case MethodType.ServerStreaming:\n        this.interopClient.setServerStreamingActionHandler(serviceId, methodId, serviceAlias, (context, request, client) => {\n          const invocationLogger = createInvocationLogger(this.providedMethod.method.type, uniqueId(), this.log);\n          context.cancellationToken.onCancel(reason => invocationLogger.info(`Invocation Cancelled`, reason));\n          this.printRequest(request, invocationLogger);\n          this.sendAndSchedule(context.cancellationToken, contentJson, messagesToSend, messagesPeriodInMillis, client, invocationLogger);\n        });\n        break;\n      case MethodType.ClientStreaming:\n        this.interopClient.setBidiStreamingActionHandler(serviceId, methodId, serviceAlias, (context, client) => {\n          const invocationLogger = createInvocationLogger(this.providedMethod.method.type, uniqueId(), this.log);\n          context.cancellationToken.onCancel(reason => invocationLogger.info(`Invocation Cancelled`, reason));\n          return {\n            next: request => this.printRequest(request, invocationLogger),\n            error: e => this.handleError(e, invocationLogger),\n            complete: () => this.handleCompleted(invocationLogger),\n            streamCompleted: () => {\n              this.handleStreamCompleted(invocationLogger);\n              this.sendAndSchedule(context.cancellationToken, contentJson, messagesToSend, messagesPeriodInMillis, client, invocationLogger);\n            }\n          };\n        });\n        break;\n      case MethodType.DuplexStreaming:\n        this.interopClient.setBidiStreamingActionHandler(serviceId, methodId, serviceAlias, (context, client) => {\n          const invocationLogger = createInvocationLogger(this.providedMethod.method.type, uniqueId(), this.log);\n          context.cancellationToken.onCancel(reason => invocationLogger.info(`Invocation Cancelled`, reason));\n          this.sendAndSchedule(context.cancellationToken, contentJson, messagesToSend, messagesPeriodInMillis, client, invocationLogger);\n          return {\n            next: request => {\n              this.printRequest(request, invocationLogger);\n            },\n            error: e => this.handleError(e, invocationLogger),\n            complete: () => this.handleCompleted(invocationLogger),\n            streamCompleted: () => this.handleStreamCompleted(invocationLogger)\n          };\n        });\n        break;\n    }\n  }\n\n  intercept() {\n    this.updateResponse(this.messageContent, this.messagesToSend, this.messagesPeriodInMillis);\n    this.log.info('Response updated');\n  }\n\n  format(data) {\n    return JSON.stringify(JSON.parse(data), null, 2);\n  }\n\n  sendAndSchedule(\n    cancellationToken: ReadOnlyCancellationToken,\n    message: string, \n    leftToSend: number, \n    intervalInMillis: number, \n    client: StreamingInvocationClient<string>, \n    logger: Logger) {\n    if (cancellationToken.isCancelled()) {\n      return;\n    }\n    if (leftToSend > 0) {\n      logger.info(`Sending message:\\n${message}`);\n      client.next(message);\n      setTimeout(() => {\n        this.sendAndSchedule(cancellationToken, message, leftToSend - 1, intervalInMillis, client, logger);\n      }, intervalInMillis);\n    } else {\n      logger.info('Sending completion');\n      client.complete();\n    }\n  }\n\n  isServerStreaming() {\n    return this.providedMethod && (this.providedMethod.method.type === MethodType.ServerStreaming || this.providedMethod.method.type === MethodType.DuplexStreaming);\n  }\n\n  createDefaultMessage() {\n    this.messageContent = this.createDefaultPayload();\n  }\n\n  createDefaultPayload() {\n    const method = this.providedMethod.method;\n    return this.format(this.interopClient.createDefaultPayload(method.responseMessage.id));\n  }\n\n  ngOnDestroy() {\n    this.subscriptions.unsubscribeAll();\n  }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/AppUtils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RouterStateSerializer } from '@ngrx/router-store';\nimport { RouterStateSnapshot, Params } from '@angular/router';\n\nexport interface RouterStateUrl {\n  url: string;\n  queryParams: Params;\n}\n\nexport class CustomRouterStateSerializer\n  implements RouterStateSerializer<RouterStateUrl> {\n  serialize(routerState: RouterStateSnapshot): RouterStateUrl {\n    const { url } = routerState;\n    const queryParams = routerState.root.queryParams;\n\n    return { url, queryParams };\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/DefaultMessageGenerator.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Message, InteropRegistry, Service, Application, Enum } from '@plexus-interop/metadata';\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { DefaultMessageGenerator } from './DefaultMessageGenerator';\n\ndescribe('DefaultMessageGenerator', () => {\n\n    it('Should generate object for primitive types', () => {\n        const id = 'test';\n        const message: Message = {\n            id,\n            fields: {\n                int32Field: {\n                    type: 'int32',\n                    id: 1\n                },\n                stringField: {\n                    type: 'string',\n                    id: 2\n                },\n                boolField: {\n                    type: 'bool',\n                    id: 3\n                }\n            }\n        };\n        const generated = new DefaultMessageGenerator(setupRegistry([message])).generateObj(id);\n        expect(generated.stringField).toBe('stringValue');\n        expect(generated.int32Field).toBe(0);\n        expect(generated.boolField).toBe(false);\n    });\n\n    it('Should generate object with enum field', () => {\n        const messageId = 'test';\n        const enumId = 'test.enum';\n        const testEnum: Enum = {\n            id: enumId,\n            values: {\n                \"ONE\": 1\n            }\n        };\n        const message: Message = {\n            id: messageId,\n            fields: {\n                enumField: {\n                    type: enumId,\n                    id: 1\n                }\n            }\n        };\n        const generated = new DefaultMessageGenerator(setupRegistry([message], [testEnum])).generateObj(messageId);\n        expect(generated.enumField).toBe(1);\n    });\n\n    it('Should generate object with message field', () => {\n\n        const fieldMessageId = \"field.message.id\";\n        const fieldMessage = {\n            id: fieldMessageId,\n            fields: {\n                stringField: {\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        };\n\n        const messageId = 'test';\n        const message: Message = {\n            id: messageId,\n            fields: {\n                messageField: {\n                    type: fieldMessageId,\n                    id: 1\n                }\n            }\n        };\n\n        const generated = new DefaultMessageGenerator(setupRegistry([message, fieldMessage])).generateObj(messageId);\n        expect(generated.messageField.stringField).toBe('stringValue');\n\n    });\n\n    it('Should generate one test element for array fields', () => {\n\n        const messageId = 'test';\n\n        const enumId = 'test.enum';\n        const testEnum: Enum = {\n            id: enumId,\n            values: {\n                \"ONE\": 1\n            }\n        };\n\n        const fieldMessageId = \"field.message.id\";\n        const fieldMessage = {\n            id: fieldMessageId,\n            fields: {\n                stringField: {\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        };\n\n        const complexMessageId = \"complex.message.id\";\n        const complexMessage = {\n            id: complexMessageId,\n            fields: {\n                messageField: {\n                    type: fieldMessageId,\n                    id: 1\n                }\n            }\n        };\n\n        const message: Message = {\n            id: messageId,\n            fields: {\n                enumArrayField: {\n                    rule: 'repeated',\n                    type: enumId,\n                    id: 1\n                },\n                stringArrayField: {\n                    rule: 'repeated',\n                    type: 'string',\n                    id: 2\n                },\n                // simple message \n                messageArrayField: {\n                    rule: 'repeated',\n                    type: fieldMessageId,\n                    id: 3\n                },\n                complexMessageArrayField: {\n                    rule: 'repeated',\n                    type: complexMessageId,\n                    id: 4\n                }\n            }\n        };\n\n        const generated = new DefaultMessageGenerator(setupRegistry([message, fieldMessage, complexMessage], [testEnum])).generateObj(messageId);\n        expect(generated.stringArrayField).toEqual(['stringValue']);\n        expect(generated.enumArrayField).toEqual([1]);\n        expect(generated.messageArrayField).toEqual([{ stringField: 'stringValue' }]);\n        expect(generated.complexMessageArrayField).toEqual([\n            {\n                messageField: {}\n            }\n        ]);\n\n    });\n\n});\n\nfunction setupRegistry(messages: Message[], enums: Enum[] = []): { getRegistry: () => InteropRegistry } {\n\n    const messagesMap = ExtendedMap.create<string, Message>();\n    messages.forEach(m => messagesMap.set(m.id, m));\n\n    const enumsMap = ExtendedMap.create<string, Enum>();\n    enums.forEach(e => enumsMap.set(e.id, e));\n\n    const registry = {\n        messages: messagesMap,\n        enums: enumsMap,\n        applications: ExtendedMap.create<string, Application>(),\n        services: ExtendedMap.create<string, Service>(),\n        rawMessages: {}\n    };\n\n    return {\n        getRegistry: () => registry\n    };\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/DefaultMessageGenerator.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Enum, Message, InteropRegistry } from '@plexus-interop/metadata';\n\n// https://developers.google.com/protocol-buffers/docs/reference/proto3-spec    \nconst primitiveTypes = [\n    'double', 'float', 'int32', 'int64', 'uint32',\n    'uint64', 'sint32', 'sint64', 'fixed32', 'fixed64',\n    'sfixed32', 'sfixed64', 'bool', 'string'];\n\nconst bytesType = 'bytes';\n\nexport class DefaultMessageGenerator {\n\n    public constructor(private readonly interopRegistryProvider: { getRegistry: () => InteropRegistry }) { }\n\n\n\n    public generate(messageId: string): string {\n        return JSON.stringify(this.generateObj(messageId));\n    }\n\n    public generateObj(messageId: string, skipMessageType: boolean = false): any {\n        const message = this.lookupMessage(messageId);\n        if (!message) {\n            throw new Error(`${messageId} is not found`);\n        }\n        const defaultPayload: any = {};\n        for (let fieldName in message.fields) {\n            const field = message.fields[fieldName];\n            if (field.type === bytesType) {\n                defaultPayload[fieldName] = [];\n            } else {\n                defaultPayload[fieldName] = this.isArray(field) ?\n                this.generateArrayValue(messageId, field, skipMessageType)\n                : this.generateNonArrayValue(messageId, field, skipMessageType)\n            }\n        }\n        return defaultPayload;\n    }\n\n    private generateArrayValue(messageId: string, field: any, skipMessageType: boolean): any {\n        return [this.generateNonArrayValue(messageId, field, skipMessageType)];\n    }\n\n    private generateNonArrayValue(messageId: string, field: any, skipMessageType: boolean): any {\n        if (field.keyType) {\n            // map\n            return {};\n        } else if (this.isPrimitive(field.type)) {\n            // primitive\n            return this.getPrimitiveDefault(field.type);\n        } else {\n            // enum or message\n            const enumRef = this.loookupEnumByFieldType(messageId, field.type);\n            if (enumRef) {\n                return this.anyValue(enumRef.values);\n            } else if (skipMessageType) {\n                return {};\n            } else {\n                const messageType = this.lookupMessageByFieldType(messageId, field.type);\n                if (messageType) {\n                    return this.generateObj(messageType.id, true);\n                } else {\n                    return {};\n                }\n            }\n        }\n    }\n\n    public lookupMessageByFieldType(messageId: string, fieldType: string): Message | null {\n        return this.lookupMessage(fieldType)\n            || this.lookupMessage(`${messageId}.${fieldType}`)\n            || this.lookupMessage(`${this.getNamespace(messageId)}.${fieldType}`)\n    }\n\n    public loookupEnumByFieldType(messageId: string, fieldType: string): Enum | null {\n        return this.lookupEnum(fieldType)\n            || this.lookupEnum(`${messageId}.${fieldType}`)\n            || this.lookupEnum(`${this.getNamespace(messageId)}.${fieldType}`)\n    }\n\n    public loookupEnumByFieldName(messageId: string, fieldName: string): Enum | null {\n        const message = this.lookupMessage(messageId);\n        const field = message.fields[fieldName]\n        if (field) {\n            return this.loookupEnumByFieldType(messageId, field.type);\n        } else {\n            return null;\n        }\n    }\n\n    public isArray(field: any): boolean {\n        return field.rule && field.rule === 'repeated';\n    }\n\n    private getPrimitiveDefault(type: string): any {\n        switch (type) {\n            case 'string':\n                return 'stringValue';\n            case 'bool':\n                return false;\n            default:\n                return 0;\n        }\n    }\n\n    private anyValue(o: any): any {\n        for (let k in o) {\n            return o[k];\n        }\n        return null;\n    }\n\n    private getNamespace(id: string): string {\n        const parts = id.split('.');\n        if (parts.length > 1) {\n            return parts.slice(0, parts.length - 1).join('.');\n        } else {\n            return id;\n        }\n    }\n\n    private lookupEnum(id: string): Enum | null {\n        const enums = this.interopRegistryProvider.getRegistry().enums;\n        if (enums) {\n            return enums.get(id);\n        }\n        return null;\n    }\n\n    private lookupMessage(id: string): Message | null {\n        return this.interopRegistryProvider.getRegistry().messages.get(id);\n    }\n\n    public isPrimitive(type: string): boolean {\n        return primitiveTypes.indexOf(type) !== -1;\n    }\n\n    public isMap(field: any): boolean {\n        return !!field.keyType;\n    }\n\n    public isMapByName(messageId: string, fieldName: string): boolean {\n        const message = this.lookupMessage(messageId);\n        const field = message.fields[fieldName]\n        if (field) {\n            return !!field.keyType;\n        } else {\n            return false;\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/FieldNamesValidator.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Message, InteropRegistry, Service, Application, Enum } from '@plexus-interop/metadata';\nimport { ExtendedMap } from '@plexus-interop/common';\nimport { FieldNamesValidator } from './FieldNamesValidator';\n\ndescribe('Field names validator', () => {\n\n    const fieldMessageId = \"field.message.id\";\n    const fieldMessage: Message = {\n        id: fieldMessageId,\n        fields: {\n            stringField: {\n                type: \"string\",\n                id: 1\n            }\n        }\n    };\n    const id = 'test';\n    const message: Message = {\n        id,\n        fields: {\n            int32Field: {\n                type: 'int32',\n                id: 1\n            },\n            stringField: {\n                type: 'string',\n                id: 2\n            },\n            stringArrayField: {\n                type: 'string',\n                rule: 'repeated',\n                id: 2\n            },\n            boolField: {\n                type: 'bool',\n                id: 3\n            },\n            messageField: {\n                type: fieldMessageId,\n                id: 4\n            },\n            mapField: {\n                keyType: \"string\",\n                type: \"string\",\n                id: 5\n            }\n        }\n    };\n\n    it('Should pass object with correct fields', () => {\n        new FieldNamesValidator(setupRegistry([fieldMessage, message])).validate(id, {\n            int32Field: 0,\n            stringField: \"123\",\n            stringArrayField: [\"123\"],\n            messageField: {\n                stringField: \"1234\"\n            }\n        });\n    });\n\n    it('Should pass with recursive type references', () => {\n\n        const firstMessageType = \"recursiveMessageType\";\n        const secondMessageType = \"otherMessageType\";\n\n        const firstMessageDef: Message = {\n            id: firstMessageType,\n            fields: {\n                stringField2: {\n                    type: \"string\",\n                    id: 1\n                },\n                otherMessageField: {\n                    type: secondMessageType,\n                    id: 2\n                }\n            }\n        };\n\n        const secondMessageDef: Message = {\n            id: secondMessageType,\n            fields: {\n                firstMessageField: {\n                    type: firstMessageType,\n                    id: 1\n                }\n            }\n        }\n\n        new FieldNamesValidator(setupRegistry([firstMessageDef, secondMessageDef])).validate(firstMessageType, {\n            stringField2: \"123\",\n            otherMessageField: {\n                firstMessageField: {\n                    stringField2: \"321\"\n                }\n            }\n        });\n        \n    });\n\n    \n    it('Should fail with recursive type references and incorrect field inside', () => {\n\n        const firstMessageType = \"recursiveMessageType\";\n        const secondMessageType = \"otherMessageType\";\n\n        const firstMessageDef: Message = {\n            id: firstMessageType,\n            fields: {\n                stringField2: {\n                    type: \"string\",\n                    id: 1\n                },\n                otherMessageField: {\n                    type: secondMessageType,\n                    id: 2\n                }\n            }\n        };\n\n        const secondMessageDef: Message = {\n            id: secondMessageType,\n            fields: {\n                firstMessageField: {\n                    type: firstMessageType,\n                    id: 1\n                }\n            }\n        }\n\n        const validateAction = () => new FieldNamesValidator(setupRegistry([firstMessageDef, secondMessageDef])).validate(firstMessageType, {\n            stringField2: \"123\",\n            otherMessageField: {\n                firstMessageField: {\n                    stringField3: \"321\"\n                }\n            }\n        });\n\n        expect(validateAction).toThrow();\n        \n    });\n\n    it('Should fail on object with incorrect field', () => {\n        try {\n            new FieldNamesValidator(setupRegistry([fieldMessage, message])).validate(id, {\n                int32Field_x: 0\n            });\n            fail('Expected to fail');    \n        } catch (error) {\n        }        \n    });\n\n    it('Should fail on object with incorrect nested field', () => {\n        try {\n            new FieldNamesValidator(setupRegistry([fieldMessage, message])).validate(id, {\n                messageField: {\n                    stringField_x: \"1234\"\n                }\n            });\n            fail('Expected to fail');    \n        } catch (error) {\n        }        \n    });\n\n    it('Should pass object with Map field', () => {\n        new FieldNamesValidator(setupRegistry([fieldMessage, message])).validate(id, {\n            mapField: {\n                someKey: \"1234\"\n            }\n        });      \n    });\n\n});\n\nfunction setupRegistry(messages: Message[]): { getRegistry: () => InteropRegistry } {\n\n    const messagesMap = ExtendedMap.create<string, Message>();\n    messages.forEach(m => messagesMap.set(m.id, m));\n\n    const registry = {\n        messages: messagesMap,\n        applications: ExtendedMap.create<string, Application>(),\n        services: ExtendedMap.create<string, Service>(),\n        rawMessages: {}\n    };\n\n    return {\n        getRegistry: () => registry\n    };\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/FieldNamesValidator.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropRegistry, Message } from '@plexus-interop/metadata';\nimport { DefaultMessageGenerator } from './DefaultMessageGenerator';\n\nimport { default as Set } from 'typescript-collections/dist/lib/Set';\n\nconst maxRecursiveDepth = 3;\n\nexport class FieldNamesValidator {\n\n    private messageGenerator: DefaultMessageGenerator;\n\n    private messageFieldsNameCache = new Map<string, Set<string>>();\n\n    public constructor(private readonly registryProvider: { getRegistry: () => InteropRegistry }) {\n        this.messageGenerator = new DefaultMessageGenerator(registryProvider);\n    }\n\n    public validate(messageId: string, payload: any): void {\n        const message = this.registryProvider.getRegistry().messages.get(messageId);\n        const existingFieldNames = this.collectFieldNames(message);\n        const actualFieldNames = this.collectObjFieldNames(messageId, payload);\n        actualFieldNames.difference(existingFieldNames);\n        if (!actualFieldNames.isEmpty()) {\n            throw `[${actualFieldNames.toArray().join(\",\")}] field(s) do not exist`;\n        }\n    }\n\n    public collectObjFieldNames(messageId: string, object: any, result: Set<string> = new Set<string>(), prefix: string = \"\"): Set<string> {\n        if (Array.isArray(object) || !object) {\n            return result;\n        }\n        Object.getOwnPropertyNames(object).forEach(key => {\n            const fullPropertyName = prefix + key;\n            result.add(fullPropertyName);\n            const value = object[key];\n            if (this.messageGenerator.isMapByName(messageId, key)) {\n                // map field, stop\n                return;\n            }\n            if (this.isObject(value)) {\n                this.collectObjFieldNames(messageId, value, result, fullPropertyName + \".\");\n            }\n        });\n        return result;\n    }\n\n    private isObject(obj) {\n        return obj !== null && typeof obj === 'object';\n    }\n\n    private collectFieldNames(message: Message): Set<string> {\n        if (this.messageFieldsNameCache.has(message.id)) {\n            return this.messageFieldsNameCache.get(message.id);\n        } else {\n            return this.collectFields(message);\n        }\n    }\n\n    private collectFields(\n        message: Message,\n        collectedFields: Set<string> = new Set(),\n        visitedNestedTypes: Map<string, number> = new Map(),\n        prefix: string = \"\"): Set<string> {\n\n        let visitsCount = visitedNestedTypes.get(message.id) || 0;\n        if (visitsCount > maxRecursiveDepth) {\n            // already visited few times, skip nested fields\n            return;\n        }\n        visitedNestedTypes.set(message.id, visitsCount + 1);\n        Object.getOwnPropertyNames(message.fields)\n            .map(fieldName => {\n                const field = message.fields[fieldName];\n                const type = !!field ? this.messageGenerator.lookupMessageByFieldType(message.id, field.type) : undefined;\n                return { field, type, fieldName };\n            })\n            // fields with message type goes at the end, so we have better chances to process\n            // simple types before got recursive call issue\n            .sort((first, second) => {\n                const firstScore = !!first.type ? 1 : 0;\n                const secondScore = !!second.type ? 1 : 0;\n                return secondScore - firstScore;\n            })\n            .forEach(field => {\n                const fullFieldName = `${prefix}${field.fieldName}`;\n                collectedFields.add(fullFieldName);\n                if (field.type) {\n                    this.collectFields(field.type, collectedFields, visitedNestedTypes, fullFieldName + \".\");\n                }\n            });\n        return collectedFields;\n    }\n\n\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/GenericClientWrapper.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropClient } from './InteropClient';\nimport { GenericClientApi, ValueHandler, InvocationClient, MethodDiscoveryRequest, DiscoveredMethod, StreamingInvocationClient, InvocationObserver, MethodType } from '@plexus-interop/client';\nimport { ClientError } from '@plexus-interop/protocol';\nimport { MethodDiscoveryResponse, ProvidedMethodReference, DiscoveryMode, MethodInvocationContext } from '@plexus-interop/client-api';\nimport { InteropRegistryService, ProvidedMethod, ConsumedMethod, ProvidedService } from '@plexus-interop/metadata';\nimport { DynamicProtoMarshallerFactory } from '@plexus-interop/io/dist/main/src/dynamic';\nimport { DefaultMessageGenerator } from './DefaultMessageGenerator';\nimport { UnaryStringHandler, ServerStreamingStringHandler, BidiStreamingStringHandler, wrapGenericHostClient, toGenericObserver } from './StringHandlers';\nimport { flatMap } from '@plexus-interop/common';\nimport { FieldNamesValidator } from './FieldNamesValidator';\n\ntype DiscoveredMetaInfo = {\n    inputMessageId: string,\n    outputMessageId: string,\n    provided: ProvidedMethodReference,\n}\n\ntype ConsumedMetaInfo = {\n    serviceId: string,\n    methodId: string,\n    inputMessageId: string,\n    outputMessageId: string\n}\n\nexport class GenericClientWrapper implements InteropClient {\n\n    private fieldsNamesValidator: FieldNamesValidator;\n\n    public constructor(\n        private readonly appId: string,\n        private readonly genericClient: GenericClientApi,\n        private readonly interopRegistryService: InteropRegistryService,\n        private readonly encoderProvider: DynamicProtoMarshallerFactory,\n        private readonly unaryHandlers: Map<string, UnaryStringHandler>,\n        private readonly serverStreamingHandlers: Map<string, ServerStreamingStringHandler>,\n        private readonly bidiHandlers: Map<string, BidiStreamingStringHandler>,\n        private readonly defaultGenerator: DefaultMessageGenerator) {\n        this.fieldsNamesValidator = new FieldNamesValidator(this.interopRegistryService);\n    }\n\n    public getConnectionStrId(): string {\n        return this.genericClient.getConnectionId().toString();\n    }\n\n    public validateRequest(method: DiscoveredMethod | ConsumedMethod | ProvidedMethod, payload: string): void {\n        const { inputMessageId, outputMessageId } = this.toMetaInfo(method);\n        this.validateRequestByMessageId(this.isProvided(method) ? outputMessageId : inputMessageId, payload);\n    }\n\n    public createPayloadPreview(messageId: string, jsonPayload: string): string {\n        try {\n            const requestData = JSON.parse(jsonPayload);\n            const requestEncoder = this.encoderProvider.getMarshaller(messageId);\n            const encodedRequest: ArrayBuffer = requestEncoder.encode(requestData);\n            return `[${new Uint8Array(encodedRequest).toString()}]`;\n        } catch (error) {\n            return \"Unable to generate payload\";\n        }\n    }\n\n    public disconnect(): Promise<void> {\n        return this.genericClient.disconnect();\n    }\n\n    public setUnaryActionHandler(\n        serviceId: string, \n        methodId: string, \n        serviceAlias: string, \n        handler: (invocationContext: MethodInvocationContext, requestJson: string) => Promise<string>): void {\n        this.unaryHandlers.set(methodHash({\n            serviceId,\n            methodId,\n            serviceAlias\n        }), handler);\n    }\n\n    private validateRequestByMessageId(messageId: string, payload: any): void {\n        const requestEncoder = this.encoderProvider.getMarshaller(messageId);\n        const requestData = JSON.parse(payload);\n        requestEncoder.validate(requestData);\n        this.fieldsNamesValidator.validate(messageId, requestData);\n    }\n\n    private isConsumed(methodToInvoke: DiscoveredMethod | ConsumedMethod | ProvidedMethod): methodToInvoke is ConsumedMethod {\n        return !!(methodToInvoke as ConsumedMethod).consumedService;\n    }\n    \n    private isDiscovered(methodToInvoke: DiscoveredMethod | ConsumedMethod | ProvidedMethod): methodToInvoke is DiscoveredMethod {\n        return !!(methodToInvoke as DiscoveredMethod).providedMethod;\n    }\n\n    private toMetaInfo(method: DiscoveredMethod | ConsumedMethod | ProvidedMethod): DiscoveredMetaInfo | ConsumedMetaInfo {\n        if (this.isConsumed(method)) {\n            return {\n                inputMessageId: method.method.requestMessage.id,\n                outputMessageId: method.method.responseMessage.id,\n                serviceId: method.consumedService.service.id,\n                methodId: method.method.name\n            };\n        } else if (this.isDiscovered(method)) {\n            return {\n                inputMessageId: method.inputMessageId as string,\n                outputMessageId: method.outputMessageId as string,\n                provided: method.providedMethod\n            };\n        } else {\n            return {\n                inputMessageId: method.method.requestMessage.id,\n                outputMessageId: method.method.responseMessage.id as string,\n                serviceId: method.method.service.id,\n                methodId: method.method.name\n            };\n        }\n    }\n\n    private isProvided(method: DiscoveredMethod | ConsumedMethod | ProvidedMethod): boolean {\n        return !this.isConsumed(method) && !this.isDiscovered(method);\n    }\n\n    public async sendUnaryRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, requestJson: string, responseHandler: ValueHandler<string>): Promise<InvocationClient> {\n\n        const metaInfo = this.toMetaInfo(methodToInvoke);\n        const { inputMessageId, outputMessageId } = metaInfo;\n\n        const requestEncoder = this.encoderProvider.getMarshaller(inputMessageId);\n        const responseEncoder = this.encoderProvider.getMarshaller(outputMessageId);\n\n        const requestData = JSON.parse(requestJson);\n        requestEncoder.validate(requestData);\n\n        const encodedRequest = requestEncoder.encode(requestData);\n\n        const internalResponseHandler = {\n            value: v => responseHandler.value(JSON.stringify(responseEncoder.decode(v))),\n            error: e => responseHandler.error(e)\n        };\n\n        if (!this.isConsumed(methodToInvoke)) {\n            const provided = (metaInfo as DiscoveredMetaInfo).provided;\n            return await this.genericClient.sendRawUnaryRequest(\n                provided,\n                encodedRequest,\n                internalResponseHandler);\n        } else {\n            const consumedMetaInfo = (metaInfo as ConsumedMetaInfo);\n            return await this.genericClient.sendRawUnaryRequest({\n                serviceId: consumedMetaInfo.serviceId,\n                methodId: consumedMetaInfo.methodId\n            }, encodedRequest, internalResponseHandler);\n        }\n    }\n\n    public setBidiStreamingActionHandler(serviceId: string, methodId: string, serviceAlias: string, handler: BidiStreamingStringHandler): void {\n        this.bidiHandlers.set(methodHash({\n            serviceId,\n            methodId,\n            serviceAlias\n        }), handler);\n    }\n\n    public setServerStreamingActionHandler(serviceId: string, methodId: string, serviceAlias: string, handler: ServerStreamingStringHandler): void {\n        this.serverStreamingHandlers.set(methodHash({\n            serviceId,\n            methodId,\n            serviceAlias\n        }), handler);\n    }\n\n    public async sendBidiStreamingRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, responseObserver: InvocationObserver<string>): Promise<StreamingInvocationClient<string>> {\n\n        const metaInfo = this.toMetaInfo(methodToInvoke);\n        const { inputMessageId, outputMessageId } = metaInfo;\n\n        const requestEncoder = this.encoderProvider.getMarshaller(inputMessageId);\n        const responseEncoder = this.encoderProvider.getMarshaller(outputMessageId);\n\n        const observer = toGenericObserver(responseObserver, responseEncoder);\n\n        if (!this.isConsumed(methodToInvoke)) {\n            const provided = (metaInfo as DiscoveredMetaInfo).provided;\n            const baseClient = await this.genericClient.sendRawBidirectionalStreamingRequest(provided, observer);\n            return wrapGenericHostClient(baseClient, requestEncoder);\n        } else {\n            const consumedMetaInfo = (metaInfo as ConsumedMetaInfo);\n            const baseClient = await this.genericClient.sendRawBidirectionalStreamingRequest({\n                serviceId: consumedMetaInfo.serviceId,\n                methodId: consumedMetaInfo.methodId\n            }, observer);\n            return wrapGenericHostClient(baseClient, requestEncoder);\n        }\n    }\n\n    public sendServerStreamingRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, requestJson: string, responseObserver: InvocationObserver<string>): Promise<InvocationClient> {\n\n        const metaInfo = this.toMetaInfo(methodToInvoke);\n        const { inputMessageId, outputMessageId } = metaInfo;\n\n        const requestEncoder = this.encoderProvider.getMarshaller(inputMessageId);\n        const responseEncoder = this.encoderProvider.getMarshaller(outputMessageId);\n\n        const requestData = JSON.parse(requestJson);\n        requestEncoder.validate(requestData);\n\n        const encodedRequest = requestEncoder.encode(requestData);\n        const observer = toGenericObserver(responseObserver, responseEncoder);\n\n        if (!this.isConsumed(methodToInvoke)) {\n            const provided = (metaInfo as DiscoveredMetaInfo).provided;\n            return this.genericClient.sendRawServerStreamingRequest(provided, encodedRequest, observer);\n        } else {\n            const consumedMetaInfo = (metaInfo as ConsumedMetaInfo);\n            return this.genericClient.sendRawServerStreamingRequest({\n                serviceId: consumedMetaInfo.serviceId,\n                methodId: consumedMetaInfo.methodId\n            }, encodedRequest, observer);\n        }\n    }\n\n    public resetInvocationHandlers(): void {\n        const providedServices = this.interopRegistryService.getProvidedServices(this.appId);\n        const notInterceptedMsg = 'Plexus Studio: Not intercepted';\n        const notInterceptedError = new Error(notInterceptedMsg);\n        flatMap((ps: ProvidedService) => ps.methods.valuesArray(), providedServices)\n            .forEach(pm => {\n                const pmFullName = methodHash({\n                    serviceId: pm.providedService.service.id,\n                    serviceAlias: pm.providedService.alias,\n                    methodId: pm.method.name\n                });\n                switch (pm.method.type) {\n                    case MethodType.Unary:\n                        this.unaryHandlers.set(pmFullName, async () => Promise.reject(notInterceptedError));\n                        break;\n                    case MethodType.ServerStreaming:\n                        this.serverStreamingHandlers.set(pmFullName, (context, request, hostClient) => hostClient.error(new ClientError(notInterceptedMsg)));\n                        break;\n                    case MethodType.DuplexStreaming:\n                    case MethodType.ClientStreaming:\n                        this.bidiHandlers.set(pmFullName, (context, hostClient) => {\n                            hostClient.error(new ClientError(notInterceptedMsg));\n                            return {\n                                next: v => { },\n                                complete: () => { },\n                                error: e => { },\n                                streamCompleted: () => { }\n                            };\n                        });\n                        break;\n                }\n            });\n    }\n\n    public createDefaultPayload(messageId: string): string {\n        return this.defaultGenerator.generate(messageId);\n    }\n\n    public discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse> {\n        return this.genericClient.discoverMethod(discoveryRequest)\n    }\n\n    public async discoverAllMethods(method: ConsumedMethod): Promise<MethodDiscoveryResponse> {\n        const consumedMethod = {\n            consumedService: {\n                serviceId: method.consumedService.service.id,\n                serviceAlias: method.consumedService.alias\n            },\n            methodId: method.method.name\n        };\n        const discoveryRequest = { consumedMethod };\n        const discoveredMethods = await this.discoverMethod(discoveryRequest);\n        const onlineMethods = await this.discoverMethod({\n            ...discoveryRequest,\n            discoveryMode: DiscoveryMode.Online\n        });\n        if (onlineMethods && onlineMethods.methods) {\n            onlineMethods.methods.forEach(pm => discoveredMethods.methods.push(pm));\n        }\n        return discoveredMethods;\n    }\n\n}\n\nexport function methodHash(methodInfo: { serviceId: string, methodId: string, serviceAlias?: string }): string {\n    const alias = methodInfo.serviceAlias || 'default';\n    return `${methodInfo.serviceId}.${alias}.${methodInfo.methodId}`;\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/InteropClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StreamingInvocationClient, ValueHandler, InvocationClient, MethodDiscoveryResponse, MethodDiscoveryRequest, DiscoveredMethod, InvocationObserver } from '@plexus-interop/client';\nimport { ConsumedMethod, ProvidedMethod } from '@plexus-interop/metadata';\nimport { UnaryStringHandler, ServerStreamingStringHandler, BidiStreamingStringHandler } from './StringHandlers';\n\nexport interface InteropClient {\n\n    // core\n\n    getConnectionStrId(): string; \n\n    discoverMethod(discoveryRequest: MethodDiscoveryRequest): Promise<MethodDiscoveryResponse>;\n\n    discoverAllMethods(consumedMethod: ConsumedMethod): Promise<MethodDiscoveryResponse>;\n\n    disconnect(): Promise<void>;\n\n    createDefaultPayload(messageId: string): string;\n\n    createPayloadPreview(messageId: string, jsonPayload: string): string;\n\n    validateRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod | ProvidedMethod, payload: string): void;\n\n    resetInvocationHandlers(): void;\n\n    // unary\n\n    sendUnaryRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, requestJson: string, responseHandler: ValueHandler<string>): Promise<InvocationClient>;\n\n    setUnaryActionHandler(serviceId: string, methodId: string, alias: string, handler: UnaryStringHandler): void;\n\n    // server streaming\n\n    sendServerStreamingRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, requestJson: string, responseObserver: InvocationObserver<string>): Promise<InvocationClient>;\n\n    setServerStreamingActionHandler(serviceId: string, methodId: string, alias: string, handler: ServerStreamingStringHandler): void;\n\n    // bidi streaming\n\n    sendBidiStreamingRequest(methodToInvoke: DiscoveredMethod | ConsumedMethod, responseObserver: InvocationObserver<string>): Promise<StreamingInvocationClient<string>>;\n\n    setBidiStreamingActionHandler(serviceId: string, methodId: string, alias: string, handler: BidiStreamingStringHandler): void;    \n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/InteropClientFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UrlParamsProvider } from '@plexus-interop/common';\nimport { InteropClient } from './InteropClient';\nimport { Injectable } from '@angular/core';\nimport { TransportConnectionProvider } from '../transport/TransportConnectionProvider';\nimport { InteropRegistryService, ProvidedMethod, ProvidedService } from '@plexus-interop/metadata';\nimport { GenericClientApiBuilder, MethodType, UnaryInvocationHandler, StreamingInvocationClient, ServerStreamingInvocationHandler, BidiStreamingInvocationHandler, InvocationObserver } from '@plexus-interop/client';\nimport { UniqueId, ClientError } from '@plexus-interop/protocol';\nimport { flatMap, Logger, LoggerFactory, Observer } from '@plexus-interop/common';\nimport { GenericClientWrapper, methodHash } from './GenericClientWrapper';\nimport { DynamicProtoMarshallerFactory } from '@plexus-interop/io/dist/main/src/dynamic';\nimport { DefaultMessageGenerator } from './DefaultMessageGenerator';\nimport { Marshaller } from '@plexus-interop/io';\nimport { UnaryStringHandler, BidiStreamingStringHandler, ServerStreamingStringHandler, wrapGenericHostClient } from './StringHandlers';\nimport { DefaultConnectionDetailsService } from '@plexus-interop/client';\n\nconst discoveryService: DefaultConnectionDetailsService = new DefaultConnectionDetailsService();\n\n@Injectable()\nexport class InteropClientFactory {\n\n    private readonly log: Logger = LoggerFactory.getLogger('IntropClientFactory');\n\n    public async connect(\n        appId: string,\n        interopRegistryService: InteropRegistryService,\n        connectionProvider: TransportConnectionProvider): Promise<InteropClient> {\n\n        this.log.info(`Connecting as ${appId}`);\n\n        let genericClientBuilder = new GenericClientApiBuilder();\n        \n        const details = await discoveryService.getConnectionDetails();\n        this.log.info(`Instance ID provided by launcher: ${details.appInstanceId}`);\n\n        let appInstanceId = UrlParamsProvider.getParam('plexusInstanceId') || details.appInstanceId;\n        if (appInstanceId) {\n            this.log.info(`Connecting with ${appInstanceId} instance ID`);\n        }\n\n        genericClientBuilder = genericClientBuilder\n            .withClientDetails({\n                applicationId: appId,\n                applicationInstanceId: appInstanceId ? UniqueId.fromString(appInstanceId) : UniqueId.generateNew()\n            })\n            .withTransportConnectionProvider(connectionProvider);\n\n        const providedServices = interopRegistryService.getProvidedServices(appId);\n\n        const unaryHandlers = new Map<string, UnaryStringHandler>();\n        const serverStreamingHandlers = new Map<string, ServerStreamingStringHandler>();\n        const bidiStreamingHandlers = new Map<string, BidiStreamingStringHandler>();\n\n        const marshallerFactory = new DynamicProtoMarshallerFactory(interopRegistryService.getRegistry());\n\n        flatMap((ps: ProvidedService) => ps.methods.valuesArray(), providedServices)\n            .forEach(pm => {\n                const requestMarshaller = marshallerFactory.getMarshaller(pm.method.requestMessage.id);\n                const responseMarshaller = marshallerFactory.getMarshaller(pm.method.responseMessage.id);\n                switch (pm.method.type) {\n                    case MethodType.Unary:\n                        genericClientBuilder.withUnaryHandler(this.createUnaryHandler(pm, requestMarshaller, responseMarshaller, unaryHandlers));\n                        break;\n                    case MethodType.ServerStreaming:\n                        genericClientBuilder.withServerStreamingHandler(this.createServerStreamingHandler(pm, requestMarshaller, responseMarshaller, serverStreamingHandlers));\n                        break;\n                    case MethodType.DuplexStreaming:\n                    case MethodType.ClientStreaming:\n                        genericClientBuilder.withBidiStreamingHandler(this.createBidiStreamingHandlers(pm, requestMarshaller, responseMarshaller, bidiStreamingHandlers));\n                        break;\n                }\n            });\n\n        const client = await genericClientBuilder.connect();\n\n        this.log.info(`Connected as ${appId}`);\n\n        const clientWrapper = new GenericClientWrapper(\n            appId, \n            client, \n            interopRegistryService, \n            marshallerFactory, unaryHandlers, \n            serverStreamingHandlers, \n            bidiStreamingHandlers, new DefaultMessageGenerator(interopRegistryService));\n        \n        clientWrapper.resetInvocationHandlers();\n\n        return clientWrapper;\n    }\n\n    private fullName(pm: ProvidedMethod): string {\n        return methodHash({\n            serviceId: pm.providedService.service.id,\n            serviceAlias: pm.providedService.alias,\n            methodId: pm.method.name\n        });\n    }\n\n    private createUnaryHandler(pm: ProvidedMethod, requestMarshaller: Marshaller<any, ArrayBuffer>,\n        responseMarshaller: Marshaller<any, ArrayBuffer>, handlers: Map<string, UnaryStringHandler>): UnaryInvocationHandler<ArrayBuffer, ArrayBuffer> {\n        const fullName = this.fullName(pm);\n        return {\n            serviceInfo: {\n                serviceId: pm.providedService.service.id,\n                serviceAlias: pm.providedService.alias\n            },\n            methodId: pm.method.name,\n            handle: async (invocationContext, request) => {\n                const requestObj = requestMarshaller.decode(request);\n                const stringHandler = handlers.get(fullName);\n                const stringResponse = await stringHandler(invocationContext, JSON.stringify(requestObj));\n                return responseMarshaller.encode(JSON.parse(stringResponse));\n            }\n        }\n    }\n\n    private createBidiStreamingHandlers(\n        pm: ProvidedMethod,\n        requestMarshaller: Marshaller<any, ArrayBuffer>,\n        responseMarshaller: Marshaller<any, ArrayBuffer>,\n        handlers: Map<string, BidiStreamingStringHandler>): BidiStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> {\n        const fullName = this.fullName(pm);\n        return {\n            serviceInfo: {\n                serviceId: pm.providedService.service.id,\n                serviceAlias: pm.providedService.alias\n            },\n            methodId: pm.method.name,\n            handle: (context, hostClient) => {\n                const stringHandler = handlers.get(fullName);\n                const stringRequestObserver: InvocationObserver<string> = stringHandler(context, wrapGenericHostClient(hostClient, responseMarshaller));\n                return {\n                    next: (v: ArrayBuffer) => {\n                        stringRequestObserver.next(JSON.stringify(requestMarshaller.decode(v)));\n                    },\n                    error: e => stringRequestObserver.error(e),\n                    complete: () => stringRequestObserver.complete(),\n                    streamCompleted: () => stringRequestObserver.streamCompleted()\n                };\n            }\n        }\n    }\n\n    private createServerStreamingHandler(\n        pm: ProvidedMethod,\n        requestMarshaller: Marshaller<any, ArrayBuffer>,\n        responseMarshaller: Marshaller<any, ArrayBuffer>,\n        handlers: Map<string, ServerStreamingStringHandler>): ServerStreamingInvocationHandler<ArrayBuffer, ArrayBuffer> {\n        const fullName = this.fullName(pm);\n        return {\n            serviceInfo: {\n                serviceId: pm.providedService.service.id,\n                serviceAlias: pm.providedService.alias\n            },\n            methodId: pm.method.name,\n            handle: async (context, request, hostClient) => {\n                const requestObj = requestMarshaller.decode(request);\n                const stringHandler = handlers.get(fullName);\n                await stringHandler(context, JSON.stringify(requestObj), wrapGenericHostClient(hostClient, responseMarshaller));\n            }\n        }\n    }\n\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/InteropServiceFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Injectable } from '@angular/core';\nimport { InteropRegistryService, UrlInteropRegistryProvider, AppRegistryService, UrlAppRegistryProvider, AppRegistryProvider, InteropRegistryProvider } from\n    '@plexus-interop/metadata';\n\n@Injectable()\nexport class InteropServiceFactory {\n\n    public async getInteropRegistryService(metadataUrl: string): Promise<InteropRegistryService> {\n        const provider = await this.createInteropRegistryProvider(metadataUrl);\n        return new InteropRegistryService(provider);\n    }\n\n    public async getAppRegistryService(appsUrl: string): Promise<AppRegistryService> {\n        const provider = await this.createAppRegistryProvider(appsUrl);\n        return new AppRegistryService(provider);\n    }\n\n    public async createInteropRegistryProvider(metadataUrl: string): Promise<InteropRegistryProvider> {\n        const provider = new UrlInteropRegistryProvider(metadataUrl);\n        await provider.start();\n        return provider;\n    }\n\n    public async createAppRegistryProvider(appsUrl: string): Promise<AppRegistryProvider> {\n        const provider = new UrlAppRegistryProvider(appsUrl);\n        await provider.start();\n        return provider;\n    }\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/StringHandlers.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { StreamingInvocationClient, InvocationObserver, MethodInvocationContext  } from '@plexus-interop/client';\nimport { Marshaller } from '@plexus-interop/io';\n\nexport type UnaryStringHandler = (invocationContext: MethodInvocationContext, requestJson: string) => Promise<string>;\nexport type ServerStreamingStringHandler = (invocationContext: MethodInvocationContext, request: string, invocationHostClient: StreamingInvocationClient<string>) => void;\nexport type BidiStreamingStringHandler = (invocationContext: MethodInvocationContext, invocationHostClient: StreamingInvocationClient<string>) => InvocationObserver<string>;\n\nexport function wrapGenericHostClient(base: StreamingInvocationClient<ArrayBuffer>, marshaller: Marshaller<any, ArrayBuffer>): StreamingInvocationClient<string> {\n    return {\n        complete: () => base.complete(),\n        next: async v => base.next(marshaller.encode(JSON.parse(v))),\n        error: e => base.error(e),\n        cancel: () => base.cancel()\n    };\n}\n\nexport function toGenericObserver(base: InvocationObserver<string>, decoder: Marshaller<any, ArrayBuffer>): InvocationObserver<ArrayBuffer> {\n    return {\n        next: v => base.next(JSON.stringify(decoder.decode(v))),\n        complete: () => base.complete(),\n        error: e => base.error(e),\n        streamCompleted: () => base.streamCompleted()\n    };\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/TransportConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnectionProvider } from './TransportConnectionProvider';\nimport { Injectable } from '@angular/core';\nimport { CrossDomainEventBus, WebBrokerConnectionBuilder, CrossDomainEventBusProvider, BroadCastChannelEventBus, EventBus } from '@plexus-interop/broker';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { InteropServiceFactory } from './InteropServiceFactory';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport { LoggerFactory } from '@plexus-interop/common';\nimport { StudioExtensions } from '../extensions/StudioExtensions';\nimport { TransportType, ConnectionDetails } from '../ui/AppModel';\n\n@Injectable()\nexport class TransportConnectionFactory {\n\n    private readonly serviceFactory: InteropServiceFactory = new InteropServiceFactory();\n    private readonly log = LoggerFactory.getLogger('TransportConnectionFactory');\n\n    public async getConnectionProvider(connectionDetails: ConnectionDetails): Promise<TransportConnectionProvider> {\n        return StudioExtensions\n            .getConnectionProvider()\n            .then(cp => {\n                this.log.info('Received Connection Provider from Studio Extension');\n                return cp;\n            })\n            .catch(() => {\n                this.log.debug('Could\\'t get connection from extension');\n                return this.lookupProviderFromConnectionDetails(connectionDetails);\n            });\n    }\n\n    private createCrossDomainWebTransportProvider(connectionDetails: ConnectionDetails): TransportConnectionProvider {\n        if (!connectionDetails.webConfig\n            || !connectionDetails.webConfig.proxyHostUrl\n            || !connectionDetails.webConfig.appsMetadataUrl\n            || !connectionDetails.generalConfig.metadataUrl) {\n            throw new Error('Proxy Host/Metadata/Apps URLs are mandatory');\n        }\n        return this.createWebTransportProvider(\n            connectionDetails.webConfig.appsMetadataUrl,\n            connectionDetails.generalConfig.metadataUrl,\n            async () => {\n                const eventBus = await new CrossDomainEventBusProvider(\n                    async () => connectionDetails.webConfig.proxyHostUrl)\n                    .connect() as CrossDomainEventBus;\n                return eventBus;\n            }\n        );\n    }\n\n    private async lookupProviderFromConnectionDetails(connectionDetails: ConnectionDetails): Promise<TransportConnectionProvider> {\n        const transport = connectionDetails.generalConfig.transportType;\n        switch (transport) {\n            case TransportType.NATIVE_WS:\n                this.log.info('Connecting to Native WS Transport');\n                return this.createWebSocketTransportProvider(connectionDetails);\n            case TransportType.WEB_SAME_BROADCAST:\n                this.log.info('Connecting to Same Domain Broad Cast Transport');\n                return this.createSameOriginWebTransportProvider(connectionDetails);\n            case TransportType.WEB_CROSS:\n                this.log.info('Connecting to Cross Domain Transport');\n                return this.createCrossDomainWebTransportProvider(connectionDetails);\n            default:\n                throw new Error(`Unsupported Transport Type: ${transport}`);\n        }\n    }\n\n    private createSameOriginWebTransportProvider(connectionDetails: ConnectionDetails): TransportConnectionProvider {\n        if (!connectionDetails.webConfig\n            || !connectionDetails.webConfig.appsMetadataUrl\n            || !connectionDetails.generalConfig.metadataUrl) {\n            throw new Error('Proxy Host/Metadata/Apps URLs are mandatory');\n        }\n        return this.createWebTransportProvider(\n            connectionDetails.webConfig.appsMetadataUrl,\n            connectionDetails.generalConfig.metadataUrl, async () => new BroadCastChannelEventBus().init());\n    }\n\n    private createWebTransportProvider(appsUrl: string, metadataUrl: string, eventBusProvider: () => Promise<EventBus>): TransportConnectionProvider {\n        return async () => {\n            const connection: TransportConnection = await new WebBrokerConnectionBuilder()\n                .withAppRegistryProviderFactory(async () => this.serviceFactory.createAppRegistryProvider(appsUrl))\n                .withInteropRegistryProviderFactory(async () => this.serviceFactory.createInteropRegistryProvider(metadataUrl))\n                .withEventBusProvider(eventBusProvider)\n                .connect();\n            return connection;\n        };\n    }\n\n    private createWebSocketTransportProvider(connectionDetails: ConnectionDetails): TransportConnectionProvider {\n        if (!connectionDetails.wsConfig || !connectionDetails.wsConfig.wsUrl) {\n            throw new Error('Web Socket URL not provided');\n        }\n        return () => new WebSocketConnectionFactory(new WebSocket(connectionDetails.wsConfig.wsUrl)).connect();\n    }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/core/TransportConnectionProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\n\nexport type TransportConnectionProvider = () => Promise<TransportConnection>;\n\n\n"
  },
  {
    "path": "web/packages/studio/src/app/services/core/invocation-utils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodType, DiscoveredMethod } from '@plexus-interop/client';\nimport { Logger, PrefixedLogger } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport function createInvocationLogger(type: MethodType, id: string, baseLogger: Logger, target: DiscoveredMethod = null): Logger {\n    const targetPostfix = target ? ` -> ${UniqueId.fromProperties(target.providedMethod.providedService.connectionId).toString()}` : '';\n    switch (type) {\n        case MethodType.Unary:\n            return new PrefixedLogger(baseLogger, `[Unary ${id}${targetPostfix}]`);\n        case MethodType.ServerStreaming:\n            return new PrefixedLogger(baseLogger, `[ServerStreaming ${id}${targetPostfix}]`);\n        case MethodType.ClientStreaming:\n            return new PrefixedLogger(baseLogger, `[ClientStreaming ${id}${targetPostfix}]`);\n        case MethodType.DuplexStreaming:\n            return new PrefixedLogger(baseLogger, `[DuplexStreaming ${id}${targetPostfix}]`);\n        default:\n            throw new Error('Unknown type');\n    }\n}   "
  },
  {
    "path": "web/packages/studio/src/app/services/effects/ConnectionEffects.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StudioState, ConnectionSetupActionParams, TransportType } from '../ui/AppModel';\nimport { AppActions } from '../ui/AppActions';\nimport { StudioExtensions } from '../extensions/StudioExtensions';\nimport { UrlParamsProvider, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { DefaultConnectionDetailsService } from '@plexus-interop/client';\nimport { TypedAction } from '../reducers/TypedAction';\nimport { ConnectionRequestParams } from '../ui/ConnectionRequestParams';\nimport { TransportConnectionFactory } from '../core/TransportConnectionFactory';\nimport { InteropServiceFactory } from '../core/InteropServiceFactory';\n\nconst discoveryService: DefaultConnectionDetailsService = new DefaultConnectionDetailsService();\nconst requestParams = new ConnectionRequestParams()\nconst log: Logger = LoggerFactory.getLogger('ConnectionEffects');\n\nexport async function autoConnectEffect(state: StudioState) {\n    const metadataUrl = await lookupMetadataUrl();\n    if (metadataUrl) {\n        const wsUrl = await lookupWsUrl();\n        const proxyHostUrl = await lookupHostProxyUrl();\n        const appsMetadataUrl = await lookupAppsUrl();\n        const payload: ConnectionSetupActionParams = {\n            connectionDetails: {\n                generalConfig: {\n                    metadataUrl,\n                    transportType: await lookupTransportType()\n                },\n                wsConfig: wsUrl ? { wsUrl } : null,\n                webConfig: proxyHostUrl && appsMetadataUrl ? { proxyHostUrl, appsMetadataUrl } : null,\n                connected: false\n            },\n            silentOnFailure: true\n        };\n        return {\n            type: AppActions.CONNECTION_SETUP_START,\n            payload\n        };\n    } else {\n        return { type: AppActions.DO_NOTHING };\n    }\n}\n\nexport async function connectionSetupEffect(\n    params: ConnectionSetupActionParams,\n    transportConnectionFactory: TransportConnectionFactory,\n    interopServiceFactory: InteropServiceFactory,\n) {\n    const connectionDetails = params.connectionDetails;\n    const metadataUrl = connectionDetails.generalConfig.metadataUrl;\n    try {\n        const interopRegistryService = await interopServiceFactory.getInteropRegistryService(metadataUrl);\n        const apps = interopRegistryService.getRegistry().applications.valuesArray();\n        log.info(`Successfully loaded metadata from ${metadataUrl}`);\n\n        const connectionProvider = await transportConnectionFactory.getConnectionProvider(connectionDetails);\n        log.info(`Connection provider created`);\n        return {\n            type: AppActions.CONNECTION_SETUP_SUCCESS,\n            payload: {\n                apps,\n                interopRegistryService,\n                connectionProvider\n            }\n        };\n    } catch (error) {\n        const msg = `Connection not successful. Please check your connection setup.`;\n        console.error('Failed to connect', error);\n        if (params.silentOnFailure) {\n            log.info(msg);\n        } else {\n            log.error(msg);\n            return {\n                type: AppActions.DISCONNECT_FROM_PLEXUS\n            };\n        };\n    }\n}\n\nasync function lookupTransportType(): Promise<TransportType> {\n    const transport = UrlParamsProvider.getParam('transport');\n    switch (transport) {\n        case TransportType.WEB_SAME_BROADCAST:\n            return TransportType.WEB_SAME_BROADCAST;\n        case TransportType.WEB_CROSS:\n            return TransportType.WEB_CROSS;\n        case TransportType.NATIVE_WS:\n        default:\n            return TransportType.NATIVE_WS;\n    }\n}\n\nfunction lookupHostProxyUrl(): Promise<string> {\n    return nullable(requestParams.getHostProxyUrl())\n        .catch(() => StudioExtensions.getProxyHostUrl())\n        .catch(() => null);\n}\n\nfunction lookupWsUrl(): Promise<string> {\n    return nullable(requestParams.getWsUrl())\n        .catch(async () => {\n            const details = await discoveryService.getConnectionDetails();\n            return `ws://127.0.0.1:${details.ws.port}`;\n        })\n        .catch(() => `ws://${window.location.host}`);\n}\n\nfunction lookupMetadataUrl(): Promise<string> {\n    return nullable(requestParams.getMetadataUrl())\n        .catch(() => discoveryService.getMetadataUrl())\n        .catch(() => StudioExtensions.getMetadataUrl())\n        .catch(() => `ws://${window.location.host}/metadata/interop`);\n}\n\nfunction lookupAppsUrl(): Promise<string> {\n    return nullable(requestParams.getAppsUrl())\n        .catch(() => StudioExtensions.getAppsUrl())\n        .catch(() => null);\n}\n\nfunction nullable(value: string): Promise<string> {\n    return !!value ? Promise.resolve(value) : Promise.reject('Value is empty');\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/extensions/StudioExtensions.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnectionProvider } from '../transport/TransportConnectionProvider';\n\nexport class StudioExtensions {\n\n    private static connectionProvider?: TransportConnectionProvider;\n    private static proxyHostUrlProvider?: () => Promise<string>;\n    private static metadataUrlProvider?: () => Promise<string>;\n    private static appsUrlProvider?: () => Promise<string>;\n\n    public static setMetadataUrlProvider(provider: () => Promise<string>): void {\n        StudioExtensions.metadataUrlProvider = provider;\n    }\n\n    public static setConnectionProvider(connectionProvider: TransportConnectionProvider): void {\n        StudioExtensions.connectionProvider = connectionProvider;\n    }\n\n    public static setProxyHostUrlProvider(provider: () => Promise<string>): void {\n        StudioExtensions.proxyHostUrlProvider = provider;\n    }\n\n    public static async getConnectionProvider(): Promise<TransportConnectionProvider> {\n        return StudioExtensions.connectionProvider || Promise.reject('Not provided');\n    }\n\n    public static async getProxyHostUrl(): Promise<string> {\n        return StudioExtensions.proxyHostUrlProvider ? StudioExtensions.proxyHostUrlProvider() : Promise.reject('Not provider');\n    }\n\n    public static async getMetadataUrl(): Promise<string> {\n        return StudioExtensions.metadataUrlProvider ? StudioExtensions.metadataUrlProvider() : Promise.reject('Not provided');\n    }\n\n    public static async getAppsUrl(): Promise<string> {\n        return StudioExtensions.appsUrlProvider ? StudioExtensions.appsUrlProvider() : Promise.reject('Not provided');\n    }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/reducers/AlertsHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Application } from '@plexus-interop/metadata';\nimport { TypedAction } from './TypedAction';\nimport { Action } from '@ngrx/store';\n\nexport class Actions {\n    public static readonly ALERT_INFO = 'ALERT_INFO';\n    public static readonly ALERT_ERROR = 'ALERT_ERROR';\n    public static readonly ALERT_USER_FAIL = 'ALERT_USER_FAIL';\n}\n\nexport enum AlertType {\n    INFO, SUCCESS, USER_FAIL, ERROR\n}\n\nexport interface Alert {\n    message: string,\n    type: AlertType\n}\n\nexport interface State {\n    alerts: Alert[]\n}\n\nconst initialState: State = {\n    alerts: []\n};\n\nexport function reducer(\n    state: State = initialState,\n    action: Action\n): State {\n    let stringAction = <TypedAction<string>>action;\n    let type: AlertType;\n    switch (action.type) {\n        case Actions.ALERT_INFO:\n            type = AlertType.INFO\n            break;\n        case Actions.ALERT_INFO:\n            type = AlertType.INFO\n            break;\n        case Actions.ALERT_INFO:\n            type = AlertType.INFO\n            break;\n    }\n    return {\n        alerts: [...state.alerts, { message: stringAction.payload, type: type }]\n    };\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/reducers/ConnectionDetailsReducer.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionDetails, ConnectionSetupActionParams, PlexusConnectedActionParams } from '../ui/AppModel';\nimport { Action } from '@ngrx/store';\nimport { AppActions } from '../ui/AppActions';\nimport { getPayload } from './TypedAction';\n\nexport function connectionDetailsReducer(state: ConnectionDetails, action: Action): ConnectionDetails {\n    switch (action.type) {\n        case AppActions.CONNECTION_SETUP_START:\n            const payload = getPayload<ConnectionSetupActionParams>(action).connectionDetails;\n            return {\n                ...payload,\n                connected: false\n            };\n        case AppActions.CONNECTION_SETUP_SUCCESS:\n            return {\n                ...state,\n                connected: true\n            };\n        default:\n            return state;\n    }\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/reducers/PlexusReducers.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropClient } from '../core/InteropClient';\nimport { Application, ConsumedMethod, ProvidedMethod, InteropRegistryService } from '@plexus-interop/metadata';\nimport { TypedAction, getPayload } from './TypedAction';\nimport { AppActions } from '../ui/AppActions';\nimport { Action } from '@ngrx/store';\nimport { UrlParamsProvider } from '@plexus-interop/common';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\nimport { GeneralConnectionConfig } from '../ui/AppModel';\nimport { connectionDetailsReducer } from './ConnectionDetailsReducer';\n\nimport {\n    AppConnectedActionParams,\n    ConsumedMethodState,\n    ConnectionSetupActionParams,\n    PlexusConnectedActionParams,\n    StudioState,\n    TransportType,\n} from '../ui/AppModel';\n\nconst initialState: StudioState = {\n    loading: false,\n    connectionDetails: {\n        generalConfig: {\n            metadataUrl: null,\n            transportType: TransportType.NATIVE_WS\n        },\n        connected: false\n    },\n    connectedApp: undefined,\n    consumedMethod: undefined,\n    providedMethod: undefined,\n    appsFilter: undefined,\n    serviceFilter: undefined,\n    apps: [],\n    services: {\n        interopRegistryService: undefined,\n        interopClient: undefined,\n        connectionProvider: undefined\n    }\n};\n\nexport function reducer(\n    state: StudioState = initialState,\n    action: Action\n): StudioState {\n    switch (action.type) {\n        case AppActions.CONNECTION_SETUP_START:\n            return {\n                ...initialState,\n                connectionDetails: connectionDetailsReducer(state.connectionDetails, action),\n                loading: true\n            };\n        case AppActions.CONNECTION_SETUP_SUCCESS:\n            let payload = getPayload<PlexusConnectedActionParams>(action);\n            return {\n                ...state,\n                connectionDetails: connectionDetailsReducer(state.connectionDetails, action),\n                apps: payload.apps,\n                services: {\n                    ...state.services,\n                    interopRegistryService: payload.interopRegistryService,\n                    connectionProvider: payload.connectionProvider\n                },\n                loading: false\n            };\n        case AppActions.CONNECTION_SETUP_FAILED:\n            return {\n                ...initialState\n            };\n        case AppActions.DISCONNECT_FROM_PLEXUS:\n            return {\n                ...state\n            };\n        case AppActions.DISCONNECT_FROM_PLEXUS_SUCCESS:\n            return {\n                ...initialState,\n                // keep entered/discovered connection details\n                connectionDetails: {\n                    ...state.connectionDetails,\n                    connected: false\n                }\n            };\n        case AppActions.DISCONNECT_FROM_APP:\n            return {\n                ...state,\n            };\n        case AppActions.DISCONNECT_FROM_APP_SUCCESS:\n            return {\n                ...state,\n                connectedApp: undefined,\n                services: {\n                    ...state.services,\n                    interopClient: undefined\n                }\n            };\n        case AppActions.SELECT_PROVIDED_METHOD:\n            return {\n                ...state,\n                providedMethod: {\n                    method: getPayload<ProvidedMethod>(action)\n                }\n            };\n        case AppActions.CONNECT_TO_APP_SUCCESS:\n            return {\n                ...state,\n                connectedApp: getPayload<AppConnectedActionParams>(action).application,\n                services: {\n                    ...state.services,\n                    interopClient: getPayload<AppConnectedActionParams>(action).interopClient\n                }\n            };\n        case AppActions.DISCOVER_METHODS_SUCCESS:\n            return {\n                ...state,\n                consumedMethod: {\n                    ...state.consumedMethod,\n                    discoveredMethods: getPayload<MethodDiscoveryResponse>(action)\n                }\n            };\n        case AppActions.CONSUMED_METHOD_SUCCESS:\n            return {\n                ...state,\n                consumedMethod: getPayload<ConsumedMethodState>(action)\n            };\n        case AppActions.APPS_FILTER_UPDATED:\n            return {\n                ...state,\n                appsFilter: getPayload<string>(action)\n            };\n        case AppActions.SERVICE_FILTER_UPDATED:\n            return {\n                ...state,\n                serviceFilter: getPayload<string>(action)\n            };\n        default:\n            return state;\n    }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/reducers/TypedAction.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Action } from '@ngrx/store';\n\nexport interface TypedAction<P> extends Action {\n    payload: P;\n};\n\nexport function getPayload<T>(action: Action): T {\n    return (<TypedAction<T>>action).payload;\n};"
  },
  {
    "path": "web/packages/studio/src/app/services/transport/TransportConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnectionProvider } from './TransportConnectionProvider';\nimport { Injectable } from '@angular/core';\nimport { CrossDomainEventBus, WebBrokerConnectionBuilder, CrossDomainEventBusProvider } from '@plexus-interop/broker';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { InteropServiceFactory } from '../core/InteropServiceFactory';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\nimport { DomUtils } from '@plexus-interop/common';\nimport { ConnectionDetails } from '../ui/AppModel';\n\n@Injectable()\nexport class TransportConnectionFactory {\n\n    private readonly serviceFactory: InteropServiceFactory = new InteropServiceFactory();\n\n    public createWebTransportProvider(connectionDetails: ConnectionDetails): TransportConnectionProvider {\n        return async () => {\n            let eventBus: CrossDomainEventBus;\n            const proxyHostUrl = connectionDetails.webConfig.proxyHostUrl;\n            const appsMetadataUrl = connectionDetails.webConfig.appsMetadataUrl;\n            const metadataUrl = connectionDetails.generalConfig.metadataUrl;\n            const iFrameId = 'plexus-' + DomUtils.getOrigin(proxyHostUrl).replace(/\\.\\/\\:/g, '-');\n            const connection: TransportConnection = await new WebBrokerConnectionBuilder()\n                .withAppRegistryProviderFactory(async () => this.serviceFactory.createAppRegistryProvider(appsMetadataUrl))\n                .withInteropRegistryProviderFactory(async () => this.serviceFactory.createInteropRegistryProvider(metadataUrl))\n                .withEventBusProvider(async () => {\n                    eventBus = await new CrossDomainEventBusProvider(\n                        async () => proxyHostUrl, iFrameId)\n                        .connect() as CrossDomainEventBus;\n                    return eventBus;\n                })\n                .connect();\n            return connection;\n        };\n    }\n\n    public createWebSocketTransportProvider(wsUrl: string): TransportConnectionProvider {\n        return () => new WebSocketConnectionFactory(new WebSocket(wsUrl)).connect();\n    }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/transport/TransportConnectionProvider.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '@plexus-interop/transport-common';\n\nexport type TransportConnectionProvider = () => Promise<TransportConnection>;\n\n\n"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/AppActions.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { State } from './RootReducers';\nimport { Injectable } from '@angular/core';\nimport { Action } from 'redux';\n\n@Injectable()\nexport class AppActions {\n\n    static APPS_FILTER_UPDATED = 'APPS_FILTER_UPDATED';\n    static SERVICE_FILTER_UPDATED = 'SERVICE_FILTER_UPDATED';\n    \n    static CONNECTION_SETUP_START = 'CONNECTION_SETUP_START';\n    static CONNECTION_SETUP_FAILED = 'CONNECTION_SETUP_FAILED';   \n    static CONNECTION_SETUP_SUCCESS = 'CONNECTION_SETUP_SUCCESS';\n    \n    static DISCONNECT_FROM_PLEXUS = 'DISCONNECT_FROM_PLEXUS';\n    static DISCONNECT_FROM_PLEXUS_SUCCESS = 'DISCONNECT_FROM_PLEXUS_SUCCESS';\n\n    static SELECT_CONSUMED_METHOD = 'SELECT_CONSUMED_METHOD';\n    static CONSUMED_METHOD_SUCCESS = 'CONSUMED_METHOD_SUCCESS';\n\n    static SELECT_PROVIDED_METHOD = 'SELECT_PROVIDED_METHOD';\n    \n    static DISCONNECT_FROM_APP = 'DISCONNECT_FROM_APP';\n    static NAVIGATE_TO_APP = 'NAVIGATE_TO_APP';\n    static DISCONNECT_FROM_APP_SUCCESS = 'DISCONNECT_FROM_APP_SUCCESS';\n    \n    static CONNECT_TO_APP_START = 'CONNECT_TO_APP_START';\n    static CONNECT_TO_APP_FAILED = 'CONNECT_TO_APP_FAILED';\n    static CONNECT_TO_APP_SUCCESS = 'CONNECT_TO_APP_SUCCESS';\n\n    static DISCOVER_METHODS_SUCCESS = 'DISCOVER_METHODS_SUCCESS';\n\n    static DO_NOTHING = 'DO_NOTHING';\n   \n    static AUTO_CONNECT = 'AUTO_CONNECT';\n    \n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/AppEffects.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerFactory } from '@plexus-interop/common';\nimport { logger, State } from './RootReducers';\nimport { TransportConnectionFactory } from '../core/TransportConnectionFactory';\nimport { Application, ConsumedMethod } from '@plexus-interop/metadata';\nimport {\n    Alert,\n    AppConnectedActionParams,\n    ConnectionSetupActionParams,\n    PlexusConnectedActionParams,\n    ServicesSnapshot,\n    StudioState,\n} from './AppModel';\nimport { TypedAction } from '../reducers/TypedAction';\nimport { InteropClientFactory } from '../core/InteropClientFactory';\nimport { AppRegistryService } from '@plexus-interop/metadata';\nimport { InteropServiceFactory } from '../core/InteropServiceFactory';\nimport { AppActions } from './AppActions';\nimport 'rxjs/add/operator/map';\nimport 'rxjs/add/operator/mergeMap';\nimport 'rxjs/add/operator/catch';\nimport 'rxjs/add/operator/combineLatest';\nimport 'rxjs/add/operator/withLatestFrom';\nimport { Injectable } from '@angular/core';\nimport { Http } from '@angular/http';\nimport { Observable } from 'rxjs/Observable';\nimport { Action, Store } from '@ngrx/store';\nimport { Actions, Effect } from '@ngrx/effects';\nimport { Router } from '@angular/router';\nimport { DiscoveryMode } from '@plexus-interop/client-api';\nimport { UrlParamsProvider } from '@plexus-interop/common';\nimport { TransportType } from '../ui/AppModel';\nimport { StudioExtensions } from '../extensions/StudioExtensions';\nimport { autoConnectEffect, connectionSetupEffect } from '../effects/ConnectionEffects';\n\n@Injectable()\nexport class Effects {\n\n    private log = LoggerFactory.getLogger(Effects.name);\n\n    @Effect() autoConnectToPlexus$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.AUTO_CONNECT)\n        .withLatestFrom(this.store.select(state => state.plexus))\n        .mergeMap(async ([action, state]) => autoConnectEffect(state));\n\n    @Effect() connectToPlexus$: Observable<Action> = this\n        .actions$\n        .ofType<TypedAction<ConnectionSetupActionParams>>(AppActions.CONNECTION_SETUP_START)\n        .mergeMap(async action => connectionSetupEffect(action.payload, this.transportConnectionFactory, this.interopServiceFactory));\n\n    @Effect() plexusConnected$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.CONNECTION_SETUP_SUCCESS)\n        .map(_ => {\n            this.router.navigate(['/apps'], { queryParamsHandling: 'merge' });\n            return { type: AppActions.DO_NOTHING };\n        });\n\n    @Effect() disconnectMetadata = this.actions$\n        .ofType(AppActions.DISCONNECT_FROM_PLEXUS)\n        .withLatestFrom(this.store.select(state => state.plexus.services).filter(services => !!services))\n        .mergeMap(async ([action, services]) => {\n\n            if (services.interopClient) {\n                await services.interopClient.disconnect();\n            }\n\n            this.log.info(`Disconnected from Plexus`);\n\n            this.router.navigate(['/']);\n\n            return { type: AppActions.DISCONNECT_FROM_PLEXUS_SUCCESS };\n        });\n\n    @Effect() connectToApp$: Observable<TypedAction<AppConnectedActionParams>> = this\n        .actions$\n        .ofType<TypedAction<Application>>(AppActions.CONNECT_TO_APP_START)\n        .withLatestFrom(this.store.select(state => state.plexus.services).filter(services => !!services))\n        .mergeMap(async ([action, services]) => {\n\n            const application = action.payload;\n            const appId = application.id;\n\n            const interopClient = await this.interopClientFactory.connect(appId, services.interopRegistryService, services.connectionProvider);\n\n            return {\n                type: AppActions.CONNECT_TO_APP_SUCCESS,\n                payload: { interopClient, application }\n            };\n        });\n\n    @Effect() loadConsumedMethod$: Observable<TypedAction<any>> =\n        this.actions$\n            .ofType<TypedAction<ConsumedMethod>>(AppActions.SELECT_CONSUMED_METHOD)\n            .withLatestFrom(this.store.select(state => state.plexus.services).filter(services => !!services))\n            .mergeMap(async ([action, services]) => {\n                const method = action.payload;\n                const interopClient = services.interopClient;\n                const discoveredMethods = await interopClient.discoverAllMethods(method);\n                return {\n                    type: AppActions.CONSUMED_METHOD_SUCCESS,\n                    payload: {\n                        method,\n                        discoveredMethods\n                    }\n                };\n            });\n\n    @Effect() appConnected$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.CONNECT_TO_APP_SUCCESS)\n        .map(_ => {\n            return { type: AppActions.NAVIGATE_TO_APP };\n        });\n\n    @Effect() consumedActionLoaded$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.CONSUMED_METHOD_SUCCESS)\n        .map(_ => {\n            this.router.navigate(['/consumed'], { queryParamsHandling: 'merge' });\n            return { type: AppActions.DO_NOTHING };\n        });\n\n    @Effect() appConnectionFailed$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.CONNECT_TO_APP_FAILED)\n        .map(_ => {\n            this.router.navigate(['/apps']);\n            return { type: AppActions.DO_NOTHING };\n        });\n\n    @Effect() navigateToApp$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.NAVIGATE_TO_APP)\n        .withLatestFrom(this.store.select(state => state.plexus.services))\n        .mergeMap(async ([action, services]) => {\n            services.interopClient.resetInvocationHandlers();\n            this.router.navigate(['/app'], { queryParamsHandling: 'merge' });\n            return { type: AppActions.DO_NOTHING };\n        });\n\n    @Effect() disconnectFromApp$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.DISCONNECT_FROM_APP)\n        .withLatestFrom(this.store.select(state => state.plexus.services))\n        .mergeMap(async ([action, services]) => {\n            const disconnected = await services.interopClient.disconnect();\n            return { type: AppActions.DISCONNECT_FROM_APP_SUCCESS };\n        });\n\n    @Effect() disconnectedFromApp$: Observable<Action> = this\n        .actions$\n        .ofType(AppActions.DISCONNECT_FROM_APP_SUCCESS)\n        .withLatestFrom(this.store.select(state => state.plexus.services))\n        .map(_ => {\n            this.log.info(`Disconnected from app - success!`);\n            this.router.navigate(['/apps']);\n\n            return { type: AppActions.DO_NOTHING };\n        });\n\n    constructor(\n        private http: Http,\n        private actions$: Actions,\n        private transportConnectionFactory: TransportConnectionFactory,\n        private interopServiceFactory: InteropServiceFactory,\n        private interopClientFactory: InteropClientFactory,\n        private store: Store<State>,\n        private router: Router\n    ) { }\n}\n"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/AppModel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ProvidedMethod } from '@plexus-interop/metadata';\nimport { InteropClient } from '../core/InteropClient';\nimport { TransportConnectionProvider } from '../core/TransportConnectionProvider';\nimport { Application, ConsumedMethod } from '@plexus-interop/metadata';\nimport { InteropRegistryService } from '@plexus-interop/metadata';\nimport { TransportConnection } from '@plexus-interop/transport-common';\nimport { MethodDiscoveryResponse } from '@plexus-interop/client-api';\n\nexport interface ServicesSnapshot {\n    interopRegistryService: InteropRegistryService,\n    connectionProvider: TransportConnectionProvider,\n    interopClient: InteropClient\n}\n\nexport interface StudioState {\n    connectionDetails: ConnectionDetails;\n    loading: boolean,\n    connectedApp: Application;\n    consumedMethod: ConsumedMethodState,\n    providedMethod: ProvidedMethodState,\n    appsFilter?: string,\n    serviceFilter?: string,\n    apps: Application[],\n    services: ServicesSnapshot\n}\n\nexport interface ConnectionDetails {\n    generalConfig: GeneralConnectionConfig;\n    webConfig?: WebConnectionConfig;\n    wsConfig?: WebSocketConnectionConfig;\n    connected: boolean;\n}\n\nexport interface GeneralConnectionConfig {\n    transportType: TransportType;\n    metadataUrl: string;\n}\n\nexport interface WebSocketConnectionConfig {\n    wsUrl: string\n}\n\nexport interface WebConnectionConfig {\n    proxyHostUrl: string,\n    // TODO deprecated, interop json + launcher should be used instead\n    appsMetadataUrl: string\n}\n\nexport interface ConsumedMethodState {\n    method: ConsumedMethod;\n    discoveredMethods: MethodDiscoveryResponse;\n}\n\nexport interface ProvidedMethodState {\n    method: ProvidedMethod;\n}\n\nexport interface PlexusConnectedActionParams {\n    apps: Application[],\n    interopRegistryService: InteropRegistryService,\n    connectionProvider: TransportConnectionProvider\n}\n\nexport interface AppConnectedActionParams {\n    interopClient: InteropClient,\n    application: Application\n}\n\nexport interface ConnectionSetupActionParams {\n    connectionDetails: ConnectionDetails,\n    silentOnFailure: boolean\n}\n\nexport interface Alert {\n    message: string,\n    type: AlertType\n};\n\nexport enum TransportType {\n    WEB_SAME_BROADCAST = 'web-same-broadcast',\n    WEB_CROSS = 'web-cross',\n    NATIVE_WS = 'native-ws'\n}\n\nexport const transportTypes: { key: TransportType, label: string }[] = [\n    { key: TransportType.NATIVE_WS, label: 'Web Socket Transport' },\n    { key: TransportType.WEB_CROSS, label: 'Cross Domain Web Transport' },\n    { key: TransportType.WEB_SAME_BROADCAST, label: 'Same Domain Web Transport' }\n];\n\nexport enum AlertType {\n    INFO, SUCCESS, USER_FAIL, ERROR\n}\n\n"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/ConnectionRequestParams.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UrlParamsProvider } from \"@plexus-interop/common\";\n\nexport class ConnectionRequestParams {\n\n    public getWsUrl(): string {\n        return UrlParamsProvider.getParam('wsUrl');\n    }\n\n    public getHostProxyUrl(): string {\n        return UrlParamsProvider.getParam('hostProxyUrl');\n    }\n\n    public getMetadataUrl(): string {\n        return UrlParamsProvider.getParam('metadataUrl');\n    }\n\n    public getAppsUrl(): string {\n        return UrlParamsProvider.getParam('appsUrl');\n    }\n\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/RootReducers.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StudioState } from './AppModel';\nimport {\n  ActionReducerMap,\n  createSelector,\n  createFeatureSelector,\n  ActionReducer,\n  MetaReducer,\n} from '@ngrx/store';\nimport { environment } from '../../../environments/environment';\n\nimport * as fromRouter from '@ngrx/router-store';\nimport * as fromPlexus from '../reducers/PlexusReducers';\nimport { LoggerFactory } from '@plexus-interop/common';\n\nexport interface State {\n  plexus: StudioState;\n}\n\nexport const reducers: ActionReducerMap<State> = {\n  plexus: fromPlexus.reducer\n};\n\nconst log = LoggerFactory.getLogger('StateLogger');\n\nexport function logger(reducer: ActionReducer<State>): ActionReducer<State> {\n  return function (state: State, action: any): State {\n    let result = reducer(state, action);\n    log.debug('Action:', action);\n    log.debug('State:', result);  \n    return result;\n  };\n}\n\nexport const metaReducers: MetaReducer<State>[] = [logger];\n"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/SubscriptionsRegistry.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Injectable } from '@angular/core';\nimport { Subscription } from 'rxjs/Subscription';\n\n@Injectable()\nexport class SubscriptionsRegistry {\n    private subscriptions: Subscription[] = [];\n\n    public add(...subscriptions: Subscription[]): void {\n        subscriptions.forEach(s => this.subscriptions.push(s));\n    }\n\n    public unsubscribeAll(): void {\n        this.subscriptions.forEach(s => s.unsubscribe());\n        this.subscriptions = [];\n    }\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/filters.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function containsFilter(value: string, filter?: string): boolean {\n    return !(filter && filter.trim().length > 0) || value.toLowerCase().indexOf(filter.toLowerCase()) != -1;\n}"
  },
  {
    "path": "web/packages/studio/src/app/services/ui/validators.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InteropClient } from '../core/InteropClient';\nimport { ConsumedMethod, ProvidedMethod } from '@plexus-interop/metadata';\nimport { DiscoveredMethod } from '@plexus-interop/client';\nimport { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function plexusMessageValidator(formFieldName: string, client: InteropClient, methodToInvoke: DiscoveredMethod | ConsumedMethod | ProvidedMethod): ValidatorFn {\n    return (control: AbstractControl): { [key: string]: any } => {\n        const value = control.value;\n        try {\n            client.validateRequest(methodToInvoke, value);\n            return null;\n        } catch (error) {\n            const errors = {};\n            errors[formFieldName] = `${error}`;\n            return errors;\n        }\n    };\n}"
  },
  {
    "path": "web/packages/studio/src/environments/environment.prod.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const environment = {\n  production: true\n};\n"
  },
  {
    "path": "web/packages/studio/src/environments/environment.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\nexport const environment = {\n  production: false\n};\n"
  },
  {
    "path": "web/packages/studio/src/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>Studio</title>\n\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"assets/plexus-logo-icon.png\">\n</head>\n\n<body>\n  <app-root class=\"flex-fill\"></app-root>\n</body>\n\n</html>\n"
  },
  {
    "path": "web/packages/studio/src/main.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n  enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n  .catch(err => console.log(err));\n"
  },
  {
    "path": "web/packages/studio/src/polyfills.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * This file includes polyfills needed by Angular and is loaded before the app.\n * You can add your own extra polyfills to this file.\n *\n * This file is divided into 2 sections:\n *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.\n *   2. Application imports. Files imported after ZoneJS that should be loaded before your main\n *      file.\n *\n * The current setup is for so-called 'evergreen' browsers; the last versions of browsers that\n * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),\n * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.\n *\n * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html\n */\n\n/***************************************************************************************************\n * BROWSER POLYFILLS\n */\n\n/** IE9, IE10 and IE11 requires all of the following polyfills. **/\nimport 'core-js/es6/symbol';\nimport 'core-js/es6/object';\nimport 'core-js/es6/function';\nimport 'core-js/es6/parse-int';\nimport 'core-js/es6/parse-float';\nimport 'core-js/es6/number';\nimport 'core-js/es6/math';\nimport 'core-js/es6/string';\nimport 'core-js/es6/date';\nimport 'core-js/es6/array';\nimport 'core-js/es6/regexp';\nimport 'core-js/es6/map';\nimport 'core-js/es6/weak-map';\nimport 'core-js/es6/set';\n\n\n/** IE10 and IE11 requires the following for NgClass support on SVG elements */\n// import 'classlist.js';  // Run `npm install --save classlist.js`.\n\n/** IE10 and IE11 requires the following for the Reflect API. */\nimport 'core-js/es6/reflect';\n\n\n/** Evergreen browsers require these. **/\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\nimport 'core-js/es7/reflect';\n\n\n/**\n * Required to support Web Animations `@angular/platform-browser/animations`.\n * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation\n **/\n// import 'web-animations-js';  // Run `npm install --save web-animations-js`.\n\n\n\n/***************************************************************************************************\n * Zone JS is required by default for Angular itself.\n */\nimport 'zone.js/dist/zone';  // Included with Angular CLI.\n\n\n\n/***************************************************************************************************\n * APPLICATION IMPORTS\n */\nimport 'arraybuffer-slice';"
  },
  {
    "path": "web/packages/studio/src/setup-jest.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport 'jest-preset-angular';"
  },
  {
    "path": "web/packages/studio/src/styles.css",
    "content": "\nhtml, body, .flex-fill {\n    display: flex;\n    flex: 1 1 100%;\n    height: 100%;\n    width: 100%;\n}\n\n.flex-flow-column {\n    flex-flow: column;\n}\n\na, button {\n    cursor: pointer;\n}"
  },
  {
    "path": "web/packages/studio/src/test.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// This file is required by karma.conf.js and loads recursively all the .spec and framework files\nimport 'zone.js/dist/long-stack-trace-zone';\nimport 'zone.js/dist/proxy.js';\nimport 'zone.js/dist/sync-test';\nimport 'zone.js/dist/jasmine-patch';\nimport 'zone.js/dist/async-test';\nimport 'zone.js/dist/fake-async-test';\nimport { getTestBed } from '@angular/core/testing';\nimport {\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\n\n// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.\ndeclare const __karma__: any;\ndeclare const require: any;\n\n// Prevent Karma from running prematurely.\n__karma__.loaded = function () { };\n\n// First, initialize the Angular testing environment.\ngetTestBed().initTestEnvironment(\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting()\n);\n// Then we find all the tests.\nconst context = require.context('./', true, /\\.spec\\.ts$/);\n// And load the modules.\ncontext.keys().map(context);\n// Finally, start Karma to run the tests.\n__karma__.start();\n"
  },
  {
    "path": "web/packages/studio/src/tsconfig.app.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../out-tsc/app\",\n    \"baseUrl\": \"./\"\n  },\n  \"exclude\": [\n    \"test.ts\",\n    \"**/*.spec.ts\"\n  ]\n}\n"
  },
  {
    "path": "web/packages/studio/src/tsconfig.spec.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../out-tsc/spec\",\n    \"baseUrl\": \"./\",\n    \"module\": \"commonjs\",\n    \"target\": \"es5\",\n    \"types\": [\n      \"jest\",\n      \"node\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/studio/src/typings.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* SystemJS module definition */\ndeclare var module: NodeModule;\ninterface NodeModule {\n  id: string;\n}\n"
  },
  {
    "path": "web/packages/studio/tsconfig.json",
    "content": "{\n  \"compileOnSave\": false,\n  \"compilerOptions\": {\n    \"outDir\": \"./dist/out-tsc\",\n    \"sourceMap\": true,\n    \"declaration\": false,\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"experimentalDecorators\": true,\n    \"target\": \"es5\",\n    \"types\": [\n      \"jest\"\n    ],\n    \"lib\": [\n      \"es2015\",\n      \"dom\"\n    ]\n  }\n}"
  },
  {
    "path": "web/packages/studio/tslint.json",
    "content": "{\n  \"rulesDirectory\": [\n    \"node_modules/codelyzer\"\n  ],\n  \"linterOptions\": {\n      \"exclude\": [\n          \"bin\",\n          \"*/**/gen/*\"\n      ]\n  },\n  \"rules\": {\n    \"arrow-return-shorthand\": true,\n    \"callable-types\": true,\n    \"class-name\": true,\n    \"comment-format\": [\n      true,\n      \"check-space\"\n    ],\n    \"curly\": true,\n    \"deprecation\": {\n      \"severity\": \"warn\"\n    },\n    \"eofline\": true,\n    \"forin\": true,\n    \"import-blacklist\": [\n      true,\n      \"rxjs\",\n      \"rxjs/Rx\"\n    ],\n    \"import-spacing\": true,\n    \"indent\": [\n      true,\n      \"spaces\"\n    ],\n    \"interface-over-type-literal\": true,\n    \"label-position\": true,\n    \"max-line-length\": [\n      true,\n      140\n    ],\n    \"member-access\": false,\n    \"member-ordering\": [\n      true,\n      {\n        \"order\": [\n          \"static-field\",\n          \"instance-field\",\n          \"static-method\",\n          \"instance-method\"\n        ]\n      }\n    ],\n    \"no-arg\": true,\n    \"no-bitwise\": true,\n    \"no-console\": [\n      true,\n      \"debug\",\n      \"info\",\n      \"time\",\n      \"timeEnd\",\n      \"trace\"\n    ],\n    \"no-construct\": true,\n    \"no-debugger\": true,\n    \"no-duplicate-super\": true,\n    \"no-empty\": false,\n    \"no-empty-interface\": true,\n    \"no-eval\": true,\n    \"no-inferrable-types\": [\n      true,\n      \"ignore-params\"\n    ],\n    \"no-misused-new\": true,\n    \"no-non-null-assertion\": true,\n    \"no-shadowed-variable\": true,\n    \"no-string-literal\": false,\n    \"no-string-throw\": true,\n    \"no-switch-case-fall-through\": true,\n    \"no-trailing-whitespace\": true,\n    \"no-unnecessary-initializer\": true,\n    \"no-unused-expression\": true,\n    \"no-use-before-declare\": true,\n    \"no-var-keyword\": true,\n    \"object-literal-sort-keys\": false,\n    \"one-line\": [\n      true,\n      \"check-open-brace\",\n      \"check-catch\",\n      \"check-else\",\n      \"check-whitespace\"\n    ],\n    \"prefer-const\": true,\n    \"quotemark\": [\n      true,\n      \"single\"\n    ],\n    \"radix\": true,\n    \"semicolon\": [\n      true,\n      \"always\"\n    ],\n    \"triple-equals\": [\n      true,\n      \"allow-null-check\"\n    ],\n    \"typedef-whitespace\": [\n      true,\n      {\n        \"call-signature\": \"nospace\",\n        \"index-signature\": \"nospace\",\n        \"parameter\": \"nospace\",\n        \"property-declaration\": \"nospace\",\n        \"variable-declaration\": \"nospace\"\n      }\n    ],\n    \"typeof-compare\": true,\n    \"unified-signatures\": true,\n    \"variable-name\": false,\n    \"whitespace\": [\n      true,\n      \"check-branch\",\n      \"check-decl\",\n      \"check-operator\",\n      \"check-separator\",\n      \"check-type\"\n    ],\n    \"directive-selector\": [\n      true,\n      \"attribute\",\n      \"app\",\n      \"camelCase\"\n    ],\n    \"component-selector\": [\n      true,\n      \"element\",\n      \"app\",\n      \"kebab-case\"\n    ],\n    \"no-output-on-prefix\": true,\n    \"use-input-property-decorator\": true,\n    \"use-output-property-decorator\": true,\n    \"use-host-property-decorator\": true,\n    \"no-input-rename\": true,\n    \"no-output-rename\": true,\n    \"use-life-cycle-interface\": true,\n    \"use-pipe-transform-interface\": true,\n    \"component-class-suffix\": true,\n    \"directive-class-suffix\": true\n  }\n}\n"
  },
  {
    "path": "web/packages/transport-common/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/transport-common/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/transport-common\",\n  \"version\": \"0.1.0\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"main\": \"dist/main/src/index.js\",\n  \"description\": \"General Transport for Plexus Web Interop\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:watch\": \"tsc -w\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"test\": \"jest --coverage --runInBand\"\n  },\n  \"dependencies\": {\n    \"rxjs\": \"^5.5.2\",\n    \"protobufjs\": \"6.11.3\",\n    \"@types/loglevel\": \"^1.4.29\",\n    \"@types/long\": \"^4.0.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"loglevel\": \"^1.4.1\",\n    \"long\": \"^4.0.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\",\n    \"typescript-collections\": \"1.2.3\"\n  },\n  \"peerDependencies\": {\n    \"protobufjs\": \"6.11.3\",\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"@types/chai\": \"^4.0.2\",\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/mocha\": \"^2.2.43\",\n    \"@types/node\": \"^7.0.5\",\n    \"babel-register\": \"^6.23.0\",\n    \"browserify\": \"^14.5.0\",\n    \"chai\": \"^4.1.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"glob\": \"^7.1.2\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"jest-cli\": \"^23.0.0\",\n    \"minimist\": \"^1.2.0\",\n    \"mocha\": \"^3.5.0\",\n    \"path\": \"^0.12.7\",\n    \"sinon\": \"^2.4.1\",\n    \"trash\": \"^4.1.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"ts-mockito\": \"2.0.2\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"watchify\": \"^3.9.0\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!dist/main/src/gen/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/transport-common/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    // Jest runs many instances of Jasmine in parallel. Force distinct file output\n    // per test to avoid collisions.\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/transport-common/src/common/BaseChannel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface BaseChannel<ObserverType> {\n\n    uuid(): UniqueId;\n\n    sendMessage(data: ArrayBuffer): Promise<void>;\n\n    open(observer: ObserverType): void;\n\n    close(completion?: plexus.ICompletion): Promise<plexus.ICompletion>;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/BufferedObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { Logger, LoggerFactory } from '@plexus-interop/common';\nimport { LimitedBufferQueue } from '@plexus-interop/common';\nimport { PlexusObserver } from './PlexusObserver';\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\n/**\n * Saves interraction with Observer, until real Observer arrives\n */\nexport class BufferedObserver<T> implements PlexusObserver<T> {\n\n    private baseObserver: PlexusObserver<T> | undefined;\n\n    private buffer: Queue<T>;\n    private receivedError: any;\n    private completed: boolean = false;\n\n    constructor(readonly limit: number = 1024 * 10, private readonly log: Logger = LoggerFactory.getLogger('BufferedObserver')) {\n        this.buffer = new LimitedBufferQueue<T>(limit);\n    }\n\n    public setObserver(observer: PlexusObserver<T>): void {\n        if (this.baseObserver) {\n            throw new Error('Base observer already defined');\n        }\n        this.baseObserver = observer;\n        while (!this.buffer.isEmpty()) {\n            observer.next(this.buffer.dequeue());\n        }\n        if (this.receivedError) {\n            observer.error(this.receivedError);\n        } else if (this.completed) {\n            observer.complete();\n        }\n    }\n\n    public next(value: T): void {\n        if (this.baseObserver) {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Passing frame to observer`);\n            }\n            this.baseObserver.next(value);\n        } else {\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`No observer, adding to buffer, buffer size ${this.buffer.size()}`);\n            }\n            this.buffer.enqueue(value);\n        }\n    }\n\n    public error(err: any): void {\n        if (this.baseObserver) {\n            this.baseObserver.error(err);\n        } else {\n            this.receivedError = err;\n        }\n    }\n\n    public complete(completion?: plexus.ICompletion): void {\n        if (this.baseObserver) {\n            this.baseObserver.complete(completion);\n        } else {\n            this.completed = true;\n        }\n    }\n\n    public clear(): void {\n        this.buffer.clear();\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/Channel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AnonymousSubscription } from 'rxjs/Subscription';\nimport { ChannelObserver } from './ChannelObserver';\nimport { BaseChannel } from './BaseChannel';\n\nexport interface Channel extends BaseChannel<ChannelObserver<AnonymousSubscription, ArrayBuffer>> {\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/ChannelObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PlexusObserver } from './PlexusObserver';\n\nexport interface ChannelObserver<S, D> extends PlexusObserver<D> {\n\n    started(subscription: S): void;\n\n    startFailed(error: any): void;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/Defaults.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport abstract class Defaults {\n    public static readonly OPERATION_TIMEOUT: number = 60000;\n    public static readonly STATUS_CHECK_INTERVAL: number = 0;\n    public static readonly DEFAULT_BUFFER_SIZE: number = 10240;\n    public static readonly DEFAULT_FRAME_SIZE: number = 60000;\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/DelegateChannelObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChannelObserver } from './ChannelObserver';\nimport { AnonymousSubscription } from 'rxjs/Subscription';\nimport { Observer } from '@plexus-interop/common';\n\nexport class DelegateChannelObserver<T> implements ChannelObserver<AnonymousSubscription, T> {\n\n    constructor(private baseObserver: Observer<T>,\n                private subscriptionHandler: (subscription: AnonymousSubscription) => void,\n                private startFailedHandler: (error: any) => void = () => {}) {}\n\n    public started(subscription: AnonymousSubscription): void {\n        this.subscriptionHandler(subscription);\n    }\n\n    public next(value: T): void {\n        this.baseObserver.next(value);\n    }\n\n    public error(err: any): void {\n        this.baseObserver.error(err);\n    }\n\n    public complete(): void {\n        this.baseObserver.complete();\n    }\n\n    public startFailed(error: any): void {\n        this.startFailedHandler(error);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/common/PlexusObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\n/**\n * Same as RxJS Observer, with optional Plexus completion \n */\nexport interface PlexusObserver<T> {\n    next: (value: T) => void;\n    error: (err: any) => void;\n    complete: (completion?: plexus.ICompletion) => void;\n}\n\nexport interface PlexusNextObserver<T> {\n    closed?: boolean;\n    next: (value: T) => void;\n    error?: (err: any) => void;\n    complete: (completion?: plexus.ICompletion) => void;\n}\n\nexport interface PlexusErrorObserver<T> {\n    closed?: boolean;\n    next?: (value: T) => void;\n    error: (err: any) => void;\n    complete: (completion?: plexus.ICompletion) => void;\n}\n\nexport interface CompletionObserver<T> {\n    closed?: boolean;\n    next?: (value: T) => void;\n    error?: (err: any) => void;\n    complete: (completion?: plexus.ICompletion) => void;\n}\n\nexport declare type PlexusPartialObserver<T> = PlexusNextObserver<T> | PlexusErrorObserver<T> | CompletionObserver<T>;"
  },
  {
    "path": "web/packages/transport-common/src/common/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './Channel';\nexport * from './BaseChannel';\nexport * from './Defaults';\nexport * from './ChannelObserver';\nexport * from './DelegateChannelObserver';\nexport * from './Defaults';\nexport * from './BufferedObserver';\nexport * from './PlexusObserver';"
  },
  {
    "path": "web/packages/transport-common/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './transport';\nexport * from './common';"
  },
  {
    "path": "web/packages/transport-common/src/transport/ClientConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from './TransportConnection';\nimport { ConnectionDetails } from './ConnectionDetails';\n\nexport interface ClientConnectionFactory {\n\n    connect(connectionDetails: ConnectionDetails): Promise<TransportConnection>;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/ConnectionDetails.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from '@plexus-interop/common';\nimport { TransportChannel } from './TransportChannel';\n\nexport interface ConnectionDetails {\n\n    incomingChannelsObserver: Observer<TransportChannel>;\n    \n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/DuplexConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ServerConnectionFactory, ClientConnectionFactory } from '.'; \n\nexport interface DuplexConnectionFactory extends ServerConnectionFactory, ClientConnectionFactory {}"
  },
  {
    "path": "web/packages/transport-common/src/transport/InMemoryConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DuplexConnectionFactory } from './DuplexConnectionFactory';\nimport { Observer, Subscription, Logger, LoggerFactory, AnonymousSubscription } from '@plexus-interop/common';\nimport { TransportConnection, Defaults, Frame, FramedTransportConnection } from '../.';\nimport { InMemoryFramedTransport } from './InMemoryFramedTransport';\nimport { BufferedObserver } from '../common';\n\n/**\n * Creates pair of coupled in memory connections for each Client's connect request\n */\nexport class InMemoryConnectionFactory implements DuplexConnectionFactory {\n\n    private readonly log: Logger = LoggerFactory.getLogger('InMemoryConnectionFactory');\n\n    private serverConnectionsObserver: BufferedObserver<TransportConnection> =\n        new BufferedObserver<TransportConnection>(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n\n    public async connect(): Promise<TransportConnection> {\n        const [client] = await this.connectBoth();\n        return client;\n    }\n\n    public async connectBoth(): Promise<[TransportConnection, TransportConnection]> {\n        const clientInObserver: BufferedObserver<Frame> = new BufferedObserver(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n        const serverInObserver: BufferedObserver<Frame> = new BufferedObserver(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n\n        const serverTransportConnection =\n            new FramedTransportConnection(new InMemoryFramedTransport(serverInObserver, clientInObserver));\n\n        const clientTransportConnection =\n            new FramedTransportConnection(new InMemoryFramedTransport(clientInObserver, serverInObserver));\n\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Created pair of connections: \n                Client [${clientTransportConnection.uuid().toString()}] \n                Server [${serverTransportConnection.uuid().toString()}]`);\n        }\n\n        await clientTransportConnection.connect();\n        await serverTransportConnection.acceptingConnection();\n\n        this.serverConnectionsObserver.next(serverTransportConnection);\n\n        return [clientTransportConnection, serverTransportConnection];\n    }\n\n    public acceptConnections(connectionsObserver: Observer<TransportConnection>): Subscription {\n        this.log.debug('Received accept connections request');\n        this.serverConnectionsObserver.setObserver(connectionsObserver);\n        return new AnonymousSubscription();\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/InMemoryFramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectableFramedTransport, Defaults, UniqueId, Frame } from '../.';\nimport { ReadWriteCancellationToken, Observer, Logger, LoggerFactory } from '@plexus-interop/common';\nimport { BufferedObserver } from '../common';\n\nexport class InMemoryFramedTransport implements ConnectableFramedTransport {\n\n    private id: UniqueId = UniqueId.generateNew();\n\n    private cancellationToken: ReadWriteCancellationToken = new ReadWriteCancellationToken();\n\n    private readonly log: Logger;\n\n    constructor(\n        private inObserver: BufferedObserver<Frame>,\n        private outObserver: Observer<Frame>\n    ) {\n        this.log = LoggerFactory.getLogger(`InMemoryFramedTransport [${this.id.toString()}]`);\n        this.log.trace('Created');\n    }\n\n    public connected(): boolean {\n        return !this.cancellationToken.isCancelled();\n    }\n\n    public async disconnect(): Promise<void> {\n        this.log.trace('Received disconnect');\n        this.cancellationToken.cancel();\n        this.inObserver.complete();\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n    public getMaxFrameSize(): number {\n        return Defaults.DEFAULT_FRAME_SIZE;\n    }\n\n    public async writeFrame(frame: Frame): Promise<void> {\n        this.cancellationToken.throwIfCanceled();\n        if (this.log.isTraceEnabled()) {\n            if (frame.isDataFrame()) {\n                this.log.trace(`Received data frame`);\n            } else {\n                this.log.trace(`Received header frame`);\n            }\n        }\n        this.outObserver.next(frame);\n    }\n\n    public async open(observer: Observer<Frame>): Promise<void> {\n        this.log.trace('Transport opened');\n        this.inObserver.setObserver(observer);\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/ServerConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer, Subscription } from '@plexus-interop/common';\nimport { TransportConnection } from  './TransportConnection';\n\nexport interface ServerConnectionFactory {\n\n    acceptConnections(connectionsObserver: Observer<TransportConnection>): Subscription;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/TransportChannel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Channel } from '../common/Channel';\nimport { clientProtocol as plexus } from '@plexus-interop/protocol';\n\nexport interface TransportChannel extends Channel {\n\n    sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion>;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/TransportConnection.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportChannel } from './TransportChannel';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Observer, Subscription } from '@plexus-interop/common';\nimport { clientProtocol } from '@plexus-interop/protocol'; \n\nexport interface TransportConnection {\n\n    /**\n     * Creates new logical Transport Channel\n     */\n    createChannel(): Promise<TransportChannel>;\n\n    /**\n     * Closes connection, no more communication available through this connection\n     */\n    disconnect(completion?: clientProtocol.ICompletion): Promise<void>;\n\n    /**\n     * Gets list of Channels managed by this Connection\n     */\n    getManagedChannels(): TransportChannel[];\n\n    /**\n     * Gets Channel by or id, returns undefined if not found\n     */\n    getManagedChannel(id: string): TransportChannel | undefined;\n\n    /**\n     * Unique connection identifier\n     */\n    uuid(): UniqueId;\n\n    /**\n     * Checks whether connection is active\n     */\n    isConnected(): boolean;\n\n    /**\n     * Subscribe for incoming channels\n     */\n    subscribeToChannels(channelObserver: Observer<TransportChannel>): Subscription;\n\n    /**\n     * Opens current connection, starting to receive incoming channels\n     */\n    connect(channelObserver?: Observer<TransportChannel>): Promise<void>;\n\n}\n\n"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/BufferedReadFramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Frame } from './model';\nimport { FramedTransport } from './FramedTransport';\nimport { Observer, Logger, LimitedBufferQueue } from '@plexus-interop/common';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { Defaults } from '../../common/Defaults';\n\n/**\n * Collects all read events until client opened connection\n */\nexport abstract class BufferedReadFramedTransport implements FramedTransport, Observer<Frame> {\n\n    protected framesObserver: Observer<Frame> | null = null;\n    protected completed: boolean = false;\n    protected receivedError: any;\n    protected inBuffer: Queue<Frame> = new LimitedBufferQueue<Frame>(Defaults.DEFAULT_BUFFER_SIZE);\n\n    constructor(\n        protected readonly log: Logger) { }\n\n    public abstract uuid(): UniqueId;\n\n    public abstract getMaxFrameSize(): number;\n\n    public abstract writeFrame(frame: Frame): Promise<void>;\n\n    public async open(framesObserver: Observer<Frame>): Promise<void> {\n        this.log.trace('Opening transport');\n        if (this.framesObserver) {\n            throw new Error('Already opened');\n        }\n        this.framesObserver = framesObserver;\n        while (!this.inBuffer.isEmpty()) {\n            this.framesObserver.next(this.inBuffer.dequeue());\n        }\n        if (this.receivedError) {\n            this.framesObserver.error(this.receivedError);\n        } else if (this.completed) {\n            this.framesObserver.complete();\n        }\n    }\n\n    public clear(): void {\n        this.inBuffer.clear();\n    }\n\n    public next(frame: Frame): void {\n        /* istanbul ignore if */\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Received frame`);\n        }\n        if (this.framesObserver) {\n            this.framesObserver.next(frame);\n        } else {\n            this.inBuffer.enqueue(frame);\n        }\n    }\n\n    public error(transportError: any): void {\n        this.log.debug('Received error', transportError);\n        if (this.framesObserver) {\n            this.framesObserver.error(transportError);\n        } else {\n            this.receivedError = transportError;\n        }\n    }\n\n    public complete(): void {\n        this.log.debug('Receive complete message');\n        if (this.framesObserver) {\n            this.framesObserver.complete();\n        } else {\n            this.completed = true;\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/BufferedTransportProxy.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Frame } from './model';\nimport { FramedTransport } from './FramedTransport';\nimport { Logger, CancellationToken } from '@plexus-interop/common';\nimport { BufferedReadFramedTransport } from './BufferedReadFramedTransport';\n\n/**\n * Collects all read events until client opened connection, delegates all write events to source\n */\nexport class BufferedTransportProxy extends BufferedReadFramedTransport {\n\n    constructor(\n        private readonly innerTransport: FramedTransport,\n        private readonly writeCancellationToken: CancellationToken,\n        log: Logger) {\n        super(log);\n    }\n\n    public uuid(): UniqueId {\n        return this.innerTransport.uuid();\n    }\n\n    public clear(): void {\n        this.inBuffer.clear();\n    }\n\n    public getMaxFrameSize(): number {\n        return this.innerTransport.getMaxFrameSize();\n    }\n\n    public async writeFrame(frame: Frame): Promise<void> {\n        this.writeCancellationToken.throwIfCanceled();\n        return this.innerTransport.writeFrame(frame);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/ConnectableFramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { FramedTransport } from './FramedTransport';\n\nexport interface ConnectableFramedTransport extends FramedTransport {\n\n    disconnect(): Promise<void>;\n\n    connected(): boolean;\n\n}\n\n"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/FrameHeader.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\nexport type FrameHeader = plexus.interop.transport.protocol.IMessageFrameHeader;"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/FramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Frame } from './model/Frame';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Observer } from '@plexus-interop/common';\n\nexport interface FramedTransport {\n\n    open(observer: Observer<Frame>): Promise<void>;\n\n    writeFrame(frame: Frame): Promise<void>;\n\n    getMaxFrameSize(): number;\n\n    uuid(): UniqueId;\n\n}\n\n"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/FramedTransportChannel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MessageFrame, ChannelCloseFrame } from './model';\nimport { FrameHeader } from './FrameHeader';\nimport { TransportChannel } from '../TransportChannel';\nimport { FramedTransport } from './FramedTransport';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Observer, ReadWriteCancellationToken, AsyncHelper } from '@plexus-interop/common';\nimport { AnonymousSubscription, Subscription } from 'rxjs/Subscription';\nimport { StateMaschineBase, CancellationToken, LoggerFactory, Logger, StateMaschine, SequencedExecutor } from '@plexus-interop/common';\nimport { clientProtocol as plexus, SuccessCompletion, ClientProtocolUtils, ClientError, ErrorCompletion } from '@plexus-interop/protocol';\nimport { Frame } from './model/Frame';\nimport { ChannelObserver } from '../../common/ChannelObserver';\nimport { SafeMessageBuffer } from './SafeMessageBuffer';\nimport { Defaults } from '../../common/Defaults';\n\nexport enum ChannelState {\n    CREATED = 'CREATED',\n    OPEN = 'OPEN',\n    CLOSED = 'CLOSED',\n    CLOSE_RECEIVED = 'CLOSE_RECEIVED',\n    CLOSE_REQUESTED = 'CLOSE_REQUESTED'\n}\n\nexport class FramedTransportChannel implements TransportChannel {\n\n    private log: Logger;\n    private messageId: number = 0;\n\n    private readonly stateMachine: StateMaschine<ChannelState>;\n\n    private channelCancellationToken: ReadWriteCancellationToken;\n\n    private clientCompletion: plexus.ICompletion;\n    private remoteCompletion: plexus.ICompletion;\n    private channelObserver: ChannelObserver<AnonymousSubscription, ArrayBuffer>;\n\n    private writeExecutor: SequencedExecutor;\n    private safeMessagesBuffer: SafeMessageBuffer;\n\n    private onCloseHandler: ((completion?: plexus.ICompletion) => void) | null;\n\n    constructor(\n        private id: UniqueId,\n        private framedTransport: FramedTransport,\n        private dispose: () => Promise<void>,\n        baseReadToken: CancellationToken) {\n        this.log = LoggerFactory.getLogger(`FramedTransportChannel [${id.toString()}]`);\n        this.writeExecutor = new SequencedExecutor(this.log);\n        this.channelCancellationToken = new ReadWriteCancellationToken(new CancellationToken(baseReadToken));\n        this.log.debug('Created');\n        this.stateMachine = new StateMaschineBase<ChannelState>(ChannelState.CREATED, [\n            {\n                from: ChannelState.CREATED, to: ChannelState.OPEN\n            },\n            // client requested to complete channel, waiting for response\n            {\n                from: ChannelState.OPEN, to: ChannelState.CLOSE_REQUESTED\n            },\n            // remote side requested to complete channel\n            {\n                from: ChannelState.OPEN, to: ChannelState.CLOSE_RECEIVED\n            },\n            // client confirmed channel closure\n            {\n                from: ChannelState.CLOSE_RECEIVED, to: ChannelState.CLOSED\n            },\n            // remote confirmed channel closure\n            {\n                from: ChannelState.CLOSE_REQUESTED, to: ChannelState.CLOSED\n            },\n            // forced channel closure\n            {\n                from: ChannelState.OPEN, to: ChannelState.CLOSED, preHandler: async () => {\n                    this.log.warn('Channel forced OPEN -> CLOSED');\n                }\n            },\n            {\n                from: ChannelState.CREATED, to: ChannelState.CLOSED, preHandler: async () => {\n                    this.log.warn('Channel forced CREATED -> CLOSED');\n                }\n            }\n        ], this.log);\n    }\n\n    public open(channelObserver: ChannelObserver<AnonymousSubscription, ArrayBuffer>): void {\n        this.log.debug('Opening channel');\n        this.stateMachine.throwIfNot(ChannelState.CREATED);\n        this.channelObserver = channelObserver;\n        const subscription = new Subscription(() => {\n            this.log.debug('Closing on unsubscribe');\n            this.close();\n        });\n        this.stateMachine.goAsync(ChannelState.OPEN)\n            .then(() => {\n                this.subscribeToMessages(channelObserver);\n                channelObserver.started(subscription);\n            });\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n    public async close(completion: plexus.ICompletion = new SuccessCompletion()): Promise<plexus.ICompletion> {\n        this.stateMachine.throwIfNot(ChannelState.OPEN, ChannelState.CLOSE_RECEIVED);\n        // wait for remote side if required and report result\n        return new Promise<plexus.ICompletion>((resolve, reject) => {\n            try {\n                // handler called when remote side also sent its completion\n                this.onCloseHandler = (summarizedCompletion?: plexus.ICompletion) => {\n                    resolve(summarizedCompletion);\n                };\n                if (this.stateMachine.is(ChannelState.OPEN)) {\n                    // wait for remote side response\n                    this.sendChannelClosedRequest(completion);\n                    this.stateMachine.go(ChannelState.CLOSE_REQUESTED);\n                } else {\n                    // remote is completed already, send message and clean up\n                    this.sendChannelClosedRequest(completion);\n                    this.closeInternal('Remote completed, confirmation sent');\n                }\n            } catch (error) {\n                this.log.error('Error during sending close channel request', error);\n                reject(error);\n            }\n        });\n    }\n\n    public async onChannelClose(channelCloseFrame: ChannelCloseFrame): Promise<void> {\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Channel close received, current state is ${this.stateMachine.getCurrent()}`);\n        }\n        this.stateMachine.throwIfNot(ChannelState.CLOSE_REQUESTED, ChannelState.OPEN);\n        this.remoteCompletion = channelCloseFrame.getHeaderData().completion || new SuccessCompletion();\n        /* istanbul ignore if */\n        if (this.remoteCompletion && this.log.isDebugEnabled()) {\n            this.log.debug(`Remote completed with ${JSON.stringify(this.remoteCompletion)}`);\n        }\n        if (this.safeMessagesBuffer && this.safeMessagesBuffer.hasPendingChunks()) {\n            await AsyncHelper.waitFor(() => !this.safeMessagesBuffer.hasPendingChunks(),\n                new CancellationToken(),\n                Defaults.STATUS_CHECK_INTERVAL,\n                Defaults.OPERATION_TIMEOUT);\n        }\n        if (ClientProtocolUtils.isCancelCompletion(this.remoteCompletion)) {\n            this.handleNonErrorCompletion('Channel Cancel received', this.remoteCompletion);\n        } else if (ClientProtocolUtils.isErrorCompletion(this.remoteCompletion)) {\n            // channel closed with error, report error and close\n            const error = this.remoteCompletionToError(this.remoteCompletion);\n            this.closeInternal('Channel Close with Error received', error);\n        } else {\n            // success\n            this.handleNonErrorCompletion('Channel Close received');\n        }\n    }\n\n    public async closeInternal(reason: string = 'Channel closed', error?: any): Promise<void> {\n        if (this.stateMachine.is(ChannelState.CLOSED)) {\n            this.log.error('Channel already closed');\n            return Promise.reject('Channel already closed');\n        }\n        this.log.debug(`Closing channel resources, reason - ${reason}`);\n        this.channelCancellationToken.cancel(reason);\n        this.stateMachine.go(ChannelState.CLOSED);\n        this.dispose();\n        if (this.onCloseHandler) {\n            this.log.debug('Reporting summarized completion');\n            const completion = ClientProtocolUtils.createSummarizedCompletion(\n                this.clientCompletion,\n                this.remoteCompletion || new ErrorCompletion(new ClientError('Remote side not completed')));\n            if (ClientProtocolUtils.isErrorCompletion(completion)) {\n                this.channelObserver.error(error || completion.error);\n            }\n            this.onCloseHandler(completion);\n            this.onCloseHandler = null;\n        } else if (this.channelObserver) {\n            this.log.debug('Close not requested, reporting forced close');\n            this.channelObserver.error(error || new ClientError(reason));\n        }\n    }\n\n    public sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion> {\n        this.stateMachine.throwIfNot(ChannelState.OPEN, ChannelState.CLOSE_RECEIVED);\n        return this.sendMessage(data).then(() => {\n            return this.close();\n        });\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.stateMachine.throwIfNot(ChannelState.OPEN, ChannelState.CLOSE_RECEIVED, ChannelState.CLOSE_REQUESTED);\n        let currentMessageIndex = ++this.messageId;\n        /* istanbul ignore if */\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Scheduling sending [${currentMessageIndex}] message of ${data.byteLength} bytes`);\n        }\n        return this.writeExecutor.submit(() => this.sendMessageInternal(data, currentMessageIndex));\n    }\n\n    private handleNonErrorCompletion(message: string, completion?: plexus.ICompletion): void {\n        this.channelObserver.complete(completion);\n        switch (this.stateMachine.getCurrent()) {\n            case ChannelState.OPEN:\n                this.channelCancellationToken.cancelRead(message);\n                this.stateMachine.go(ChannelState.CLOSE_RECEIVED);\n                if (completion) {\n                    this.close(completion);\n                }\n                break;\n            case ChannelState.CLOSE_REQUESTED:\n                this.closeInternal(message);\n                break;\n            default:\n                throw new Error(`Can't handle close, invalid state ${this.stateMachine.getCurrent()}`);\n        }\n    }\n\n    private async subscribeToMessages(channelObserver: Observer<ArrayBuffer>): Promise<void> {\n        const messageHandler = (m: ArrayBuffer) => {\n            this.log.trace(`Received message of ${m.byteLength} bytes`);\n            channelObserver.next(m);\n        };\n        const errorHandler = (e: any) => channelObserver.error(e);\n        this.safeMessagesBuffer = new SafeMessageBuffer(messageHandler, errorHandler);\n        this.framedTransport.open({\n            next: (frame: Frame) => this.handleIncomingFrame(channelObserver, frame, this.safeMessagesBuffer as SafeMessageBuffer),\n            complete: () => this.log.debug('Received complete from transport'),\n            error: (e: any) => this.handleConnectionError(channelObserver, e)\n        })\n            .catch(connectionError => channelObserver.error(connectionError));\n    }\n\n    private async sendChannelClosedRequest(completion: plexus.ICompletion = new SuccessCompletion()): Promise<void> {\n        this.clientCompletion = completion;\n        this.channelCancellationToken.cancelWrite('Close requested');\n        this.log.debug('Sending channel close frame');\n        this.writeExecutor.submit(async () => {\n            this.framedTransport.writeFrame(ChannelCloseFrame.fromHeaderData({\n                channelId: this.id,\n                completion\n            }));\n        });\n    }\n\n    private handleIncomingFrame(channelObserver: Observer<ArrayBuffer>, frame: Frame, safeBuffer: SafeMessageBuffer): void {\n        if (this.channelCancellationToken.isReadCancelled()) {\n            this.log.warn('Read cancelled, dropping frame');\n            return;\n        }\n        if (!frame) {\n            this.log.warn('Empty frame, dropping it');\n        } else if (frame.internalHeaderProperties.messageFrame) {\n            const messageFrame = frame as MessageFrame;\n            const isLast = !messageFrame.getHeaderData().hasMore;\n            /* istanbul ignore if */\n            if (this.log.isTraceEnabled()) {\n                this.log.trace(`Received ${isLast ? 'last' : ''} message frame, ${messageFrame.body.byteLength} bytes`);\n            }\n            safeBuffer.addChunk(messageFrame.body, isLast);\n        } else if (frame.internalHeaderProperties.channelClose) {\n            this.onChannelClose(frame as ChannelCloseFrame);\n        } else {\n            this.log.warn('Unknown frame received', frame);\n        }\n    }\n\n    private remoteCompletionToError(completion: plexus.ICompletion): plexus.IError {\n        if (completion) {\n            return completion.error || new ClientError(`Remote completed with status ${this.remoteCompletion.status}`);\n        } else {\n            return new ClientError('Channel closed unexpectedly');\n        }\n    }\n\n    private async handleConnectionError(channelObserver: Observer<ArrayBuffer>, error: any): Promise<void> {\n        if (!this.channelCancellationToken.isReadCancelled()) {\n            this.log.error('Transport connection error received', error);\n            this.closeInternal('Transport connection error', error);\n        }\n    }\n\n    private async sendMessageInternal(data: ArrayBuffer, messageIndex: number): Promise<void> {\n        this.log.debug(`Sending message [${messageIndex}] of ${data.byteLength} bytes`);\n        let sentBytesCount = 0;\n        const totalBytesCount = data.byteLength;\n        let hasMoreFrames = false;\n        let framesCounter = 0;\n        do {\n            let frameLength = totalBytesCount - sentBytesCount;\n            if (frameLength > this.framedTransport.getMaxFrameSize()) {\n                frameLength = this.framedTransport.getMaxFrameSize();\n            }\n            const frameBody = data.slice(sentBytesCount, sentBytesCount + frameLength);\n            sentBytesCount += frameLength;\n            hasMoreFrames = sentBytesCount < totalBytesCount;\n            const frameHeader: FrameHeader = {\n                channelId: this.id,\n                length: frameLength,\n                hasMore: hasMoreFrames\n            };\n            await this.framedTransport.writeFrame(MessageFrame.fromHeaderData(frameHeader, frameBody));\n            framesCounter++;\n        } while (hasMoreFrames && !this.channelCancellationToken.isWriteCancelled());\n        this.log.trace(`Sent message [${messageIndex}], consist of ${framesCounter} frames, ${data.byteLength} bytes`);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/FramedTransportConnection.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MessageFrame, ConnectionOpenFrame, ConnectionCloseFrame } from './model';\nimport { ChannelOpenFrame, ChannelCloseFrame } from './model';\nimport { ConnectableFramedTransport } from './ConnectableFramedTransport';\nimport { TransportConnection } from '../TransportConnection';\nimport { FramedTransportChannel } from './FramedTransportChannel';\nimport { BufferedTransportProxy } from './BufferedTransportProxy';\nimport { TransportChannel } from '../TransportChannel';\nimport { UniqueId, ClientProtocolUtils, ClientError, SuccessCompletion } from '@plexus-interop/protocol';\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { TransportFrameHandler } from './TransportFrameHandler';\nimport { StateMaschineBase, StateMaschine, LoggerFactory, Logger, ReadWriteCancellationToken, Observer, Subscription, AnonymousSubscription } from '@plexus-interop/common';\nimport { TransportFrameListener } from './TransportFrameListener';\nimport { BufferedObserver } from '../../common';\n\nexport enum ConnectionState {\n    CREATED = 'CREATED',\n    ACCEPT = 'ACCEPT',\n    OPEN = 'OPEN',\n    CLOSE_RECEIVED = 'CLOSE_RECEIVED',\n    CLOSE_REQUESTED = 'CLOSE_REQUESTED',\n    CLOSED = 'CLOSED'\n}\n\ntype ChannelDescriptor = {\n    channel: FramedTransportChannel,\n    channelTransportProxy: BufferedTransportProxy\n};\n\nexport class FramedTransportConnection implements TransportConnection, TransportFrameListener {\n\n    private log: Logger;\n\n    private connectionCancellationToken: ReadWriteCancellationToken = new ReadWriteCancellationToken();\n\n    private channelObserver: BufferedObserver<TransportChannel>;\n\n    private channelsHolder: Map<string, ChannelDescriptor> = new Map();\n\n    private framesHandler: TransportFrameHandler = new TransportFrameHandler();\n\n    private readonly stateMachine: StateMaschine<ConnectionState>;\n\n    constructor(private framedTransport: ConnectableFramedTransport) {\n        this.log = LoggerFactory.getLogger(`FramedTransportConnection [${this.uuid().toString()}]`);\n        this.channelObserver = new BufferedObserver(1024, this.log);\n        this.stateMachine = this.createStateMaschine();\n        this.log.debug('Created');\n    }\n\n    public async disconnect(completion?: plexus.ICompletion): Promise<void> {\n        switch (this.stateMachine.getCurrent()) {\n            case ConnectionState.OPEN:\n                this.log.debug('Current state is OPEN, requesting connection close');\n                await this.stateMachine.goAsync(ConnectionState.CLOSE_REQUESTED, {\n                    preHandler: async () => {\n                        await this.sendConnectionCloseMessage(completion);\n                    }\n                });\n                break;\n            case ConnectionState.CLOSE_RECEIVED:\n                this.log.debug('Current state is CLOSE_RECEIVED, closing all');\n                await this.sendConnectionCloseMessage(completion);\n                this.closeAndCleanUp();\n                break;\n            default:\n                throw new Error(`Can't close, invalid state ${this.stateMachine.getCurrent()}`);\n        }\n    }\n\n    public getManagedChannels(): TransportChannel[] {\n        const result: TransportChannel[] = [];\n        this.channelsHolder.forEach(value => {\n            result.push(value.channel);\n        });\n        return result;\n    }\n\n    public getManagedChannel(id: string): TransportChannel | undefined {\n        const descriptor = this.channelsHolder.get(id);\n        return descriptor ? descriptor.channel : undefined;\n    }\n\n    public async createChannel(): Promise<TransportChannel> {\n        this.stateMachine.throwIfNot(ConnectionState.OPEN);\n        const uuid = UniqueId.generateNew();\n        const { channel } = this.createOutChannel(uuid);\n        this.framedTransport.writeFrame(ChannelOpenFrame.fromHeaderData({\n            channelId: uuid\n        }));\n        return channel;\n    }\n\n    public uuid(): UniqueId {\n        return this.framedTransport.uuid();\n    }\n\n    public isConnected(): boolean {\n        return !this.stateMachine.isOneOf(ConnectionState.CREATED, ConnectionState.CLOSED);\n    }\n\n    public subscribeToChannels(channelObserver: Observer<TransportChannel>): Subscription {\n        this.log.debug('Received channels observer');\n        this.channelObserver.setObserver(channelObserver);\n        return new AnonymousSubscription();\n    }\n\n    public async connect(channelObserver?: Observer<TransportChannel>): Promise<void> {\n        this.log.debug(`Opening connection, channel observer ${!!channelObserver ? 'provided' : 'not provided'}`);\n        if (channelObserver) {\n            this.channelObserver.setObserver(channelObserver);\n        }\n        return this.stateMachine.goAsync(ConnectionState.OPEN);\n    }\n\n    public async acceptingConnection(channelObserver?: Observer<TransportChannel>): Promise<void> {\n        this.log.debug(`Accepting connection, channel observer ${!!channelObserver ? 'provided' : 'not provided'}`);\n        if (channelObserver) {\n            this.channelObserver.setObserver(channelObserver);\n        }\n        return this.stateMachine.goAsync(ConnectionState.ACCEPT);\n    }\n\n    public closeAndCleanUp(): void {\n        if (this.stateMachine.is(ConnectionState.CLOSED)) {\n            this.log.debug('Already closed');\n            return;\n        }\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Closing connection, current state is ${this.stateMachine.getCurrent()}`);\n        }\n        this.connectionCancellationToken.cancel('Connection is closed');\n        this.stateMachine.go(ConnectionState.CLOSED);\n        this.channelsHolder.forEach((value, key: string) => {\n            this.log.debug(`Cleaning channel ${key}`);\n            value.channel.closeInternal('Transport connection closed');\n            value.channelTransportProxy.clear();\n        });\n        this.channelsHolder.clear();\n        this.disconnectFromSource()\n            .catch(e => this.log.error('Failed to disconnect from source', e));\n    }\n\n\n    public async handleConnectionCloseFrame(frame: ConnectionCloseFrame): Promise<void> {\n        const completion = frame.getHeaderData().completion as plexus.ICompletion || new SuccessCompletion();\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug('Received connection close', JSON.stringify(completion));\n        }\n        if (!ClientProtocolUtils.isSuccessCompletion(completion)) {\n            this.log.error('Received connection close with error', JSON.stringify(completion));\n            this.reportErrorToChannels(completion.error || new ClientError('Transport closed with error'));\n            this.closeAndCleanUp();\n        } else {\n            switch (this.stateMachine.getCurrent()) {\n                case ConnectionState.OPEN:\n                    this.log.debug('Close received, waiting for client to close it');\n                    this.stateMachine.go(ConnectionState.CLOSE_RECEIVED);\n                    this.channelObserver.complete();\n                    break;\n                case ConnectionState.CLOSE_REQUESTED:\n                    this.log.debug('Close already requested, closing connection');\n                    this.channelObserver.complete();\n                    this.closeAndCleanUp();\n                    break;\n                default:\n                    throw new Error(`Can't handle close, invalid state ${this.stateMachine.getCurrent()}`);\n            }\n        }\n    }\n\n    public handleChannelOpenFrame(frame: ChannelOpenFrame): void {\n        this.log.trace('Received channel open frame');\n        const channelId = UniqueId.fromProperties(frame.getHeaderData().channelId as plexus.IUniqueId);\n        this.log.debug(`Received open channel request ${channelId}`);\n        if (!this.channelsHolder.has(channelId.toString())) {\n            this.createInChannel(channelId);\n        } else {\n            this.log.debug(`Channel ${channelId.toString()} already exist`);\n        }\n    }\n\n    public handleChannelCloseFrame(frame: ChannelCloseFrame): void {\n        const channelId = UniqueId.fromProperties(frame.getHeaderData().channelId as plexus.IUniqueId);\n        const strChannelId = channelId.toString();\n        /* istanbul ignore if */\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Received channel close frame, channelId ${strChannelId}`);\n        }\n        if (this.channelsHolder.has(strChannelId)) {\n            const channelDescriptor = this.channelsHolder.get(strChannelId) as ChannelDescriptor;\n            this.log.debug('Pass close frame to channel', strChannelId);\n            channelDescriptor.channelTransportProxy.next(frame);\n            channelDescriptor.channelTransportProxy.complete();\n        } else {\n            this.log.warn(`Received close channel frame for not existing uuid ${strChannelId}`);\n        }\n    }\n\n    public handleConnectionOpenFrame(frame: ConnectionOpenFrame): void {\n        this.log.trace('Received connection open frame');\n        if (this.stateMachine.is(ConnectionState.OPEN)) {\n            this.log.debug(`Received connection open confimation`);\n        } else if (this.stateMachine.is(ConnectionState.ACCEPT)) {\n            this.log.debug(`Received connection open request`);\n            this.stateMachine.go(ConnectionState.OPEN);\n        }\n    }\n\n    public handleMessageFrame(frame: MessageFrame): void {\n        const channelIdProps = frame.getHeaderData().channelId as plexus.IUniqueId;\n        const channelId = UniqueId.fromProperties(channelIdProps);\n        const strChannelId = channelId.toString();\n        /* istanbul ignore if */\n        if (this.log.isTraceEnabled()) {\n            this.log.trace(`Received message frame, channelId ${strChannelId}`);\n        }\n        const channelExists = this.channelsHolder.has(strChannelId);\n        if (!channelExists) {\n            // not first frame, however no buffer exist\n            this.log.error(`Dropped frame, no incoming buffer exist for ${strChannelId}`);\n        } else {\n            // add frame to incoming buffer\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug(`Received data frame for channel ${strChannelId}`);\n            }\n            const channelDescriptor = this.channelsHolder.get(strChannelId) as ChannelDescriptor;\n            channelDescriptor.channelTransportProxy.next(frame);\n        }\n    }\n\n    private createStateMaschine(): StateMaschine<ConnectionState> {\n        return new StateMaschineBase<ConnectionState>(ConnectionState.CREATED, [\n            // initializing connection\n            {\n                from: ConnectionState.CREATED, to: ConnectionState.OPEN,\n                preHandler: this.openConnectionInternal.bind(this),\n                postHandler: async () => {\n                    this.listenForIncomingFrames();\n                }\n            },\n            // accepting connection\n            {\n                from: ConnectionState.CREATED, to: ConnectionState.ACCEPT,\n                postHandler: async () => {\n                    this.listenForIncomingFrames();\n                }\n            },\n            // connection accepted\n            {\n                from: ConnectionState.ACCEPT, to: ConnectionState.OPEN,\n                preHandler: this.openConnectionInternal.bind(this)\n            },\n            // closing connection message requested\n            {\n                from: ConnectionState.OPEN, to: ConnectionState.CLOSE_REQUESTED\n            },\n            // forced connection closure\n            {\n                from: ConnectionState.OPEN, to: ConnectionState.CLOSED\n            },\n            {\n                from: ConnectionState.CLOSE_RECEIVED, to: ConnectionState.CLOSED\n            },\n            {\n                from: ConnectionState.OPEN, to: ConnectionState.CLOSE_RECEIVED, preHandler: async () => {\n                    this.connectionCancellationToken.cancelRead('Connection close received');\n                }\n            },\n            // graceful connection closure\n            {\n                from: ConnectionState.CLOSE_REQUESTED, to: ConnectionState.CLOSED\n            }\n        ], this.log);\n    }\n\n    private async sendConnectionCloseMessage(completion?: plexus.ICompletion): Promise<void> {\n        this.log.debug('Requesting close connection');\n        this.framedTransport.writeFrame(ConnectionCloseFrame.fromHeaderData({ completion }));\n    }\n\n    private async openConnectionInternal(): Promise<void> {\n        this.log.trace('Opening connection');\n        const id = this.framedTransport.uuid();\n        this.framedTransport.writeFrame(\n            ConnectionOpenFrame.fromHeaderData({\n                connectionId: id\n            }));\n    }\n\n    private async disconnectFromSource(): Promise<void> {\n        this.log.debug('Disconnecting from source transport');\n        return this.framedTransport\n            .disconnect()\n            .then(() => {\n                this.log.debug('Transport disconnected');\n            }, (error) => {\n                this.log.error('Transport disconnect error', error);\n            });\n    }\n\n    private async listenForIncomingFrames(): Promise<void> {\n        this.log.debug('Start listening of incoming frames');\n        this.framedTransport.open({\n            next: (frame) => {\n                if (this.stateMachine.isOneOf(\n                    ConnectionState.CLOSE_REQUESTED,\n                    ConnectionState.OPEN,\n                    ConnectionState.ACCEPT)) {\n                    this.framesHandler.handleFrame(frame, this.log, this);\n                } else {\n                    this.log.warn('Not connected, dropping frame');\n                }\n            },\n            error: (transportError) => {\n                this.log.error('Error from source transport', transportError);\n                this.reportErrorToChannels(transportError);\n                this.channelObserver.complete();\n                this.closeAndCleanUp();\n            },\n            complete: () => {\n                this.log.debug('Source connection completed');\n                this.channelObserver.complete();\n                this.closeAndCleanUp();\n            }\n        });\n    }\n\n    private reportErrorToChannels(error: any): void {\n        this.channelsHolder.forEach((value, key: string) => {\n            value.channelTransportProxy.error(error);\n        });\n    }\n\n    private createOutChannel(channelId: UniqueId): ChannelDescriptor {\n        return this.createChannelInternal(channelId, false);\n    }\n\n    private createInChannel(channelId: UniqueId): ChannelDescriptor {\n        return this.createChannelInternal(channelId, true);\n    }\n\n    private createChannelInternal(channelId: UniqueId, isIncomingChannel: boolean): ChannelDescriptor {\n        const strChannelId = channelId.toString();\n        this.log.debug(`Creating new channel ${strChannelId}`);\n        const proxyLogger = LoggerFactory.getLogger(`ChannelTranportProxy [${strChannelId}]`);\n        const channelTransportProxy = new BufferedTransportProxy(this.framedTransport, this.connectionCancellationToken.getWriteToken(), proxyLogger);\n        const dispose = async () => {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug(`Dispose called on ${strChannelId} channel`);\n            }\n            if (this.channelsHolder.has(strChannelId)) {\n                const channelDescriptor = this.channelsHolder.get(strChannelId) as ChannelDescriptor;\n                channelDescriptor.channelTransportProxy.clear();\n                this.channelsHolder.delete(strChannelId);\n            }\n        };\n        const channel = new FramedTransportChannel(channelId, channelTransportProxy, dispose, this.connectionCancellationToken.getWriteToken());\n        this.channelsHolder.set(strChannelId, { channel, channelTransportProxy });\n        if (isIncomingChannel) {\n            (this.channelObserver as Observer<TransportChannel>).next(channel);\n        }\n        return { channel, channelTransportProxy };\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/SafeMessageBuffer.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { LimitedBufferQueue, Arrays, Logger, LoggerFactory } from '@plexus-interop/common';\n\nlet globalObj: any = typeof window !== 'undefined' ? window : global;\n\ntype Chunk = {\n    isLast: boolean,\n    buffer: ArrayBuffer\n};\n\n/**\n * To mitigate browser issues with concatenating of multiple small chunks into huge one\n */\nexport class SafeMessageBuffer {\n\n    private readonly log: Logger = LoggerFactory.getLogger('SafeMessageBuffer');\n\n    private readonly maxChunksQueueSize: number = 10 * 1024;\n    private buffer: ArrayBuffer = new ArrayBuffer(0);\n    private chunksQueue: Queue<Chunk> = new LimitedBufferQueue(this.maxChunksQueueSize);\n    private syncTimeoutId: number | null = null;\n    private failure: any = null;\n\n    public constructor(\n        private readonly onMessage: (b: ArrayBuffer) => void,\n        private readonly onError: (e: any) => void = () => { },\n        private readonly syncSizeThreshold: number = 1024 * 1024,\n        private readonly throttlingPeriod: number = 500,\n        private readonly batchSize: number = 50) { }\n\n    public getCurrentBuffer(): ArrayBuffer {\n        return this.buffer;\n    }\n\n    public addChunk(buffer: ArrayBuffer, isLast: boolean): void {\n        if (this.failure) {\n            throw this.failure;\n        }\n        const queueEmpty = this.chunksQueue.isEmpty();\n        const reachedLimit = !queueEmpty || buffer.byteLength + this.buffer.byteLength > this.syncSizeThreshold;\n        try {\n            if (reachedLimit) {\n                this.log.trace(`Reached limit of ${this.syncSizeThreshold} bytes, adding chunk to queue`);\n                this.chunksQueue.enqueue({ buffer, isLast });\n                this.scheduleFlush();\n            } else if (isLast) {\n                this.onMessage(Arrays.concatenateBuffers(this.buffer, buffer));\n                this.buffer = new ArrayBuffer(0);\n            } else {\n                this.buffer = Arrays.concatenateBuffers(this.buffer, buffer);\n            }\n        } catch (error) {\n            this.handleError(error);\n        }\n    }\n\n    public hasPendingChunks(): boolean {\n        return !this.chunksQueue.isEmpty();\n    }\n\n    private scheduleFlush(): void {\n        if (!this.syncTimeoutId) {\n            this.syncTimeoutId = globalObj.setTimeout(() => {\n                try {\n                    this.syncTimeoutId = null;\n                    this.log.info(`Increasing buffer with ${this.chunksQueue.size() < this.batchSize ? this.chunksQueue.size() : this.batchSize} chunks`);\n                    this.buffer = this.flushChunks(this.buffer, this.chunksQueue, this.batchSize);\n                    this.log.info(`Current buffer size - ${this.buffer.byteLength} bytes, ${this.chunksQueue.size()} chunks in queue`);\n                    if (!this.chunksQueue.isEmpty()) {\n                        this.scheduleFlush();\n                    }\n                } catch (error) {\n                    this.handleError(error);\n                }\n            }, this.throttlingPeriod);\n        }\n    }\n\n    private flushChunks(resultBuffer: ArrayBuffer, chunksQueue: Queue<Chunk>, batchSize: number): ArrayBuffer {\n        let chunksBuffer = new ArrayBuffer(0);\n        let last = false;\n        // concatenate small chunks together first\n        while (!last && !chunksQueue.isEmpty() && batchSize > 0) {\n            const { buffer, isLast } = chunksQueue.dequeue();\n            last = isLast;\n            chunksBuffer = Arrays.concatenateBuffers(chunksBuffer, buffer);\n            batchSize--;\n        }\n        // now we can append to result buffer\n        if (last) {\n            this.onMessage(Arrays.concatenateBuffers(resultBuffer, chunksBuffer));\n            return new ArrayBuffer(0);\n        } else {\n            resultBuffer = Arrays.concatenateBuffers(resultBuffer, chunksBuffer);\n            return resultBuffer;\n        }\n    }\n\n    private handleError(e: any): void {\n        this.log.error('Failed on updating the buffer', e);\n        this.failure = e;\n        this.buffer = new ArrayBuffer(0);\n        this.onError(e);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/TransportFrameHandler.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Frame, MessageFrame, ConnectionCloseFrame, ChannelOpenFrame, ChannelCloseFrame } from './model';\nimport { ConnectionOpenFrame } from './model/ConnectionOpenFrame';\nimport { Logger } from '@plexus-interop/common';\nimport { TransportFrameListener } from './TransportFrameListener';\n\nexport class TransportFrameHandler {\n\n    public handleFrame(baseFrame: Frame, log: Logger, typedFramesListener: TransportFrameListener): void {\n        if (!baseFrame) {\n            log.warn('Empty frame header, dropping frame');\n        } else if (baseFrame.internalHeaderProperties.messageFrame) {\n            typedFramesListener.handleMessageFrame(baseFrame as MessageFrame);\n        } else if (baseFrame.internalHeaderProperties.close) {\n            typedFramesListener.handleConnectionCloseFrame(baseFrame as ConnectionCloseFrame);\n        } else if (baseFrame.internalHeaderProperties.channelOpen) {\n            typedFramesListener.handleChannelOpenFrame(baseFrame as ChannelOpenFrame);\n        } else if (baseFrame.internalHeaderProperties.channelClose) {\n            typedFramesListener.handleChannelCloseFrame(baseFrame as ChannelCloseFrame);\n        } else if (baseFrame.internalHeaderProperties.open) {\n            typedFramesListener.handleConnectionOpenFrame(baseFrame as ConnectionOpenFrame);\n        } else {\n            throw new Error('Unsupported frame type');\n        }\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/TransportFrameListener.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConnectionCloseFrame, ChannelCloseFrame, MessageFrame } from '.';\nimport { ConnectionOpenFrame } from '.';\nimport { ChannelOpenFrame } from '.';\n\nexport interface TransportFrameListener {\n    \n    handleConnectionCloseFrame(frame: ConnectionCloseFrame): void;\n    \n    handleConnectionOpenFrame(frame: ConnectionOpenFrame): void;\n    \n    handleChannelOpenFrame(frame: ChannelOpenFrame): void;\n    \n    handleChannelCloseFrame(frame: ChannelCloseFrame): void;\n    \n    handleMessageFrame(frame: MessageFrame): void;\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './model';\nexport * from './FramedTransport';\nexport * from './ConnectableFramedTransport';\nexport * from './FramedTransportChannel';\nexport * from './FramedTransportConnection';\nexport * from './SafeMessageBuffer';\n"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/ChannelCloseFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { ServiceFrame } from './ServiceFrame';\n\nexport class ChannelCloseFrame extends ServiceFrame<plexus.interop.transport.protocol.IChannelCloseHeader> {\n\n    constructor(header: plexus.interop.transport.protocol.IHeader) {\n        super();\n        this._header = header;\n    }\n\n    public static fromHeaderData(headerData: plexus.interop.transport.protocol.IChannelCloseHeader): ChannelCloseFrame {\n        return new ChannelCloseFrame({\n            channelClose: headerData\n        });\n    }\n\n    public getHeaderData(): plexus.interop.transport.protocol.IChannelCloseHeader {\n        return this._header.channelClose as plexus.interop.transport.protocol.IChannelCloseHeader;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/ChannelOpenFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { ServiceFrame } from './ServiceFrame';\n\nexport class ChannelOpenFrame extends ServiceFrame<plexus.interop.transport.protocol.IChannelOpenHeader> {\n\n    constructor(header: plexus.interop.transport.protocol.IHeader) {\n        super();\n        this._header = header;\n    }\n\n    public static fromHeaderData(headerData: plexus.interop.transport.protocol.IChannelOpenHeader): ChannelOpenFrame {\n        return new ChannelOpenFrame({\n            channelOpen: headerData\n        });\n    }\n\n    public getHeaderData(): plexus.interop.transport.protocol.IChannelOpenHeader {\n        return this._header.channelOpen as plexus.interop.transport.protocol.IChannelOpenHeader;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/ConnectionCloseFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { ServiceFrame } from './ServiceFrame';\n\nexport class ConnectionCloseFrame extends ServiceFrame<plexus.interop.transport.protocol.IConnectionCloseHeader> {\n\n    public constructor(header: plexus.interop.transport.protocol.IHeader) {\n        super();\n        this._header = header;\n    }\n\n    public static fromHeaderData(headerData: plexus.interop.transport.protocol.IConnectionCloseHeader): ConnectionCloseFrame {\n        return new ConnectionCloseFrame({\n            close: headerData\n        });\n    }\n\n    public getHeaderData(): plexus.interop.transport.protocol.IConnectionCloseHeader {\n        return this._header.close as plexus.interop.transport.protocol.IConnectionCloseHeader;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/ConnectionOpenFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { ServiceFrame } from './ServiceFrame';\n\nexport class ConnectionOpenFrame extends ServiceFrame<plexus.interop.transport.protocol.IConnectionOpenHeader> {\n\n    public constructor(header: plexus.interop.transport.protocol.IHeader) {\n        super();\n        this._header = header;\n    }\n\n    public static fromHeaderData(headerData: plexus.interop.transport.protocol.IConnectionOpenHeader): ConnectionOpenFrame {\n        return new ConnectionOpenFrame({\n            open: headerData\n        });\n    }\n\n    public getInternalHeader(): plexus.interop.transport.protocol.Header {\n        return new plexus.interop.transport.protocol.Header({\n            open: this.getHeaderData()\n        });\n    }\n\n    public getHeaderData(): plexus.interop.transport.protocol.IConnectionOpenHeader {\n        return this._header.open as plexus.interop.transport.protocol.IConnectionOpenHeader;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/DataFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseFrame } from './Frame';\n\nexport abstract class DataFrame<T> extends BaseFrame<T> {\n\n    public isDataFrame(): boolean {\n        return true;\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/Frame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\nexport abstract class Frame {\n\n    protected _header: plexus.interop.transport.protocol.IHeader;\n\n    public abstract isDataFrame(): boolean;\n\n    public abstract getHeaderData(): any;\n\n    public get internalHeaderProperties(): plexus.interop.transport.protocol.IHeader {\n        return this._header;\n    }\n\n    public getInternalHeader(): plexus.interop.transport.protocol.Header {\n        return new plexus.interop.transport.protocol.Header(this._header);\n    }\n\n    public abstract get body(): ArrayBuffer;\n\n    public abstract set body(body: ArrayBuffer);\n\n}\n\nexport abstract class BaseFrame<T> extends Frame {\n\n    private _body: ArrayBuffer;\n\n    public abstract getHeaderData(): T;\n    \n    public get body(): ArrayBuffer {\n        return this._body;\n    }\n    \n    public set body(body: ArrayBuffer) {\n        this._body = body;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/InternalMessagesConverter.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Frame } from './Frame';\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { ChannelOpenFrame, ChannelCloseFrame, ConnectionCloseFrame, MessageFrame } from '.';\nimport { ConnectionOpenFrame } from './ConnectionOpenFrame';\nimport { Arrays } from '@plexus-interop/common';\n\nexport class InternalMessagesConverter {\n\n    public deserialize(data: Uint8Array): Frame {\n        const protoFrame: plexus.interop.transport.protocol.Header = plexus.interop.transport.protocol.Header.decode(data);\n        const plainData = plexus.interop.transport.protocol.Header.toObject(protoFrame) as plexus.interop.transport.protocol.IHeader;\n        if (plainData.channelClose) {\n            return new ChannelCloseFrame(plainData);\n        } else if (plainData.channelOpen) {\n            return new ChannelOpenFrame(plainData);\n        } else if (plainData.close) {\n            return new ConnectionCloseFrame(plainData);\n        } else if (plainData.messageFrame) {\n            return new MessageFrame(plainData);\n        } else if (plainData.open) {\n            return new ConnectionOpenFrame(plainData);\n        } else {\n            throw new Error('Unsupported frame type');\n        }\n    }\n\n    public serialize(frame: Frame): ArrayBuffer {\n        return Arrays.toArrayBuffer(plexus.interop.transport.protocol.Header.encode(\n            frame.internalHeaderProperties\n        ).finish());\n    }\n\n}\n"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/MessageFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\nimport { DataFrame } from './DataFrame';\n\nexport class MessageFrame extends DataFrame<plexus.interop.transport.protocol.IMessageFrameHeader> {\n\n    constructor(header: plexus.interop.transport.protocol.IHeader, body: ArrayBuffer = new Uint8Array([]).buffer) {\n        super();\n        this._header = header;\n        this.body = body;\n    }\n\n    public static fromHeaderData(headerData: plexus.interop.transport.protocol.IMessageFrameHeader, body?: ArrayBuffer): MessageFrame {\n        return new MessageFrame({\n            messageFrame: headerData\n        }, body);\n    }\n\n    public isLast(): boolean {\n        return !this.getHeaderData().hasMore;\n    }\n\n    public getHeaderData(): plexus.interop.transport.protocol.IMessageFrameHeader {\n        return this._header.messageFrame as plexus.interop.transport.protocol.IMessageFrameHeader;\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/ServiceFrame.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseFrame } from './Frame';\n\nexport abstract class ServiceFrame<T> extends BaseFrame<T> {\n\n    public isDataFrame(): boolean {\n        return false;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './MessageFrame';\nexport * from './ConnectionOpenFrame';\nexport * from './ConnectionCloseFrame';\nexport * from './ChannelOpenFrame';\nexport * from './ChannelCloseFrame';\nexport * from './Frame';\nexport * from './InternalMessagesConverter';"
  },
  {
    "path": "web/packages/transport-common/src/transport/frame/model/util.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { transportProtocol as plexus } from '@plexus-interop/protocol';\n\nexport function isOk(completion: plexus.ICompletion): boolean {\n    return completion && completion.status === plexus.Completion.Status.Completed;\n}\n\nexport function successCompletion(): plexus.ICompletion {\n    return {\n        status: plexus.Completion.Status.Completed\n    };\n}"
  },
  {
    "path": "web/packages/transport-common/src/transport/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nrequire('long');\nexport * from './TransportConnection';\nexport * from './frame';\nexport * from './ClientConnectionFactory';\nexport * from './TransportChannel';\nexport * from './InMemoryConnectionFactory';\nexport * from './InMemoryFramedTransport';\nexport * from './ServerConnectionFactory';\nexport * from './DuplexConnectionFactory';\nexport * from './ConnectionDetails';\nexport {UniqueId as UniqueId} from '@plexus-interop/protocol';"
  },
  {
    "path": "web/packages/transport-common/tests/BufferedObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LogObserver } from './LogObserver';\nimport { BlockingQueueBase, CancellationToken } from '@plexus-interop/common';\n\nexport class BufferedObserver<T> extends LogObserver<T> {\n\n    constructor(private cancellationToken?: CancellationToken, private buffer: BlockingQueueBase<T> = new BlockingQueueBase<T>()) {\n        super();\n    }\n\n    public next(data: T): void {\n        super.next(data);\n        this.buffer.enqueue(data);\n    }\n\n    public pullData(): Promise<T> {\n        return this.buffer.blockingDequeue(this.cancellationToken);\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/tests/LogObserver.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Observer } from '@plexus-interop/common';\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport class LogObserver<T> implements Observer<T> {\n\n    constructor(private _next?: (data: T) => void, private id: UniqueId = UniqueId.generateNew()) {}\n\n    public complete(): void {\n        console.log(`${this.id.toString()} - Complete`);\n    }\n\n    public next(data: T): void {\n        console.log(`${this.id.toString()} - Next`);        \n        if (this._next) {\n            this._next(data);\n        }\n    }\n\n    public error(error: any) {\n        console.log(`${this.id.toString()} - Error`);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/tests/transport/TestBufferedInMemoryFramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Frame } from '../../src/transport/frame/model/Frame';\nimport { ConnectableFramedTransport } from '../../src/transport/frame/ConnectableFramedTransport';\nimport { LoggerFactory, Observer, Logger } from '@plexus-interop/common';\nimport { BufferedReadFramedTransport } from '../../src/transport/frame/BufferedReadFramedTransport';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { AsyncHelper, CancellationToken } from '@plexus-interop/common';\n\nexport class TestBufferedInMemoryFramedTransport extends BufferedReadFramedTransport implements ConnectableFramedTransport {\n\n    private connectionToken: CancellationToken = new CancellationToken();\n\n    constructor(\n        private readonly guid: UniqueId = UniqueId.generateNew(),\n        inBuffer: Queue<Frame> = new Queue<Frame>(),\n        public readonly outBuffer: Queue<Frame> = new Queue<Frame>(),\n        public readonly bufferSize: number = 8,\n        log: Logger = LoggerFactory.getLogger('BufferedInMemoryFramedTransport')) {\n        super(log);\n        this.inBuffer = inBuffer;\n    }\n\n    public uuid(): UniqueId {\n        return this.guid;\n    }\n\n    public getMaxFrameSize(): number {\n        return this.bufferSize;\n    }\n\n    public async open(framesObserver: Observer<Frame>): Promise<void> {\n        await super.open(framesObserver);\n        this.listenForInbox().catch(e => this.log.error('Stopped to listed for inbox with error', e));\n    }\n\n    private async listenForInbox(): Promise<void> {\n        this.log.debug('Starting to listen for more frames');        \n        while (this.connected() && !this.completed) {\n            this.log.debug('Waiting for new frames to come');\n            await AsyncHelper.waitFor(() => this.inBuffer.size() > 0, this.connectionToken, 10, 5000);\n            this.log.debug('Some frames arrived, passing to observer');\n            while (this.inBuffer.size() > 0) {\n                this.next(this.inBuffer.dequeue());\n            }\n        }\n        this.log.debug('Stopped to listen for frames');\n    }\n\n    public async writeFrame(frame: Frame): Promise<void> {\n        this.log.debug('Write frame');\n        this.outBuffer.enqueue(frame);\n    }\n\n    public async disconnect(): Promise<void> {\n        this.log.debug('Disconnect');\n        this.connectionToken.cancel();\n    }\n\n    public connected(): boolean {\n        return !this.connectionToken.isCancelled();\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/tests/transport/TestInMemoryConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '../../src/transport/TransportConnection';\nimport { TransportChannel } from '../../src/transport/TransportChannel';\nimport { Frame } from '../../src/transport/frame/model/Frame';\nimport { TestBufferedInMemoryFramedTransport } from './TestBufferedInMemoryFramedTransport';;\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { FramedTransportConnection } from '../../src/transport/frame/FramedTransportConnection';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\nimport { LoggerFactory, Observer } from '@plexus-interop/common';\n\nexport class TestInMemoryConnectionFactory {\n\n    constructor(\n        public readonly clientInBuffer: Queue<Frame> = new Queue<Frame>(),\n        public readonly serverInBuffer: Queue<Frame> = new Queue<Frame>()) { }\n\n    public async connectClient(channelObserver: Observer<TransportChannel>): Promise<TransportConnection> {\n        const connection = new FramedTransportConnection(\n            new TestBufferedInMemoryFramedTransport(UniqueId.generateNew(), this.clientInBuffer, this.serverInBuffer, 8, LoggerFactory.getLogger('ClientTransport')));\n        return connection.connect(channelObserver).then(() => connection);\n    }\n\n    public async connectServer(channelObserver: Observer<TransportChannel>): Promise<TransportConnection> {\n        const connection = new FramedTransportConnection(new TestBufferedInMemoryFramedTransport(UniqueId.generateNew(), this.serverInBuffer, this.clientInBuffer, 8, LoggerFactory.getLogger('ServerTransport')));\n        return connection.acceptingConnection(channelObserver).then(() => connection);\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/tests/transport/UniqueId.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId, clientProtocol as plexus } from '@plexus-interop/protocol';\nimport { GUID } from '@plexus-interop/common';\n\ndescribe('UniqueId', () => {\n\n    it('Can be created from string and converted back', () => {\n        const guidString = 'C2EBE9A500AC114382A50C11EDC47EFA';\n        const uniqueId = UniqueId.fromGuid(new GUID(guidString));\n        expect(uniqueId.toString()).toEqual(guidString);\n    });\n\n    it('Parses GUID string in the same way as Broker', () => {\n        const guidString = 'C2EBE9A500AC114382A50C11EDC47EFA';\n        const uniqueId = UniqueId.fromGuid(new GUID(guidString));\n        expect(uniqueId.hi.toString(10)).toEqual('14045576757775176003');\n        expect(uniqueId.lo.toString(10)).toEqual('9413943867230945018');\n    });\n\n    it('Can be serialyzed from string to Proto and restored back', () => {\n        const guidString = '4687E14CC9F84270B0862703616225C7';\n        const uniqueId = UniqueId.fromString(guidString);\n        const fromProps = UniqueId.fromProperties(uniqueId as plexus.IUniqueId);\n        expect(guidString).toEqual(fromProps.toString());\n    });\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/ClientToServer.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TransportConnection } from '../../../src/transport/TransportConnection';\nimport { TransportChannel } from '../../../src/transport/TransportChannel';\nimport { randomPayload } from '../../utils';\nimport { BufferedObserver } from '../../BufferedObserver';\nimport { LogObserver } from '../../LogObserver';\nimport { setupConnections, disconnect } from '../transport-mocks';\nimport { AnonymousSubscription } from 'rxjs/Subscription';\nimport { DelegateChannelObserver } from '../../../src/common/DelegateChannelObserver';\n\ndescribe('Framed Transport Connection: Client to Server communication', () => {\n\n    it('Sends message from server to client', async () => {\n        const { client, server, clientChannelsObserver, serverChannelsObserver } = await setupConnections();\n        await sendReceiveAndVerify(client, server, clientChannelsObserver, serverChannelsObserver, randomPayload(3));\n        await disconnect(client, server);\n    });\n\n    it('Can connect client and server', async () => {\n        const { client, server } = await setupConnections();\n        expect(client).toBeDefined();\n        expect(server).toBeDefined();\n        await disconnect(client, server);\n    });\n\n    it('Can send big message', async () => {\n        const { client, server, clientChannelsObserver, serverChannelsObserver } = await setupConnections();\n        const payload = randomPayload(2 * 1024);\n        await sendReceiveAndVerify(client, server, clientChannelsObserver, serverChannelsObserver, payload);\n        await disconnect(client, server);\n    });\n\n    it('Can send messages with different length in a row', async () => {\n        const { client, server, clientChannelsObserver, serverChannelsObserver } = await setupConnections();\n        await sendReceiveAndVerifyAll(client, server, clientChannelsObserver, serverChannelsObserver, [randomPayload(1), randomPayload(5), randomPayload(10)]);\n        await disconnect(client, server);\n    });\n\n    it('Can continue to send messages even if remote channel requested close', async () => {\n\n        // tslint:disable-next-line:no-unused-variable\n        const { client, server, serverChannelsObserver } = await setupConnections();\n\n        const clientChannel = await client.createChannel();\n\n        const payload = new ArrayBuffer(3);\n\n        await new Promise<AnonymousSubscription>(\n            (resolve, reject) => clientChannel.open(new DelegateChannelObserver(new LogObserver(undefined, clientChannel.uuid()), (s) => resolve(s))));\n\n        // sever channel opened\n        const serverChannel = await serverChannelsObserver.pullData();\n        const observer = new BufferedObserver<ArrayBuffer>();\n        await new Promise<AnonymousSubscription>(\n            (resolve, reject) => serverChannel.open(new DelegateChannelObserver(observer, (s) => resolve(s))));\n\n        // server channel close requested\n        const serverChClosed = serverChannel.close();\n\n        clientChannel.sendMessage(payload);\n        const received = await observer.pullData();\n\n        expect(new Uint8Array(payload)).toEqual(new Uint8Array(received));\n        const clientChClosed = clientChannel.close();\n        await clientChClosed;\n        await serverChClosed;\n        await disconnect(client, server);\n\n    });\n\n    async function sendReceiveAndVerify(\n        clientConnection: TransportConnection,\n        serverConnection: TransportConnection,\n        clientChannelsObserver: BufferedObserver<TransportChannel>,\n        serverChannelsObserver: BufferedObserver<TransportChannel>,\n        payload: ArrayBuffer): Promise<void> {\n        // tslint:disable-next-line:no-console\n        console.log('Creating channel');\n        const clientChannel = await clientConnection.createChannel();\n        // tslint:disable-next-line:no-console\n        console.log('Created channel');\n        await new Promise<AnonymousSubscription>(\n            (resolve, reject) => clientChannel.open(new DelegateChannelObserver(new LogObserver(undefined, clientChannel.uuid()), (s) => {\n                // tslint:disable-next-line:no-console\n                console.log('Client channel created');\n                resolve(s);\n            })));\n        // tslint:disable-next-line:no-console\n        console.log('Client channel created');\n\n        await clientChannel.sendMessage(payload);\n        // tslint:disable-next-line:no-console\n        console.log('Client sent message');\n\n        const serverChannel = await serverChannelsObserver.pullData();\n        // tslint:disable-next-line:no-console\n        console.log('Waiting for server chanel channel');\n\n        const observer = new BufferedObserver<ArrayBuffer>();\n        serverChannel.open(new DelegateChannelObserver(observer, (s) => { }));\n        const received = await observer.pullData();\n        expect(new Uint8Array(payload)).toEqual(new Uint8Array(received));\n        const clientChClosed = clientChannel.close();\n        const serverChClosed = serverChannel.close();\n        await clientChClosed;\n        await serverChClosed;\n    }\n\n    async function sendReceiveAndVerifyAll(\n        clientConnection: TransportConnection,\n        serverConnection: TransportConnection,\n        clientChannelsObserver: BufferedObserver<TransportChannel>,\n        serverChannelsObserver: BufferedObserver<TransportChannel>,\n        payloads: ArrayBuffer[]): Promise<void> {\n\n        const clientChannel = await clientConnection.createChannel();\n        new Promise<AnonymousSubscription>(\n            (resolve, reject) => clientChannel.open(new DelegateChannelObserver(new LogObserver(undefined, clientChannel.uuid()), (s) => resolve(s))))\n            .then(() => {\n                payloads.forEach(payload => clientChannel.sendMessage(payload));\n            });\n\n        const serverChannel = await serverChannelsObserver.pullData();\n\n        const observer = new BufferedObserver<ArrayBuffer>();\n        await new Promise((resolve, _) => serverChannel.open(new DelegateChannelObserver(observer, (s) => resolve())));\n\n        for (let payload of payloads) {\n            const received = await observer.pullData();\n            expect(new Uint8Array(payload)).toEqual(new Uint8Array(received));\n        }\n        const clientChClosed = clientChannel.close();\n        const serverChClosed = serverChannel.close();\n        await clientChClosed;\n        await serverChClosed;\n    }\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/FramedTransportChannel.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { FramedTransport, FramedTransportChannel } from '../../../src/transport/frame';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { TestUtils } from './util';\nimport { mock, instance, when, anything } from 'ts-mockito';\nimport { CancellationToken, AsyncHelper } from '@plexus-interop/common';\nimport { Observer } from '@plexus-interop/common';\nimport { LogObserver } from '../../LogObserver';\nimport { TestBufferedInMemoryFramedTransport } from '../TestBufferedInMemoryFramedTransport';\nimport { Frame } from '../../../src/transport/frame/model/Frame';\nimport { AnonymousSubscription } from 'rxjs/Subscription';\nimport { DelegateChannelObserver } from '../../../src/common/DelegateChannelObserver';\nimport { default as Queue } from 'typescript-collections/dist/lib/Queue';\n\ndescribe('FramedTransportChannel', () => {\n\n    it('Concatenates message from frames', (done) => {\n\n        const mockFrameTransport = new TestBufferedInMemoryFramedTransport();\n\n        TestUtils.framedMessage().forEach(frame => {\n            mockFrameTransport.next(frame);\n        });\n        const cancellationToken = new CancellationToken();\n        const sut = new FramedTransportChannel(UniqueId.generateNew(), mockFrameTransport, async () => { }, cancellationToken);\n        sut.open({\n            startFailed: () => {},\n            started: () => {},            \n            next: (result) => {\n                expect(result.byteLength > 0).toBeTruthy();\n                cancellationToken.cancel();\n                done();\n            },\n            complete: () => { },\n            error: () => { }\n        });\n\n    });\n\n    it('Reports error to observable if can\\'t read frame', (done) => {\n\n        const mockFrameTransport: FramedTransport = mock(TestBufferedInMemoryFramedTransport);\n\n        TestUtils.framedMessage().forEach(frame => {\n            when(mockFrameTransport.open(anything())).thenReturn(Promise.reject(new Error('Transport error')));\n        });\n\n        const sut = new FramedTransportChannel(UniqueId.generateNew(), instance(mockFrameTransport), async () => { }, new CancellationToken());\n        sut.open({\n            startFailed: () => {},            \n            started: () => {},\n            next: () => {\n                fail('Not expected');\n            },\n            complete: () => {\n                fail('Not expected');\n            },\n            error: (e) => {\n                expect(e).toBeDefined();\n                done();\n            }\n        });\n\n    });\n\n    it('Rejects request if already opened', async (done) => {\n\n        const mockFrameTransport = new TestBufferedInMemoryFramedTransport();\n\n        TestUtils.framedMessage().forEach(frame => {\n            mockFrameTransport.next(frame);\n        });\n        const cancellationToken = new CancellationToken();\n\n        const sut = new FramedTransportChannel(UniqueId.generateNew(), mockFrameTransport, async () => { }, cancellationToken);\n        const observer: Observer<ArrayBuffer> = {\n            next: (result: ArrayBuffer) => {\n                expect(result.byteLength > 0).toBeTruthy();\n                cancellationToken.cancel();\n                done();\n            },\n            complete: () => { },\n            error: () => { }\n        };\n        \n        await new Promise<AnonymousSubscription>(\n            (resolve, reject) => sut.open(new DelegateChannelObserver(observer, (s) => resolve(s))));\n\n        new Promise<AnonymousSubscription>(\n            (resolve, reject) => sut.open(new DelegateChannelObserver(observer, (s) => resolve(s))))\n            .catch(() => done());\n    });\n\n    it('Sends big message by frames', async (done) => {\n\n        const mockFrameTransport = new TestBufferedInMemoryFramedTransport(UniqueId.generateNew(), new Queue<Frame>(), new Queue<Frame>(), 3);\n        const dataArray = [1, 2, 3, 4, 5];\n        const dataToSend = new Uint8Array(dataArray);\n        const channelId = UniqueId.generateNew();\n        const cancellationToken = new CancellationToken();\n\n        const sut = new FramedTransportChannel(channelId, mockFrameTransport, async () => { }, cancellationToken);\n        await new Promise<AnonymousSubscription>(\n            (resolve, reject) => sut.open(new DelegateChannelObserver(new LogObserver(), (s) => resolve(s))));\n                   \n        sut.sendMessage(dataToSend.buffer).then(async () => {\n            await AsyncHelper.waitFor(() => mockFrameTransport.outBuffer.size() > 0);\n            const firstFrame = mockFrameTransport.outBuffer.dequeue();\n            expect(firstFrame.getHeaderData().channelId).toEqual(channelId);\n            expect(firstFrame.getHeaderData().hasMore).toEqual(true);\n            expect(new Uint8Array(firstFrame.body)).toEqual(new Uint8Array([1, 2, 3]));\n            await AsyncHelper.waitFor(() => mockFrameTransport.outBuffer.size() > 0);\n            const secondFrame = mockFrameTransport.outBuffer.dequeue();\n            expect(secondFrame.getHeaderData().channelId).toEqual(channelId);\n            expect(secondFrame.getHeaderData().hasMore).toEqual(false);\n            expect(new Uint8Array(secondFrame.body)).toEqual(new Uint8Array([4, 5]));\n            cancellationToken.cancel();\n            done();\n        });\n    });\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/FramedTransportConnection.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { FramedTransportConnection } from '../../../src/transport/frame';\nimport { TestUtils } from './util';\nimport { BufferedObserver } from '../../BufferedObserver';\nimport { TestBufferedInMemoryFramedTransport } from '../TestBufferedInMemoryFramedTransport';\nimport { AnonymousSubscription } from 'rxjs/Subscription';\nimport { DelegateChannelObserver } from '../../../src/common/DelegateChannelObserver';\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { ChannelOpenFrame } from '../../../src/transport/frame/model/ChannelOpenFrame';\nimport { TransportChannel } from '../../../src/transport/TransportChannel';\nimport { AsyncHelper } from '@plexus-interop/common';\n\ndescribe('FramedTransportConnection', () => {\n\n    it('Delivers messages to different channels', async () => {\n\n        let mockFrameTransport = new TestBufferedInMemoryFramedTransport();\n\n        const firstChannelId = UniqueId.generateNew();\n        const secondChannelId = UniqueId.generateNew();\n\n        mockFrameTransport.next(ChannelOpenFrame.fromHeaderData({\n            channelId: firstChannelId\n        }));\n        \n        mockFrameTransport.next(ChannelOpenFrame.fromHeaderData({\n            channelId: secondChannelId\n        }));\n\n        TestUtils.twoShuffeledMessages(firstChannelId, secondChannelId).forEach(frame => {\n            mockFrameTransport.next(frame);\n        });\n\n        const transportConnection = new FramedTransportConnection(mockFrameTransport);\n        const channels: TransportChannel[] = [];\n        \n        await transportConnection.connect({\n            next: ch => channels.push(ch),\n            complete: () => { },\n            error: e => { }\n        });\n\n        await AsyncHelper.waitFor(() => channels.length === 2);\n\n        // channels created\n        const first = channels[0];\n        expect(first).toBeDefined();\n        const second = channels[1];\n        expect(second).toBeDefined();\n\n        // messages delivered\n        const firstObserver = new BufferedObserver<ArrayBuffer>();\n        const firstSubscription =\n            await new Promise<AnonymousSubscription>(\n                (resolve, reject) => first.open(new DelegateChannelObserver(firstObserver, (s) => resolve(s))));\n\n        const secondObserver = new BufferedObserver<ArrayBuffer>();\n        const secondSubscription =\n            await new Promise<AnonymousSubscription>(\n                (resolve, reject) => second.open(new DelegateChannelObserver(secondObserver, (s) => resolve(s))));\n\n        const message = await firstObserver.pullData();\n        expect(message).toBeDefined();\n        const secondMessage = await secondObserver.pullData();\n        expect(secondMessage).toBeDefined();\n        firstSubscription.unsubscribe();\n        secondSubscription.unsubscribe();\n        await transportConnection.closeAndCleanUp();\n\n    });\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/InternalMessagesConverter.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { InternalMessagesConverter, ChannelOpenFrame } from '../../../src/transport/frame';\nimport { UniqueId } from '../../../src/transport';\n\ndescribe('InternalMessagesConverter', () => {\n\n    const sut = new InternalMessagesConverter();\n\n    it('Should convert header frames to and from binary format', () => {\n\n        const before = ChannelOpenFrame.fromHeaderData({channelId: UniqueId.generateNew()});\n        const binary = sut.serialize(before);\n        const after = sut.deserialize(new Uint8Array(binary));\n\n        expect(before).toEqual(after); \n\n    });\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/SafeMessageBuffer.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SafeMessageBuffer } from '../../../src';\n\ndescribe('SafeMessagesBuffer', () => {\n\n    it('Performs sync buffer increase if limit not reached', () => {\n        \n        const first = new Uint32Array([1, 2, 3]);\n        const second = new Uint32Array([5, 6, 7]);\n\n        const safeBuffer = new SafeMessageBuffer(() => {});\n        safeBuffer.addChunk(first.buffer, false);\n        safeBuffer.addChunk(second.buffer, false);\n\n        expect(new Uint32Array(safeBuffer.getCurrentBuffer()))\n            .toEqual(new Uint32Array([1, 2, 3, 5, 6, 7]));\n            \n    });\n\n    it('Adds chunks to queue if reached the limit and concatenate after timeout', done => {\n        \n        const first = new Uint32Array([1, 2, 3]);\n        const second = new Uint32Array([5, 6, 7]);\n\n        const safeBuffer = new SafeMessageBuffer(() => {}, () => {}, 1, 10);\n\n        safeBuffer.addChunk(first.buffer, false);\n        safeBuffer.addChunk(second.buffer, false);\n        expect(safeBuffer.getCurrentBuffer().byteLength).toEqual(0);\n\n        setTimeout(() => {\n            expect(new Uint32Array(safeBuffer.getCurrentBuffer()))\n                .toEqual(new Uint32Array([1, 2, 3, 5, 6, 7]));\n            done();\n        }, 50);\n            \n    });\n\n    it('Forces message and buffer flush if last chunk received', done => {\n        \n        const first = new Uint32Array([1, 2, 3]);\n        const second = new Uint32Array([5, 6, 7]);\n        const third = new Uint32Array([8]);        \n\n        const safeBuffer = new SafeMessageBuffer(message => {\n            expect(new Uint32Array(message))\n                .toEqual(new Uint32Array([1, 2, 3, 5, 6, 7, 8]));\n            done();\n        }, () => {}, 1, 10, 1);\n\n        safeBuffer.addChunk(first.buffer, false);\n        safeBuffer.addChunk(second.buffer, false);\n        safeBuffer.addChunk(third.buffer, true);\n            \n    });\n\n});"
  },
  {
    "path": "web/packages/transport-common/tests/transport/frame/util.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Frame, MessageFrame } from '../../../src/transport/frame/model';\nimport { UniqueId } from '@plexus-interop/protocol';\n\nexport class TestUtils {\n\n    public static framedMessage(channelId: UniqueId = UniqueId.generateNew()): Frame[] {\n        return [MessageFrame.fromHeaderData(\n            {\n                channelId,\n                hasMore: true,\n                length: 1                \n            },\n            new Uint8Array(1).buffer)\n        , MessageFrame.fromHeaderData(\n            {\n                channelId,\n                hasMore: false,\n                length: 1\n            },\n            new Uint8Array(2).buffer)\n       ];\n    }\n\n    public static secondFramedMessage(channelId: UniqueId = UniqueId.generateNew()): Frame[] {\n        return [MessageFrame.fromHeaderData(\n            {\n                channelId,\n                hasMore: true,\n                length: 1\n            },\n            new Uint8Array(1).buffer)\n        , MessageFrame.fromHeaderData(\n            {\n                channelId,\n                hasMore: false\n            },\n            new Uint8Array(2).buffer)\n       ];\n    }\n\n    public static twoShuffeledMessages(\n        firstChannelId: UniqueId, secondChannelId: UniqueId\n    ): Frame[] {\n        const first = this.framedMessage(firstChannelId);\n        const second = this.secondFramedMessage(secondChannelId);\n        return [\n            first[0], second[0], second[1], first[1]\n        ];\n    }\n}"
  },
  {
    "path": "web/packages/transport-common/tests/transport/mocks/BufferedChannel.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId } from '@plexus-interop/protocol';\nimport { Observer } from '@plexus-interop/common';\nimport { Subscription } from 'rxjs/Subscription';\nimport { TransportChannel } from '../../../src/transport/TransportChannel';\nimport { clientProtocol as plexus, SuccessCompletion} from '@plexus-interop/protocol';\nimport { Logger, LoggerFactory, BlockingQueue, BlockingQueueBase, CancellationToken } from '@plexus-interop/common';\n\nexport class BufferedChannel implements TransportChannel {\n\n    private log: Logger = LoggerFactory.getLogger('Test Channel');\n\n    public readonly in: BlockingQueue<ArrayBuffer> = new BlockingQueueBase<ArrayBuffer>();\n    public readonly out: BlockingQueue<ArrayBuffer> = new BlockingQueueBase<ArrayBuffer>();\n    public readonly id: UniqueId = UniqueId.generateNew();\n\n    constructor(private cancellationToken: CancellationToken) {\n        this.log.info('Created');\n    }\n\n    public async open(observer: Observer<ArrayBuffer>): Promise<Subscription> {\n        const subscription = new Subscription(() => this.cancellationToken.cancel('unsubscribed'));\n        this.listenToMessages(observer);\n        return subscription;\n    }\n\n    private async listenToMessages(observer: Observer<ArrayBuffer>): Promise<void> {\n        try {\n            while (!this.cancellationToken.isCancelled()) {\n                const message = await this.in.blockingDequeue(this.cancellationToken);\n                console.log(`Got in message from buffer ${message.byteLength} bytes`);\n                observer.next(message);\n            }\n            observer.complete();\n        } catch (error) {\n            console.error('Error on reading message', error);\n            observer.error(error);\n        }\n    }\n\n    public addToInbox(data: ArrayBuffer): Promise<void> {\n        this.log.debug(`Adding ${data.byteLength} bytes to inbox`);\n        return this.in.enqueue(data);\n    }\n\n    public pullOutMessage(): Promise<ArrayBuffer> {\n        return this.out.blockingDequeue(this.cancellationToken);\n    }\n\n    public isInboxEmpty(): boolean {\n        return this.in.size() === 0;\n    }\n\n    public async sendMessage(data: ArrayBuffer): Promise<void> {\n        this.log.debug(`Sending ${data.byteLength} bytes`);\n        this.out.enqueue(data);\n    }\n\n    public async sendLastMessage(data: ArrayBuffer): Promise<plexus.ICompletion> {\n        await this.sendMessage(data);\n        return this.close();\n    }\n\n    public cancel(): void {\n        this.cancellationToken.cancel('Closed');\n    }\n\n    public async close(): Promise<SuccessCompletion> {\n        this.log.info('Close requested');\n        return new SuccessCompletion();\n    }\n\n    public uuid(): UniqueId {\n        return this.id;\n    }\n\n}"
  },
  {
    "path": "web/packages/transport-common/tests/transport/transport-mocks.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TestInMemoryConnectionFactory } from './TestInMemoryConnectionFactory';\nimport { TransportConnection } from '../../src/transport/TransportConnection';\nimport { TransportChannel } from '../../src/transport/TransportChannel';\nimport { BufferedObserver } from '../BufferedObserver';\n\nexport async function setupConnections(): Promise<{ client: TransportConnection, server: TransportConnection, clientChannelsObserver: BufferedObserver<TransportChannel>, serverChannelsObserver: BufferedObserver<TransportChannel> }> {\n    \n    const factory = new TestInMemoryConnectionFactory();\n    const clientChannelsObserver = new BufferedObserver<TransportChannel>();\n    const serverChannelsObserver = new BufferedObserver<TransportChannel>();\n    \n    return Promise.all([\n            factory.connectClient(clientChannelsObserver), \n            factory.connectServer(serverChannelsObserver)])\n        .then((data) => {\n            return { client: data[0], server: data[1], clientChannelsObserver, serverChannelsObserver };\n        });\n\n}\n\nexport function disconnect(clientConnection: TransportConnection, serverConnection: TransportConnection): Promise<any> {\n    return Promise.all([clientConnection.disconnect(), serverConnection.disconnect()]);\n}\n"
  },
  {
    "path": "web/packages/transport-common/tests/utils.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function randomPayload(length?: number): ArrayBuffer {\n    length = length || 10;\n    const array = new Array(length).fill('').map(_ => randomInt(1, 10));\n    return new Uint8Array(array).buffer;\n}\n\nexport function randomInt(min: number, max: number): number {\n    min = Math.ceil(min);\n    max = Math.floor(max);\n    return Math.floor(Math.random() * (max - min)) + min;\n}"
  },
  {
    "path": "web/packages/transport-common/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"listFiles\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"noUnusedLocals\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"removeComments\": false,\n        \"sourceMap\": true,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"jest\",\n            \"long\",\n            \"node\"\n        ],\n        \"baseUrl\": \".\",\n        \"paths\": {\n            \"plexus-transport-common\": [\"src/index.ts\"]\n        }\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/transport-common/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/web-example/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/web-app-example\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Simple Web App examples\",\n  \"main\": \"index.js\",\n  \"private\": true,\n  \"scripts\": {\n    \"prebuild\": \"trash dist\",\n    \"compile\": \"tsc -p tsconfig.json\",\n    \"package\": \"browserify ./dist/main/src/greeting/server/Main.js --outfile ./dist/greetingServer.bundle.js\",\n    \"copy-assets\": \"copyfiles -f src/greeting/views/* ./dist && copyfiles -f ./dist/greetingServer* ../../../bin/win-x86/samples/greeting/apps/WebGreetingServer\",\n    \"copy-gen-folders\": \"copyfiles src/greeting/server/gen/* dist/main\",\n    \"build\": \"npm run compile && npm run copy-gen-folders && npm run package && npm run copy-assets\",\n    \"gen-server-js\": \"pbjs --force-long -t static-module -r launcher -w commonjs -o src/greeting/server/gen/plexus-messages.js ../../../plexus-desktop/src/Plexus.Interop.Samples.Configuration/metadata/interop/samples.proto ../../../plexus-desktop/src/Plexus.Interop.Samples.Configuration/metadata/interop/common.proto\",\n    \"gen-server-ts\": \"pbts --force-long -o src/greeting/server/gen/plexus-messages.d.ts src/greeting/server/gen/plexus-messages.js\",\n    \"gen-server-protocol\": \"npm run gen-server-js && npm run gen-server-ts\",\n    \"prestart\": \"npm run build\",\n    \"start\": \"http-server ./dist -p 8001\",\n    \"republish\": \"echo 'Not implemented'\"\n  },\n  \"keywords\": [\n    \"plexus\",\n    \"example\"\n  ],\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"protobufjs\": \"6.11.3\",\n    \"@plexus-interop/client\": \"0.1.0\",\n    \"@plexus-interop/websocket-transport\": \"0.1.0\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\"\n  },\n  \"devDependencies\": {\n    \"@types/long\": \"^4.0.0\",\n    \"browserify\": \"^14.5.0\",\n    \"copyfiles\": \"^1.2.0\",\n    \"electron\": \"1.8.8\",\n    \"http-server\": \"^0.11.1\",\n    \"trash-cli\": \"^1.4.0\",\n    \"typescript\": \"3.7.2\"\n  }\n}\n"
  },
  {
    "path": "web/packages/web-example/src/common/DomLogger.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Logger, LoggerFactory, LogLevel } from '@plexus-interop/common';\n\nexport class DomLogger implements Logger {\n\n    constructor(\n        private domElId: string,\n        private baseLogger: Logger = LoggerFactory.getLogger('DomLogger')) {\n    }\n\n    public debug(msg: string, ...args: any[]): void {\n        this.baseLogger.debug(msg, args);\n    }\n\n    public info(msg: string, ...args: any[]): void {\n        this.appendString(`INFO: ${msg}`);\n        this.baseLogger.info(msg, args);\n    }\n\n    public error(msg: string, ...args: any[]): void {\n        this.baseLogger.error(msg, args);\n    }\n\n    public warn(msg: string, ...args: any[]): void {\n        this.baseLogger.warn(msg, args);\n    }\n\n    public trace(msg: string, ...args: any[]): void {\n        this.baseLogger.trace(msg, args);\n    }\n\n    private appendString(text: string) {\n        const domEl = document.getElementById(this.domElId);\n        if (domEl) {\n            domEl.innerText = domEl.innerText + '\\n' + text;\n        }\n    }\n\n    public getLogLevel(): LogLevel {\n        return this.baseLogger.getLogLevel();\n    }\n\n    public isDebugEnabled(): boolean {\n        return this.baseLogger.getLogLevel() <= LogLevel.DEBUG;\n    }\n\n    public isTraceEnabled(): boolean {\n        return this.baseLogger.getLogLevel() <= LogLevel.TRACE;\n    }\n\n}"
  },
  {
    "path": "web/packages/web-example/src/greeting/server/Main.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerFactory, LogLevel } from '@plexus-interop/common';\n\nLoggerFactory.setLogLevel(LogLevel.TRACE);\n\nimport { WebGreetingServerClientBuilder } from './WebGreetingServerGeneratedClient';\nimport { WebSocketConnectionFactory } from '@plexus-interop/websocket-transport';\n\nimport * as plexus from './gen/plexus-messages';\nimport { DomLogger } from '../../common/DomLogger';\n\ndeclare var window: any;\n\nconst electron = window.require('electron')\nconst remote = electron.remote;\nconst log = new DomLogger('out');\nconst windowAny: any = remote.getCurrentWindow();\nconst wsUrl = windowAny.plexusBrokerWsUrl;\nconst instanceId = windowAny.plexusAppInstanceId;\n\nlog.info(`Received Web Socket URL - ${wsUrl}`);\nlog.info(`Received App Instance ID - ${instanceId.toString()}`);\n\n// Reload and Dev tools hot keys\ndocument.addEventListener('keydown', function (e) {\n    if (e.which === 123) {\n        // F12\n        windowAny.toggleDevTools();\n    } else if (e.which === 116) {\n        // F5\n        location.reload();\n    }\n});\n\nnew WebGreetingServerClientBuilder()\n    .withGreetingServiceInvocationsHandler({\n        onUnary: async (invocationContext, request: plexus.interop.samples.IGreetingRequest) => {\n            log.info(`Received greeting request - ${request.name}`);\n            return {\n                greeting: `Hey, ${request.name}!`\n            };\n        }\n    })\n    .withClientDetails({\n        applicationId: 'interop.samples.WebGreetingServer',\n        applicationInstanceId: instanceId\n    })\n    .withTransportConnectionProvider(() => new WebSocketConnectionFactory(new WebSocket(wsUrl)).connect())\n    .connect()\n    .then(() => log.info('Connected to Broker'))\n    .catch(e => {\n        log.error('Failed to connect');\n    });\n\n\n"
  },
  {
    "path": "web/packages/web-example/src/greeting/server/WebGreetingServerGeneratedClient.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Copyright 2017-2018 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MethodInvocationContext, GenericClientApiBase, Completion, ClientConnectRequest, StreamingInvocationClient, GenericClientApi, InvocationRequestInfo, InvocationClient } from '@plexus-interop/client';\nimport { ProvidedMethodReference, ServiceDiscoveryRequest, ServiceDiscoveryResponse, MethodDiscoveryRequest, MethodDiscoveryResponse, GenericClientApiBuilder, ValueHandler } from '@plexus-interop/client';\nimport { TransportConnection, UniqueId } from '@plexus-interop/transport-common';\nimport { Arrays, Observer, ConversionObserver } from '@plexus-interop/common';\n\nimport * as plexus from './gen/plexus-messages';\n\n/**\n * Main client API\n *\n */\nexport abstract class WebGreetingServerClient {\n\n}\n\n/**\n * Client's API internal implementation\n *\n */\nclass WebGreetingServerClientImpl extends GenericClientApiBase implements WebGreetingServerClient {\n\n    public constructor(\n        private readonly genericClient: GenericClientApi\n    ) {\n        super(genericClient);\n    }\n\n\n}\n\n/**\n * Client invocation handler for GreetingService, to be implemented by Client\n *\n */\nexport abstract class GreetingServiceInvocationHandler {\n\n    public abstract onUnary(invocationContext: MethodInvocationContext, request: plexus.interop.samples.IGreetingRequest): Promise<plexus.interop.samples.IGreetingResponse>;\n\n}\n\n/**\n * Client API builder\n *\n */\nexport class WebGreetingServerClientBuilder {\n\n    private clientDetails: ClientConnectRequest = {\n        applicationId: 'interop.samples.WebGreetingServer',\n        applicationInstanceId: UniqueId.generateNew()\n    };\n\n    private transportConnectionProvider: () => Promise<TransportConnection>;\n\n    private greetingServiceHandler: GreetingServiceInvocationHandler;\n\n    public withClientDetails(clientId: ClientConnectRequest): WebGreetingServerClientBuilder {\n        this.clientDetails = clientId;\n        return this;\n    }\n\n    public withGreetingServiceInvocationsHandler(invocationsHandler: GreetingServiceInvocationHandler): WebGreetingServerClientBuilder {\n        this.greetingServiceHandler = invocationsHandler;\n        return this;\n    }\n\n    public withTransportConnectionProvider(provider: () => Promise<TransportConnection>): WebGreetingServerClientBuilder {\n        this.transportConnectionProvider = provider;\n        return this;\n    }\n\n    public connect(): Promise<WebGreetingServerClient> {\n        return new GenericClientApiBuilder()\n            .withTransportConnectionProvider(this.transportConnectionProvider)\n            .withClientDetails(this.clientDetails)\n            .withTypeAwareUnaryHandler({\n                serviceInfo: {\n                    serviceId: 'interop.samples.GreetingService'\n                },\n                methodId: 'Unary',\n                handle: this.greetingServiceHandler.onUnary.bind(this.greetingServiceHandler)\n            }, plexus.interop.samples.GreetingRequest, plexus.interop.samples.GreetingResponse)\n            .connect()\n            .then(genericClient => new WebGreetingServerClientImpl(\n                genericClient\n));\n    }\n}\n"
  },
  {
    "path": "web/packages/web-example/src/greeting/server/gen/plexus-messages.d.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $protobuf from 'protobufjs';\n\n/** Namespace interop. */\nexport namespace interop {\n\n    /** Namespace samples. */\n    namespace samples {\n\n        /** Represents a GreetingService */\n        class GreetingService extends $protobuf.rpc.Service {\n\n            /**\n             * Constructs a new GreetingService service.\n             * @param rpcImpl RPC implementation\n             * @param [requestDelimited=false] Whether requests are length-delimited\n             * @param [responseDelimited=false] Whether responses are length-delimited\n             */\n            constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n            /**\n             * Creates new GreetingService service using the specified rpc implementation.\n             * @param rpcImpl RPC implementation\n             * @param [requestDelimited=false] Whether requests are length-delimited\n             * @param [responseDelimited=false] Whether responses are length-delimited\n             * @returns RPC service. Useful where requests and/or responses are streamed.\n             */\n            public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GreetingService;\n\n            /**\n             * Calls Unary.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public unary(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.UnaryCallback): void;\n\n            /**\n             * Calls Unary.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public unary(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls ServerStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public serverStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.ServerStreamingCallback): void;\n\n            /**\n             * Calls ServerStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public serverStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls ClientStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public clientStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.ClientStreamingCallback): void;\n\n            /**\n             * Calls ClientStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public clientStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n\n            /**\n             * Calls DuplexStreaming.\n             * @param request GreetingRequest message or plain object\n             * @param callback Node-style callback called with the error, if any, and GreetingResponse\n             */\n            public duplexStreaming(request: interop.samples.IGreetingRequest, callback: interop.samples.GreetingService.DuplexStreamingCallback): void;\n\n            /**\n             * Calls DuplexStreaming.\n             * @param request GreetingRequest message or plain object\n             * @returns Promise\n             */\n            public duplexStreaming(request: interop.samples.IGreetingRequest): Promise<interop.samples.GreetingResponse>;\n        }\n\n        namespace GreetingService {\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#unary}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type UnaryCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#serverStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type ServerStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#clientStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type ClientStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#duplexStreaming}.\n             * @param error Error, if any\n             * @param [response] GreetingResponse\n             */\n            type DuplexStreamingCallback = (error: (Error|null), response?: interop.samples.GreetingResponse) => void;\n        }\n\n        /** Properties of a GreetingRequest. */\n        interface IGreetingRequest {\n\n            /** GreetingRequest name */\n            name?: string;\n        }\n\n        /** Represents a GreetingRequest. */\n        class GreetingRequest {\n\n            /**\n             * Constructs a new GreetingRequest.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: interop.samples.IGreetingRequest);\n\n            /** GreetingRequest name. */\n            public name: string;\n\n            /**\n             * Creates a new GreetingRequest instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns GreetingRequest instance\n             */\n            public static create(properties?: interop.samples.IGreetingRequest): interop.samples.GreetingRequest;\n\n            /**\n             * Encodes the specified GreetingRequest message. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @param message GreetingRequest message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: interop.samples.IGreetingRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified GreetingRequest message, length delimited. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @param message GreetingRequest message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: interop.samples.IGreetingRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.samples.GreetingRequest;\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.samples.GreetingRequest;\n\n            /**\n             * Verifies a GreetingRequest message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a GreetingRequest message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns GreetingRequest\n             */\n            public static fromObject(object: { [k: string]: any }): interop.samples.GreetingRequest;\n\n            /**\n             * Creates a plain object from a GreetingRequest message. Also converts values to other types if specified.\n             * @param message GreetingRequest\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: interop.samples.GreetingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this GreetingRequest to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n\n        /** Properties of a GreetingResponse. */\n        interface IGreetingResponse {\n\n            /** GreetingResponse greeting */\n            greeting?: string;\n        }\n\n        /** Represents a GreetingResponse. */\n        class GreetingResponse {\n\n            /**\n             * Constructs a new GreetingResponse.\n             * @param [properties] Properties to set\n             */\n            constructor(properties?: interop.samples.IGreetingResponse);\n\n            /** GreetingResponse greeting. */\n            public greeting: string;\n\n            /**\n             * Creates a new GreetingResponse instance using the specified properties.\n             * @param [properties] Properties to set\n             * @returns GreetingResponse instance\n             */\n            public static create(properties?: interop.samples.IGreetingResponse): interop.samples.GreetingResponse;\n\n            /**\n             * Encodes the specified GreetingResponse message. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @param message GreetingResponse message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encode(message: interop.samples.IGreetingResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Encodes the specified GreetingResponse message, length delimited. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @param message GreetingResponse message or plain object to encode\n             * @param [writer] Writer to encode to\n             * @returns Writer\n             */\n            public static encodeDelimited(message: interop.samples.IGreetingResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer.\n             * @param reader Reader or buffer to decode from\n             * @param [length] Message length if known beforehand\n             * @returns GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): interop.samples.GreetingResponse;\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer, length delimited.\n             * @param reader Reader or buffer to decode from\n             * @returns GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): interop.samples.GreetingResponse;\n\n            /**\n             * Verifies a GreetingResponse message.\n             * @param message Plain object to verify\n             * @returns `null` if valid, otherwise the reason why it is not\n             */\n            public static verify(message: { [k: string]: any }): (string|null);\n\n            /**\n             * Creates a GreetingResponse message from a plain object. Also converts values to their respective internal types.\n             * @param object Plain object\n             * @returns GreetingResponse\n             */\n            public static fromObject(object: { [k: string]: any }): interop.samples.GreetingResponse;\n\n            /**\n             * Creates a plain object from a GreetingResponse message. Also converts values to other types if specified.\n             * @param message GreetingResponse\n             * @param [options] Conversion options\n             * @returns Plain object\n             */\n            public static toObject(message: interop.samples.GreetingResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n\n            /**\n             * Converts this GreetingResponse to JSON.\n             * @returns JSON object\n             */\n            public toJSON(): { [k: string]: any };\n        }\n    }\n}\n"
  },
  {
    "path": "web/packages/web-example/src/greeting/server/gen/plexus-messages.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.sample || ($protobuf.roots.sample = {});\n\n$root.interop = (function() {\n\n    /**\n     * Namespace interop.\n     * @exports interop\n     * @namespace\n     */\n    var interop = {};\n\n    interop.samples = (function() {\n\n        /**\n         * Namespace samples.\n         * @memberof interop\n         * @namespace\n         */\n        var samples = {};\n\n        samples.GreetingService = (function() {\n\n            /**\n             * Constructs a new GreetingService service.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingService\n             * @extends $protobuf.rpc.Service\n             * @constructor\n             * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n             * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n             * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n             */\n            function GreetingService(rpcImpl, requestDelimited, responseDelimited) {\n                $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n            }\n\n            (GreetingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GreetingService;\n\n            /**\n             * Creates new GreetingService service using the specified rpc implementation.\n             * @function create\n             * @memberof interop.samples.GreetingService\n             * @static\n             * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n             * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n             * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n             * @returns {GreetingService} RPC service. Useful where requests and/or responses are streamed.\n             */\n            GreetingService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n                return new this(rpcImpl, requestDelimited, responseDelimited);\n            };\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#unary}.\n             * @memberof interop.samples.GreetingService\n             * @typedef UnaryCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls Unary.\n             * @function .unary\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.UnaryCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.unary = function unary(request, callback) {\n                return this.rpcCall(unary, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls Unary.\n             * @function unary\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#serverStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef ServerStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls ServerStreaming.\n             * @function .serverStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.ServerStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.serverStreaming = function serverStreaming(request, callback) {\n                return this.rpcCall(serverStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls ServerStreaming.\n             * @function serverStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#clientStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef ClientStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls ClientStreaming.\n             * @function .clientStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.ClientStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.clientStreaming = function clientStreaming(request, callback) {\n                return this.rpcCall(clientStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls ClientStreaming.\n             * @function clientStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            /**\n             * Callback as used by {@link interop.samples.GreetingService#duplexStreaming}.\n             * @memberof interop.samples.GreetingService\n             * @typedef DuplexStreamingCallback\n             * @type {function}\n             * @param {Error|null} error Error, if any\n             * @param {interop.samples.GreetingResponse} [response] GreetingResponse\n             */\n\n            /**\n             * Calls DuplexStreaming.\n             * @function .duplexStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @param {interop.samples.GreetingService.DuplexStreamingCallback} callback Node-style callback called with the error, if any, and GreetingResponse\n             * @returns {undefined}\n             * @variation 1\n             */\n            GreetingService.prototype.duplexStreaming = function duplexStreaming(request, callback) {\n                return this.rpcCall(duplexStreaming, $root.interop.samples.GreetingRequest, $root.interop.samples.GreetingResponse, request, callback);\n            };\n\n            /**\n             * Calls DuplexStreaming.\n             * @function duplexStreaming\n             * @memberof interop.samples.GreetingService\n             * @instance\n             * @param {interop.samples.IGreetingRequest} request GreetingRequest message or plain object\n             * @returns {Promise<interop.samples.GreetingResponse>} Promise\n             * @variation 2\n             */\n\n            return GreetingService;\n        })();\n\n        samples.GreetingRequest = (function() {\n\n            /**\n             * Properties of a GreetingRequest.\n             * @memberof interop.samples\n             * @interface IGreetingRequest\n             * @property {string} [name] GreetingRequest name\n             */\n\n            /**\n             * Constructs a new GreetingRequest.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingRequest.\n             * @constructor\n             * @param {interop.samples.IGreetingRequest=} [properties] Properties to set\n             */\n            function GreetingRequest(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GreetingRequest name.\n             * @member {string}name\n             * @memberof interop.samples.GreetingRequest\n             * @instance\n             */\n            GreetingRequest.prototype.name = \"\";\n\n            /**\n             * Creates a new GreetingRequest instance using the specified properties.\n             * @function create\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.IGreetingRequest=} [properties] Properties to set\n             * @returns {interop.samples.GreetingRequest} GreetingRequest instance\n             */\n            GreetingRequest.create = function create(properties) {\n                return new GreetingRequest(properties);\n            };\n\n            /**\n             * Encodes the specified GreetingRequest message. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @function encode\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.IGreetingRequest} message GreetingRequest message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingRequest.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified GreetingRequest message, length delimited. Does not implicitly {@link interop.samples.GreetingRequest.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.IGreetingRequest} message GreetingRequest message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingRequest.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer.\n             * @function decode\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {interop.samples.GreetingRequest} GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingRequest.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.samples.GreetingRequest();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a GreetingRequest message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {interop.samples.GreetingRequest} GreetingRequest\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingRequest.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a GreetingRequest message.\n             * @function verify\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GreetingRequest.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a GreetingRequest message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {interop.samples.GreetingRequest} GreetingRequest\n             */\n            GreetingRequest.fromObject = function fromObject(object) {\n                if (object instanceof $root.interop.samples.GreetingRequest)\n                    return object;\n                var message = new $root.interop.samples.GreetingRequest();\n                if (object.name != null)\n                    message.name = String(object.name);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GreetingRequest message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof interop.samples.GreetingRequest\n             * @static\n             * @param {interop.samples.GreetingRequest} message GreetingRequest\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GreetingRequest.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.name = \"\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                return object;\n            };\n\n            /**\n             * Converts this GreetingRequest to JSON.\n             * @function toJSON\n             * @memberof interop.samples.GreetingRequest\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GreetingRequest.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return GreetingRequest;\n        })();\n\n        samples.GreetingResponse = (function() {\n\n            /**\n             * Properties of a GreetingResponse.\n             * @memberof interop.samples\n             * @interface IGreetingResponse\n             * @property {string} [greeting] GreetingResponse greeting\n             */\n\n            /**\n             * Constructs a new GreetingResponse.\n             * @memberof interop.samples\n             * @classdesc Represents a GreetingResponse.\n             * @constructor\n             * @param {interop.samples.IGreetingResponse=} [properties] Properties to set\n             */\n            function GreetingResponse(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GreetingResponse greeting.\n             * @member {string}greeting\n             * @memberof interop.samples.GreetingResponse\n             * @instance\n             */\n            GreetingResponse.prototype.greeting = \"\";\n\n            /**\n             * Creates a new GreetingResponse instance using the specified properties.\n             * @function create\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.IGreetingResponse=} [properties] Properties to set\n             * @returns {interop.samples.GreetingResponse} GreetingResponse instance\n             */\n            GreetingResponse.create = function create(properties) {\n                return new GreetingResponse(properties);\n            };\n\n            /**\n             * Encodes the specified GreetingResponse message. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @function encode\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.IGreetingResponse} message GreetingResponse message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingResponse.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.greeting);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified GreetingResponse message, length delimited. Does not implicitly {@link interop.samples.GreetingResponse.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.IGreetingResponse} message GreetingResponse message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GreetingResponse.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer.\n             * @function decode\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {interop.samples.GreetingResponse} GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingResponse.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.interop.samples.GreetingResponse();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.greeting = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a GreetingResponse message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {interop.samples.GreetingResponse} GreetingResponse\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GreetingResponse.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a GreetingResponse message.\n             * @function verify\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GreetingResponse.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    if (!$util.isString(message.greeting))\n                        return \"greeting: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a GreetingResponse message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {interop.samples.GreetingResponse} GreetingResponse\n             */\n            GreetingResponse.fromObject = function fromObject(object) {\n                if (object instanceof $root.interop.samples.GreetingResponse)\n                    return object;\n                var message = new $root.interop.samples.GreetingResponse();\n                if (object.greeting != null)\n                    message.greeting = String(object.greeting);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GreetingResponse message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof interop.samples.GreetingResponse\n             * @static\n             * @param {interop.samples.GreetingResponse} message GreetingResponse\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GreetingResponse.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.greeting = \"\";\n                if (message.greeting != null && message.hasOwnProperty(\"greeting\"))\n                    object.greeting = message.greeting;\n                return object;\n            };\n\n            /**\n             * Converts this GreetingResponse to JSON.\n             * @function toJSON\n             * @memberof interop.samples.GreetingResponse\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GreetingResponse.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            return GreetingResponse;\n        })();\n\n        return samples;\n    })();\n\n    return interop;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "web/packages/web-example/src/greeting/views/greetingServer.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <title> Plexus Web Greeter Server </title>\n</head>\n<body>\n    <h4>Plexus Web Greeter Server</h4>\n    <code id=\"out\"></code>\n    <script src=\"greetingServer.bundle.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "web/packages/web-example/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"outDir\": \"dist/main\",\n    \"rootDir\": \".\",\n    \"moduleResolution\": \"node\",\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"importHelpers\": true,\n    \"inlineSourceMap\": true,\n    \"listFiles\": false,\n    \"traceResolution\": false,\n    \"strictNullChecks\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noImplicitAny\": true,\n    \"noImplicitReturns\": true,\n    \"noImplicitThis\": true,\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true,\n    \"pretty\": true,\n    \"lib\": [\n      \"es6\", \"dom\"\n    ],\n    \"types\": [\n      \"node\",\n      \"long\"\n    ],\n    \"baseUrl\": \".\"\n  },\n  \"include\": [\n    \"src/**/*.ts\",\n    \"tests/**/*.ts\"\n  ],\n  \"exclude\": [\n    \"node_modules/**\"\n  ],\n  \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/web-example/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/packages/websocket-transport/.npmignore",
    "content": ".gradle\n.vscode\nnode_modules\ntarget\ncoverage"
  },
  {
    "path": "web/packages/websocket-transport/package.json",
    "content": "{\n  \"name\": \"@plexus-interop/websocket-transport\",\n  \"types\": \"dist/main/src/index.d.ts\",\n  \"description\": \"Web Socket based Transport for Plexus Web Interop\",\n  \"license\": \"Apache-2.0\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"prebuild\": \"yarn lint && trash dist\",\n    \"build\": \"yarn build:main\",\n    \"postbuild\": \"yarn test\",\n    \"build:main\": \"tsc -p tsconfig.json\",\n    \"lint\": \"tslint src/**/*.ts\",\n    \"unit\": \"jest --coverage\",\n    \"pretest\": \"yarn lint\",\n    \"test\": \"yarn unit\"\n  },\n  \"dependencies\": {\n    \"long\": \"^4.0.0\",\n    \"rxjs\": \"^5.5.2\",\n    \"protobufjs\": \"6.11.3\",\n    \"@plexus-interop/transport-common\": \"0.1.0\",\n    \"@plexus-interop/common\": \"0.1.0\",\n    \"@plexus-interop/protocol\": \"0.1.0\",\n    \"reflect-metadata\": \"^0.1.10\",\n    \"tslib\": \"^1.10.0\"\n  },\n  \"peerDependencies\": {\n    \"protobufjs\": \"6.11.3\",\n    \"rxjs\": \"^5.5.2\"\n  },\n  \"main\": \"dist/main/src/index.js\",\n  \"devDependencies\": {\n    \"@types/jest\": \"^23.1.3\",\n    \"@types/long\": \"^4.0.0\",\n    \"@types/node\": \"^7.0.5\",\n    \"babel-register\": \"^6.23.0\",\n    \"find-port\": \"^2.0.1\",\n    \"jasmine-reporters\": \"^2.2.0\",\n    \"jest\": \"^23.5.0\",\n    \"mock-socket\": \"^7.0.0\",\n    \"trash-cli\": \"^1.4.0\",\n    \"tslint\": \"5.8.0\",\n    \"typescript\": \"3.7.2\",\n    \"yarn\": \"^1.17.3\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/setup-jasmine.js\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\"\n    ],\n    \"testRegex\": \".+/dist/main/tests/.+.spec.js$\",\n    \"coverageDirectory\": \"coverage\",\n    \"collectCoverageFrom\": [\n      \"dist/main/src/**/*.js\",\n      \"!src/*.d.ts\",\n      \"!src/**/*.d.ts\",\n      \"!src/**/*.spec.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "web/packages/websocket-transport/setup-jasmine.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst reporters = require('jasmine-reporters');\nconst reporter = new reporters.JUnitXmlReporter({\n    // Jest runs many instances of Jasmine in parallel. Force distinct file output\n    // per test to avoid collisions.\n    consolidateAll: false,\n    filePrefix: 'jest-junit-result-',\n    savePath: __dirname + '/target/surefire-reports/',\n});\njasmine.getEnv().addReporter(reporter);\n"
  },
  {
    "path": "web/packages/websocket-transport/src/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './transport';"
  },
  {
    "path": "web/packages/websocket-transport/src/transport/WebSocketConnectionFactory.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ClientConnectionFactory, TransportConnection, FramedTransportConnection, ConnectionDetails } from '@plexus-interop/transport-common';\nimport { WebSocketFramedTransport } from './WebSocketFramedTransport';\n\nexport class WebSocketConnectionFactory implements ClientConnectionFactory {\n\n    constructor(private readonly socket: WebSocket) { }\n\n    public connect(connectionDetails?: ConnectionDetails): Promise<TransportConnection> {\n        return new Promise((resolve, reject) => {\n            const webSocketTransport = new WebSocketFramedTransport(this.socket);\n            webSocketTransport.connectionEstablished().then(() => {\n                const connection = new FramedTransportConnection(webSocketTransport);\n                connection.connect(connectionDetails ? connectionDetails.incomingChannelsObserver : undefined)\n                    .then(() => resolve(connection))\n                    .catch(reject);\n            }, (error) => {\n                reject(error);\n            });\n        });\n    }\n\n}"
  },
  {
    "path": "web/packages/websocket-transport/src/transport/WebSocketFramedTransport.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { UniqueId, ConnectableFramedTransport, Frame, InternalMessagesConverter, Defaults, BufferedObserver } from '@plexus-interop/transport-common';\nimport { CancellationToken, Logger, LoggerFactory, Observer, AsyncHelper } from '@plexus-interop/common';\n\nexport class WebSocketFramedTransport implements ConnectableFramedTransport {\n\n    public static TERMINATE_MESSAGE: string = '<END>';\n    public static SOCKET_CLOSE_TIMEOUT: number = 5000;\n    public static TERMINATE_MESSAGE_RECEIVED_TIMEOUT: number = 10000;\n    public static TERMINATE_MESSAGE_CHECK_TIMEOUT: number = 300;\n    public static CONNECTING: number = 0;\n    public static OPEN: number = 1;\n    public static CLOSING: number = 2;\n    public static CLOSED: number = 3;\n\n    private log: Logger;\n\n    private readonly socketOpenToken: CancellationToken = new CancellationToken();\n\n    private connectionObserver: BufferedObserver<Frame>;\n\n    private connectionEstablishedPromise: Promise<void>;\n\n    private dataFrame: Frame | null;\n\n    private terminateSent: boolean = false;\n\n    public terminateReceived: boolean = false;\n\n    constructor(\n        private readonly socket: WebSocket,\n        private readonly guid: UniqueId = UniqueId.generateNew(),\n        private messagesConverter: InternalMessagesConverter = new InternalMessagesConverter()) {\n        this.socket.binaryType = 'arraybuffer';\n        this.log = LoggerFactory.getLogger(`WebSocketFramedTransport [${this.uuid().toString()}]`);\n        this.connectionObserver = new BufferedObserver<Frame>(Defaults.DEFAULT_BUFFER_SIZE, this.log);\n        this.connectionEstablishedPromise = this.createConnectionReadyPromise();\n        this.bindToSocketEvents();\n        this.log.debug('Created');\n    }\n\n    public connectionEstablished(): Promise<void> {\n        return this.connectionEstablishedPromise;\n    }\n\n    public disconnect(): Promise<void> {\n        if (this.socketOpenToken.isCancelled()) {\n            this.log.warn('Already disconnected');\n            return Promise.resolve();\n        }\n        if (this.isSocketClosed()) {\n            this.log.warn('Socket is CLOSED, cancelling connection');\n            this.cancelConnectionAndCleanUp();\n            return Promise.resolve();\n        } else {\n            this.throwIfNotConnected();\n            return this.closeConnectionInternal();\n        }\n    }\n\n    public connected(): boolean {\n        return this.socket.readyState === WebSocketFramedTransport.OPEN;\n    }\n\n    public async open(connectionObserver: Observer<Frame>): Promise<void> {\n        this.throwIfNotConnectedOrDisconnectRequested();\n        this.connectionObserver.setObserver(connectionObserver);\n    }\n\n    public async writeFrame(frame: Frame): Promise<void> {\n        this.throwIfNotConnectedOrDisconnectRequested();\n        const data: ArrayBuffer = this.messagesConverter.serialize(frame);\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug(`Sending header frame of ${data.byteLength} bytes to server`);\n        }\n        this.socket.send(data);\n        if (frame.isDataFrame()) {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug(`Sending data frame of ${frame.body.byteLength} bytes to server`);\n            }\n            this.socket.send(frame.body);\n        } else if (frame.internalHeaderProperties.close) {\n            this.sendTerminateMessage();\n        }\n    }\n\n    public closeSocket(): void {\n        this.socket.close();\n    }\n\n    public getMaxFrameSize(): number {\n        return Defaults.DEFAULT_FRAME_SIZE;\n    }\n\n    public uuid(): UniqueId {\n        return this.guid;\n    }\n\n    private sendTerminateMessage(): void {\n        this.log.debug('Sending terminate message');\n        this.socket.send(WebSocketFramedTransport.TERMINATE_MESSAGE);\n        this.terminateSent = true;\n    }\n\n    private createConnectionReadyPromise(): Promise<void> {\n        let opened = false;\n        return new Promise<void>((resolve, reject) => {\n            this.socket.onopen = () => {\n                opened = true;\n                this.handleOpen();\n                resolve();\n            };\n            this.socket.addEventListener('error', (e) => {\n                if (!opened) {\n                    reject('Connection error');\n                } else {\n                    this.log.warn('Connection error', e);\n                }\n            });\n        });\n    }\n\n    private isSocketClosed(): boolean {\n        return this.socket.readyState === WebSocketFramedTransport.CLOSED\n            || this.socket.readyState === WebSocketFramedTransport.CLOSING;\n    }\n\n    private bindToSocketEvents(): void {\n        this.socket.onmessage = this.handleMessageEvent.bind(this);\n        this.socket.onerror = this.handleError.bind(this);\n        this.socket.onclose = this.handleCloseEvent.bind(this);\n    }\n\n    private async closeConnectionInternal(): Promise<void> {\n        this.log.debug('Closing connection');\n        this.cancelConnectionAndCleanUp();\n        if (this.terminateSent && this.terminateReceived) {\n            this.scheduleSocketDisconnect();\n        } else if (this.terminateSent) {\n            this.log.debug('Server terminate event not received, waiting to close connection gracefully');\n            await this.waitForTerminateMessage();\n        } else if (this.terminateReceived) {\n            this.sendTerminateMessage();\n            this.scheduleSocketDisconnect();\n        } else {\n            this.sendTerminateMessage();\n        }\n    }\n\n    private async waitForTerminateMessage(): Promise<void> {\n        try {\n            await AsyncHelper.waitFor(\n                () => this.terminateReceived,\n                new CancellationToken(),\n                WebSocketFramedTransport.TERMINATE_MESSAGE_CHECK_TIMEOUT,\n                WebSocketFramedTransport.TERMINATE_MESSAGE_RECEIVED_TIMEOUT);\n        } catch (error) {\n            const errorMsg = `WebSocket Terminate message not received within ${WebSocketFramedTransport.TERMINATE_MESSAGE_RECEIVED_TIMEOUT}ms`;\n            this.log.error(errorMsg, error);\n            throw new Error(errorMsg);\n        }\n    }\n\n    private scheduleSocketDisconnect(): void {\n        this.log.debug('Scheduling socket close action');\n        setTimeout(() => {\n            try {\n                if (this.connected()) {\n                    this.log.debug('Closing socket');\n                    this.socket.close();\n                } else {\n                    this.log.debug('Already closed');\n                }\n            } catch (error) {\n                this.log.error('Error on closing the socket', error);\n            }\n        }, WebSocketFramedTransport.SOCKET_CLOSE_TIMEOUT);\n    }\n\n    private cancelConnectionAndCleanUp(reason: string = 'Connection closed'): void {\n        this.log.debug(`Cancelling connection with reason: ${reason}`);\n        this.socketOpenToken.cancel(reason);\n        this.connectionObserver.clear();\n    }\n\n    private handleCloseEvent(socket: WebSocket, ev: CloseEvent): void {\n        this.log.debug('Connection closed event received', ev);\n        this.connectionObserver.complete();\n    }\n\n    private handleMessageEvent(ev: MessageEvent): void {\n        /* istanbul ignore if */\n        if (this.log.isDebugEnabled()) {\n            this.log.debug('Message event received');\n        }\n        if (this.isTerminateMessage(ev)) {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug('Terminate message received');\n            }\n            this.terminateReceived = true;\n        } else if (this.terminateReceived) {\n            this.log.warn('Terminate message already received, dropping frame', ev.data);\n        } else {\n            const data: Uint8Array = this.readEventData(ev);\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug(`Received message of ${data.byteLength} bytes`);\n            }\n            if (this.dataFrame) {\n                this.dataFrame.body = data.buffer;\n                this.connectionObserver.next(this.dataFrame);\n                this.dataFrame = null;\n            } else {\n                const frame = this.messagesConverter.deserialize(data);\n                if (frame.isDataFrame()) {\n                    /* istanbul ignore if */\n                    if (this.log.isDebugEnabled()) {\n                        this.log.debug('Message header frame, waiting for data frame');\n                    }\n                    this.dataFrame = frame;\n                } else {\n                    this.connectionObserver.next(frame);\n                }\n            }\n        }\n    }\n\n    private isTerminateMessage(ev: MessageEvent): boolean {\n        return ev.data === WebSocketFramedTransport.TERMINATE_MESSAGE;\n    }\n\n    private readEventData(ev: MessageEvent): Uint8Array {\n        if (ev.data instanceof Array) {\n            return new Uint8Array(ev.data);\n        } else if (this.isArrayBuffer(ev.data)) {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug('Array Buffer message');\n            }\n            return new Uint8Array(ev.data);\n        } else if (this.isArrayBufferView(ev.data)) {\n            /* istanbul ignore if */\n            if (this.log.isDebugEnabled()) {\n                this.log.debug('ArrayBufferView Buffer message');\n            }\n            return new Uint8Array(ev.data);\n        } else {\n            this.log.error('Unknown payload type', ev.data);\n            throw new Error('Unknown payload type');\n        }\n    }\n\n    private isArrayBuffer(value: any): boolean {\n        return value && value.byteLength !== undefined;\n    }\n\n    private isArrayBufferView(value: any): boolean {\n        return value && value.buffer && value.buffer.byteLength !== undefined;\n    }\n\n    private handleError(socket: WebSocket, ev: Event): void {\n        this.log.error('Connection error received', ev);\n        this.cancelConnectionAndCleanUp('Connection error received');\n        if (this.connectionObserver) {\n            this.connectionObserver.error('Web Socket Connection Error received');\n        }\n    }\n\n    private handleOpen(): void {\n        this.log.debug('Connection opened');\n    }\n\n    private throwIfNotConnected(): void {\n        if (!this.connected()) {\n            throw new Error('Web Socket is not connected');\n        }\n    }\n\n    private throwIfNotConnectedOrDisconnectRequested(): void {\n        this.throwIfNotConnected();\n        if (this.terminateSent) {\n            throw new Error('Terminate socket requested');\n        }\n    }\n}"
  },
  {
    "path": "web/packages/websocket-transport/src/transport/index.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './WebSocketConnectionFactory';\nexport * from './WebSocketFramedTransport';"
  },
  {
    "path": "web/packages/websocket-transport/tests/transports/WebSocketFramedTransport.spec.ts",
    "content": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebSocketFramedTransport } from '../../src/transport/WebSocketFramedTransport';\nimport { ChannelOpenFrame, InternalMessagesConverter, MessageFrame, UniqueId } from '@plexus-interop/transport-common';\n\n// tslint:disable-next-line:variable-name\nconst MockSocket = require('mock-socket');\nconst findPort = require('find-port')\n\nconst Server = MockSocket.Server;\n// tslint:disable-next-line:variable-name\nconst MockWebSocket = MockSocket.WebSocket;\n\ndescribe('WebSocketFramedTransport', () => {\n\n    const messagesConverter = new InternalMessagesConverter();\n    let connectionUrl: string | null = null;\n\n    let mockServer: any = null;\n\n    beforeEach((done) => {\n        findPort('localhost', 8000, 8015, (ports: Array<number>) => {\n            connectionUrl = 'ws://localhost:' + ports[0];\n            mockServer = new Server(connectionUrl);\n            mockServer.on('connection', () => {\n                // tslint:disable-next-line:no-console\n            });\n            done();\n        });\n    });\n\n    afterEach((done) => {\n        mockServer.stop(() => {\n            // tslint:disable-next-line:no-console\n            done();\n        });\n    });\n\n    const newMockSocket = () => new MockWebSocket(connectionUrl);\n    const newMockedTransport = () => new WebSocketFramedTransport(newMockSocket());\n\n    it('Connects to socket after creation', () => {\n        return newMockedTransport().connectionEstablished();\n    });\n\n    it('Transmits header frames with Array Buffer view type', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            const frame = ChannelOpenFrame.fromHeaderData({ channelId: UniqueId.generateNew() });\n            mockServer.send(new Uint8Array(messagesConverter.serialize(frame)));\n            transport.open({\n                next: (frame) => {\n                    const channelFrame = frame as ChannelOpenFrame;\n                    expect(frame).toBeDefined();\n                    expect(channelFrame).toEqual(frame);\n                    done();\n                },\n                complete: () => { },\n                error: () => { }\n            });\n        });\n    });\n\n    it('Transmits header frames with Array Buffer type', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            const frame = ChannelOpenFrame.fromHeaderData({ channelId: UniqueId.generateNew() });\n            mockServer.send(messagesConverter.serialize(frame));\n            transport.open({\n                next: receivedFrame => {\n                    const channelFrame = receivedFrame as ChannelOpenFrame;\n                    expect(receivedFrame).toBeDefined();\n                    expect(channelFrame).toEqual(frame);\n                    done();\n                },\n                complete: () => { },\n                error: () => { }\n            });\n        });\n    });\n\n    it('Fails on to open connection after disconnect', done => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            transport.disconnect().then(() => {\n                transport.open({\n                    next: () => { },\n                    complete: () => { },\n                    error: () => { }\n                })\n                .catch(() => done());\n            });\n        });\n    });\n\n    it('Fails on writing frame after disconnect', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            transport.disconnect().then(() => {\n                const frame = ChannelOpenFrame.fromHeaderData({ channelId: UniqueId.generateNew() });\n                transport.writeFrame(frame).catch(() => done());\n            });\n        });\n    });\n\n    it('Sends terminate message to server on disconnent action', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            mockServer.on('message', (data: any) => {\n                expect(data).toEqual(WebSocketFramedTransport.TERMINATE_MESSAGE);\n                done();\n            });\n            transport.disconnect();\n        });\n    });\n\n    it('Transmits frame to client with data payload', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            const messageHeaderFrame = MessageFrame.fromHeaderData({\n                channelId: UniqueId.generateNew(),\n                hasMore: false\n            });\n            const payload = new Uint8Array([1, 2, 3]);\n            mockServer.send(messagesConverter.serialize(messageHeaderFrame));\n            mockServer.send(payload);\n            transport.open({\n                next: receivedFrame => {\n                    expect(receivedFrame).toBeDefined();\n                    const receivedMessageFrame: MessageFrame = receivedFrame as MessageFrame;\n                    expect(receivedMessageFrame.getHeaderData()).toEqual(messageHeaderFrame.getHeaderData());\n                    expect(receivedFrame.body).toBeDefined();\n                    done();\n                },\n                complete: () => { },\n                error: () => { }\n            });\n        });\n    });\n\n    it('Transmits frame to server', (done) => {\n        const transport = newMockedTransport();\n        transport.connectionEstablished().then(() => {\n            const frame = ChannelOpenFrame.fromHeaderData({ channelId: UniqueId.generateNew() });\n            mockServer.on('message', (data: any) => {\n                const received = messagesConverter.deserialize(new Uint8Array(data));\n                expect(received).toEqual(frame);\n                done();\n            });\n            transport.writeFrame(frame);\n        });\n    });\n\n    it('Closes connection if server closed it', (done) => {\n        const transport = newMockedTransport();\n        mockServer.on('connection', (data: any) => {\n            mockServer.close();\n            setTimeout(() => {\n                expect(transport.connected()).toEqual(false);\n                transport.open({\n                    next: (n) => { },\n                    complete: () => { },\n                    error: (w) => { }\n                }).catch(() => done());\n            }, 0);\n        });\n    });\n\n});\n"
  },
  {
    "path": "web/packages/websocket-transport/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"dist/main\",\n        \"rootDir\": \".\",\n        \"moduleResolution\": \"node\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"importHelpers\": true,\n        \"inlineSourceMap\": true,\n        \"listFiles\": false,\n        \"traceResolution\": false,\n        \"strictNullChecks\": true,\n        \"forceConsistentCasingInFileNames\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitAny\": true,\n        \"noImplicitReturns\": true,\n        \"noImplicitThis\": true,\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"removeComments\": false,\n        \"pretty\": true,\n        \"lib\": [\n            \"es6\", \"dom\"\n        ],\n        \"types\": [\n            \"node\",\n            \"jest\",\n            \"long\"\n        ],\n        \"baseUrl\": \".\"\n    },\n    \"include\": [\n        \"src/**/*.ts\",\n        \"tests/**/*.ts\"\n    ],\n    \"exclude\": [\n        \"node_modules/**\"\n    ],\n    \"compileOnSave\": false\n}"
  },
  {
    "path": "web/packages/websocket-transport/tslint.json",
    "content": "{\n    \"extends\": \"../../configs/tslint.json\"\n}"
  },
  {
    "path": "web/scripts/replace-auth-vars.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n\n    Only native modules can be used here, the main goal is to generate .npmrc based on Env variables, \n    so \"npm install\" will work on CI environment\n\n*/\n\nconst fs = require('fs');\n\nconst install = process.argv.indexOf('--install') !== -1;\n\nconsole.log(`Preparing .npmrc file for ${install ? \"install\" : \"publish\"}`);\n\nconst postfix = install ? \"_INSTALL\" : \"_PUBLISH\";\n\nconst buildRunner = process.env['BuildRunner'];\n\nif (!!buildRunner) {\n    \n    console.log(`Running in CI mode, build runner: ${buildRunner}`);\n\n    const registryVar = 'NPM_REGISTRY';\n    const authTokenVar = 'NPM_AUTH_TOKEN';\n\n    const authToken = process.env[`${authTokenVar}${postfix}`] || process.env[authTokenVar];\n    let registry = process.env[`${registryVar}${postfix}`] || process.env[registryVar];\n    const templateFile = install ? '.ci-npmrc-tpl' : '.ci-publish-npmrc-tpl';\n\n    if (!!authToken) {\n        console.log(`Auth Token length ${authToken.length}`);\n    }\n\n    if (!!registry) {\n        console.log(`Registry value ${registry}`);\n    }\n\n    if (!authToken || !registry) {\n\n        console.log(\"Not all auth variables provided\");\n        \n        fs.writeFile('.npmrc', \"# Auto generated during CI build\", 'utf8', function (err) {\n            if (err) return console.log(err);\n        });\n\n    } else {\n\n        if (!install) {\n            // clear http/https for publish\n            registry = registry.replace(\"https:\", \"\");\n            registry = registry.replace(\"http:\", \"\");\n        }\n\n        const disableStrictSsl = process.env['NPM_STRICT_SSL'] === 'false';\n        const enableAlwaysAuth = process.env['NPM_ALWAYS_AUTH'] === 'true';\n\n        fs.readFile(templateFile, 'utf8', function (err,data) {\n            if (err) {\n                return console.log(err);\n            }\n            // Replace with RegExp to replace all instances\n            data = data.replace(new RegExp(`\\\\\\${${registryVar}}`, 'g'), registry);\n            data = data.replace(`\\${${authTokenVar}}`, authToken);\n\n            if (disableStrictSsl) {\n                console.log('Updating strict ssl setting');\n                data += `\\nstrict-ssl=false`;\n            }\n\n            if (enableAlwaysAuth) {\n                console.log('Enabling always auth');\n                data += `\\nalways-auth=true`;\n            }\n            \n            fs.writeFile('.npmrc', data, 'utf8', function (err) {\n                if (err) return console.log(err);\n            });\n        });\n\n        if (disableStrictSsl) {\n            console.log('Generating .yarnrc');\n            fs.readFile('.yarnrc', 'utf8', function (err,data) {\n                if (err) {\n                    return console.log(err);\n                }    \n                data = 'workspaces-experimental true';\n                data += `\\nstrict-ssl false`;\n                fs.writeFile('.yarnrc', data, 'utf8', function (err) {\n                    if (err) return console.log(err);\n                });\n            });\n        }\n\n    }\n\n} else {\n    console.log(\"Dev mode, .npmrc generation skipped\");\n}"
  },
  {
    "path": "web/scripts/replace-lock-registry.js",
    "content": "/*\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Work around for // https://github.com/yarnpkg/yarn/issues/3330\n\nconst fs = require('fs')\n\nconst backward = process.argv.indexOf('--backward') !== -1;\n\nconsole.log(`Looking for install registry env variable`);\n\nconst value = process.env[\"NPM_REGISTRY_INSTALL\"] || process.env[\"NPM_REGISTRY\"];\n\nif (!value) {\n    console.log(\"Custom registry not specified\");\n    process.exit(0);\n}\n\nconst replace = (from, to, file) => {\n\n    console.log(`Replacing registry entries from ${from} to ${to} for ${file}`);\n\n    fs.readFile(file, 'utf8', function (err,data) {\n        if (err) {\n            return console.log(err);\n        }\n        const result = data.replace(new RegExp(from, 'g'), to);\n        fs.writeFile(file, result, 'utf8', function (err) {\n            if (err) return console.log(err);\n        });\n    });\n}\n\nconsole.log(\"Registry value found, replacing lock file entries\");\n\nlet from = 'https://registry.npmjs.org';\nlet to = `${value}`;\nif (backward) {\n    const temp = from;\n    from = to;\n    to = temp;\n}\n\nreplace(from, to, \"package-lock.json\");\n"
  }
]